summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base')
-rw-r--r--Master/texmf-dist/tex/context/base/colo-ini.tex178
-rw-r--r--Master/texmf-dist/tex/context/base/cont-fil.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/cont-fr.tex38
-rw-r--r--Master/texmf-dist/tex/context/base/cont-log.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/cont-new.tex345
-rw-r--r--Master/texmf-dist/tex/context/base/cont-old.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/cont-sys.ori3
-rw-r--r--Master/texmf-dist/tex/context/base/context.tex51
-rw-r--r--Master/texmf-dist/tex/context/base/core-bar.tex195
-rw-r--r--Master/texmf-dist/tex/context/base/core-box.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/core-buf.tex81
-rw-r--r--Master/texmf-dist/tex/context/base/core-con.tex103
-rw-r--r--Master/texmf-dist/tex/context/base/core-dat.tex138
-rw-r--r--Master/texmf-dist/tex/context/base/core-des.tex193
-rw-r--r--Master/texmf-dist/tex/context/base/core-fig.tex251
-rw-r--r--Master/texmf-dist/tex/context/base/core-fil.tex134
-rw-r--r--Master/texmf-dist/tex/context/base/core-fld.tex34
-rw-r--r--Master/texmf-dist/tex/context/base/core-fnt.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/core-ini.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/core-int.tex40
-rw-r--r--Master/texmf-dist/tex/context/base/core-itm.tex443
-rw-r--r--Master/texmf-dist/tex/context/base/core-job.tex76
-rw-r--r--Master/texmf-dist/tex/context/base/core-lnt.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/core-lst.tex99
-rw-r--r--Master/texmf-dist/tex/context/base/core-mak.tex18
-rw-r--r--Master/texmf-dist/tex/context/base/core-mar.tex237
-rw-r--r--Master/texmf-dist/tex/context/base/core-mat.tex1190
-rw-r--r--Master/texmf-dist/tex/context/base/core-mis.tex1046
-rw-r--r--Master/texmf-dist/tex/context/base/core-nav.tex75
-rw-r--r--Master/texmf-dist/tex/context/base/core-new.tex277
-rw-r--r--Master/texmf-dist/tex/context/base/core-not.tex230
-rw-r--r--Master/texmf-dist/tex/context/base/core-ntb.tex797
-rw-r--r--Master/texmf-dist/tex/context/base/core-num.tex28
-rw-r--r--Master/texmf-dist/tex/context/base/core-obj.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/core-pgr.tex1675
-rw-r--r--Master/texmf-dist/tex/context/base/core-pos.tex1923
-rw-r--r--Master/texmf-dist/tex/context/base/core-ref.tex137
-rw-r--r--Master/texmf-dist/tex/context/base/core-reg.tex458
-rw-r--r--Master/texmf-dist/tex/context/base/core-rul.tex498
-rw-r--r--Master/texmf-dist/tex/context/base/core-sec.tex582
-rw-r--r--Master/texmf-dist/tex/context/base/core-snc.tex27
-rw-r--r--Master/texmf-dist/tex/context/base/core-spa.tex558
-rw-r--r--Master/texmf-dist/tex/context/base/core-syn.tex110
-rw-r--r--Master/texmf-dist/tex/context/base/core-sys.tex85
-rw-r--r--Master/texmf-dist/tex/context/base/core-tab.tex390
-rw-r--r--Master/texmf-dist/tex/context/base/core-tbl.tex178
-rw-r--r--Master/texmf-dist/tex/context/base/core-tsp.tex463
-rw-r--r--Master/texmf-dist/tex/context/base/core-uti.tex25
-rw-r--r--Master/texmf-dist/tex/context/base/core-var.tex258
-rw-r--r--Master/texmf-dist/tex/context/base/core-ver.tex471
-rw-r--r--Master/texmf-dist/tex/context/base/enco-032.tex82
-rw-r--r--Master/texmf-dist/tex/context/base/enco-037.tex276
-rw-r--r--Master/texmf-dist/tex/context/base/enco-agr.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/enco-cas.tex12
-rw-r--r--Master/texmf-dist/tex/context/base/enco-chi.tex124
-rw-r--r--Master/texmf-dist/tex/context/base/enco-def.tex108
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ec.tex418
-rw-r--r--Master/texmf-dist/tex/context/base/enco-fde.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ffr.tex7
-rw-r--r--Master/texmf-dist/tex/context/base/enco-fpl.tex82
-rw-r--r--Master/texmf-dist/tex/context/base/enco-fro.tex10
-rw-r--r--Master/texmf-dist/tex/context/base/enco-ini.tex199
-rw-r--r--Master/texmf-dist/tex/context/base/enco-mis.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/enco-pfr.tex45
-rw-r--r--Master/texmf-dist/tex/context/base/enco-pol.tex48
-rw-r--r--Master/texmf-dist/tex/context/base/enco-run.tex11
-rw-r--r--Master/texmf-dist/tex/context/base/filt-ini.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/font-chi.tex231
-rw-r--r--Master/texmf-dist/tex/context/base/font-ini.tex261
-rw-r--r--Master/texmf-dist/tex/context/base/font-jap.tex83
-rw-r--r--Master/texmf-dist/tex/context/base/font-run.tex25
-rw-r--r--Master/texmf-dist/tex/context/base/font-uni.tex224
-rw-r--r--Master/texmf-dist/tex/context/base/hand-def.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/hand-ini.tex35
-rw-r--r--Master/texmf-dist/tex/context/base/java-ini.tex10
-rw-r--r--Master/texmf-dist/tex/context/base/lang-all.xml14
-rw-r--r--Master/texmf-dist/tex/context/base/lang-chi.tex133
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ctx.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ger.tex158
-rw-r--r--Master/texmf-dist/tex/context/base/lang-grk.tex7
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ini.tex128
-rw-r--r--Master/texmf-dist/tex/context/base/lang-ita.tex21
-rw-r--r--Master/texmf-dist/tex/context/base/lang-jap.tex235
-rw-r--r--Master/texmf-dist/tex/context/base/lang-run.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/lang-sla.tex133
-rw-r--r--Master/texmf-dist/tex/context/base/lang-spe.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/m-cweb.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/m-database.tex407
-rw-r--r--Master/texmf-dist/tex/context/base/m-dratex.tex21
-rw-r--r--Master/texmf-dist/tex/context/base/m-gamma.tex38
-rw-r--r--Master/texmf-dist/tex/context/base/m-gnuplot.tex168
-rw-r--r--Master/texmf-dist/tex/context/base/m-graph.tex156
-rw-r--r--Master/texmf-dist/tex/context/base/m-newmat.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/m-plus.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/m-pstric.tex78
-rw-r--r--Master/texmf-dist/tex/context/base/m-r.tex216
-rw-r--r--Master/texmf-dist/tex/context/base/m-steps.tex171
-rw-r--r--Master/texmf-dist/tex/context/base/m-streams.tex439
-rw-r--r--Master/texmf-dist/tex/context/base/m-subsub.tex20
-rw-r--r--Master/texmf-dist/tex/context/base/m-tryout.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/m-units.tex33
-rw-r--r--Master/texmf-dist/tex/context/base/m-visual.tex21
-rw-r--r--Master/texmf-dist/tex/context/base/math-cow.tex30
-rw-r--r--Master/texmf-dist/tex/context/base/math-eul.tex106
-rw-r--r--Master/texmf-dist/tex/context/base/math-ext.tex229
-rw-r--r--Master/texmf-dist/tex/context/base/math-ini.tex135
-rw-r--r--Master/texmf-dist/tex/context/base/math-mis.tex49
-rw-r--r--Master/texmf-dist/tex/context/base/math-pln.tex86
-rw-r--r--Master/texmf-dist/tex/context/base/math-tex.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/math-uni.tex171
-rw-r--r--Master/texmf-dist/tex/context/base/meta-dum.tex12
-rw-r--r--Master/texmf-dist/tex/context/base/meta-fig.tex17
-rw-r--r--Master/texmf-dist/tex/context/base/meta-ini.tex261
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pag.tex45
-rw-r--r--Master/texmf-dist/tex/context/base/meta-pdf.tex3373
-rw-r--r--Master/texmf-dist/tex/context/base/meta-tex.tex206
-rw-r--r--Master/texmf-dist/tex/context/base/meta-txt.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/mult-com.tex1139
-rw-r--r--Master/texmf-dist/tex/context/base/mult-con.tex1354
-rw-r--r--Master/texmf-dist/tex/context/base/mult-ini.tex27
-rw-r--r--Master/texmf-dist/tex/context/base/mult-sys.tex78
-rw-r--r--Master/texmf-dist/tex/context/base/page-app.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/page-bck.tex30
-rw-r--r--Master/texmf-dist/tex/context/base/page-flt.tex767
-rw-r--r--Master/texmf-dist/tex/context/base/page-imp.tex55
-rw-r--r--Master/texmf-dist/tex/context/base/page-ini.tex123
-rw-r--r--Master/texmf-dist/tex/context/base/page-lay.tex73
-rw-r--r--Master/texmf-dist/tex/context/base/page-lin.tex41
-rw-r--r--Master/texmf-dist/tex/context/base/page-log.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/page-lyr.tex30
-rw-r--r--Master/texmf-dist/tex/context/base/page-mak.tex16
-rw-r--r--Master/texmf-dist/tex/context/base/page-mar.tex10
-rw-r--r--Master/texmf-dist/tex/context/base/page-mul.tex182
-rw-r--r--Master/texmf-dist/tex/context/base/page-num.tex38
-rw-r--r--Master/texmf-dist/tex/context/base/page-one.tex138
-rw-r--r--Master/texmf-dist/tex/context/base/page-plg.tex209
-rw-r--r--Master/texmf-dist/tex/context/base/page-run.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/page-set.tex138
-rw-r--r--Master/texmf-dist/tex/context/base/page-sid.tex20
-rw-r--r--Master/texmf-dist/tex/context/base/page-spr.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/page-str.tex366
-rw-r--r--Master/texmf-dist/tex/context/base/page-txt.tex131
-rw-r--r--Master/texmf-dist/tex/context/base/prop-lay.tex12
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1250.tex153
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1251.tex152
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1252.tex156
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1253.tex153
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1254.tex153
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cp1257.tex153
-rw-r--r--Master/texmf-dist/tex/context/base/regi-cyr.tex137
-rw-r--r--Master/texmf-dist/tex/context/base/regi-ini.tex12
-rw-r--r--Master/texmf-dist/tex/context/base/regi-iso-8859-1.tex157
-rw-r--r--Master/texmf-dist/tex/context/base/regi-iso-8859-15.tex157
-rw-r--r--Master/texmf-dist/tex/context/base/regi-iso-8859-2.tex155
-rw-r--r--Master/texmf-dist/tex/context/base/regi-iso-8859-7.tex155
-rw-r--r--Master/texmf-dist/tex/context/base/regi-syn.tex62
-rw-r--r--Master/texmf-dist/tex/context/base/regi-uni.tex13
-rw-r--r--Master/texmf-dist/tex/context/base/regi-utf.tex18
-rw-r--r--Master/texmf-dist/tex/context/base/regi-vis.tex296
-rw-r--r--Master/texmf-dist/tex/context/base/rlxtools.rlx92
-rw-r--r--Master/texmf-dist/tex/context/base/s-abr-01.tex7
-rw-r--r--Master/texmf-dist/tex/context/base/s-chi-00.tex37
-rw-r--r--Master/texmf-dist/tex/context/base/s-jap-00.tex23
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-01.tex92
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-02.tex108
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-03.tex40
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-04.tex152
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-05.tex80
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-06.tex42
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-07.tex28
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-13.tex138
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-14.tex68
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-30.tex258
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-50.tex28
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-60.tex31
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-61.tex10
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-62.tex210
-rw-r--r--Master/texmf-dist/tex/context/base/s-pre-63.tex73
-rw-r--r--Master/texmf-dist/tex/context/base/s-syn-01.tex54
-rw-r--r--Master/texmf-dist/tex/context/base/sort-def.tex3
-rw-r--r--Master/texmf-dist/tex/context/base/sort-ini.tex66
-rw-r--r--Master/texmf-dist/tex/context/base/sort-lan.tex103
-rw-r--r--Master/texmf-dist/tex/context/base/spec-def.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/spec-dpx.tex123
-rw-r--r--Master/texmf-dist/tex/context/base/spec-dvi.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/spec-fdf.tex41
-rw-r--r--Master/texmf-dist/tex/context/base/spec-ini.tex41
-rw-r--r--Master/texmf-dist/tex/context/base/spec-mis.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/spec-tpd.tex219
-rw-r--r--Master/texmf-dist/tex/context/base/spec-xtx.tex112
-rw-r--r--Master/texmf-dist/tex/context/base/supp-ali.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/supp-box.tex37
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fil.tex14
-rw-r--r--Master/texmf-dist/tex/context/base/supp-fun.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/supp-lan.tex126
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mat.tex28
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mis.tex51
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mpe.tex11
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mps.tex342
-rw-r--r--Master/texmf-dist/tex/context/base/supp-mrk.tex6
-rw-r--r--Master/texmf-dist/tex/context/base/supp-pdf.tex660
-rw-r--r--Master/texmf-dist/tex/context/base/supp-ran.tex27
-rw-r--r--Master/texmf-dist/tex/context/base/supp-vis.tex18
-rw-r--r--Master/texmf-dist/tex/context/base/symb-cow.tex113
-rw-r--r--Master/texmf-dist/tex/context/base/symb-glm.tex1
-rw-r--r--Master/texmf-dist/tex/context/base/symb-ini.tex31
-rw-r--r--Master/texmf-dist/tex/context/base/symb-was.tex205
-rw-r--r--Master/texmf-dist/tex/context/base/syst-con.tex51
-rw-r--r--Master/texmf-dist/tex/context/base/syst-etx.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/syst-ext.tex211
-rw-r--r--Master/texmf-dist/tex/context/base/syst-gen.tex306
-rw-r--r--Master/texmf-dist/tex/context/base/syst-new.tex59
-rw-r--r--Master/texmf-dist/tex/context/base/syst-pln.tex26
-rw-r--r--Master/texmf-dist/tex/context/base/syst-xtx.tex13
-rw-r--r--Master/texmf-dist/tex/context/base/type-akb.tex45
-rw-r--r--Master/texmf-dist/tex/context/base/type-buy.tex9
-rw-r--r--Master/texmf-dist/tex/context/base/type-cow.tex83
-rw-r--r--Master/texmf-dist/tex/context/base/type-dis.tex55
-rw-r--r--Master/texmf-dist/tex/context/base/type-enc.tex162
-rw-r--r--Master/texmf-dist/tex/context/base/type-exa.tex71
-rw-r--r--Master/texmf-dist/tex/context/base/type-ghz.tex288
-rw-r--r--Master/texmf-dist/tex/context/base/type-gyr.tex36
-rw-r--r--Master/texmf-dist/tex/context/base/type-ini.tex64
-rw-r--r--Master/texmf-dist/tex/context/base/type-map.tex65
-rw-r--r--Master/texmf-dist/tex/context/base/type-pre.tex1
-rw-r--r--Master/texmf-dist/tex/context/base/type-syn.tex147
-rw-r--r--Master/texmf-dist/tex/context/base/unic-002.tex95
-rw-r--r--Master/texmf-dist/tex/context/base/unic-032.tex380
-rw-r--r--Master/texmf-dist/tex/context/base/unic-033.tex374
-rw-r--r--Master/texmf-dist/tex/context/base/unic-037.tex278
-rw-r--r--Master/texmf-dist/tex/context/base/unic-251.tex34
-rw-r--r--Master/texmf-dist/tex/context/base/unic-cjk.tex16
-rw-r--r--Master/texmf-dist/tex/context/base/unic-exp.tex44
-rw-r--r--Master/texmf-dist/tex/context/base/unic-ini.tex99
-rw-r--r--Master/texmf-dist/tex/context/base/unic-run.tex29
-rw-r--r--Master/texmf-dist/tex/context/base/verb-c.tex484
-rw-r--r--Master/texmf-dist/tex/context/base/verb-ini.tex117
-rw-r--r--Master/texmf-dist/tex/context/base/x-chemml.xsd93
-rw-r--r--Master/texmf-dist/tex/context/base/x-contml.tex13
-rw-r--r--Master/texmf-dist/tex/context/base/x-contml.xsd375
-rw-r--r--Master/texmf-dist/tex/context/base/x-corres.rng170
-rw-r--r--Master/texmf-dist/tex/context/base/x-fe.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/x-fig-00.dtd24
-rw-r--r--Master/texmf-dist/tex/context/base/x-fig-00.xsd77
-rw-r--r--Master/texmf-dist/tex/context/base/x-fig-01.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/x-mathml.xsd11
-rw-r--r--Master/texmf-dist/tex/context/base/x-newcml.tex454
-rw-r--r--Master/texmf-dist/tex/context/base/x-newmme.tex429
-rw-r--r--Master/texmf-dist/tex/context/base/x-newmml.tex2496
-rw-r--r--Master/texmf-dist/tex/context/base/x-newmmo.tex126
-rw-r--r--Master/texmf-dist/tex/context/base/x-newpml.tex250
-rw-r--r--Master/texmf-dist/tex/context/base/x-om2cml.xsl1258
-rw-r--r--Master/texmf-dist/tex/context/base/x-openmath.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/x-openmath.xsl35
-rw-r--r--Master/texmf-dist/tex/context/base/x-physml.xsd172
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-00.tex37
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-01.tex65
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-04.tex46
-rw-r--r--Master/texmf-dist/tex/context/base/x-res-08.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/x-set-11.tex101
-rw-r--r--Master/texmf-dist/tex/context/base/x-set-12.tex106
-rw-r--r--Master/texmf-dist/tex/context/base/x-sm2om.xsl229
-rw-r--r--Master/texmf-dist/tex/context/base/x-xml-11.tex44
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-cml.tex37
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-ent.tex1
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-ext.tex79
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-ini.tex50
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-map.tex2
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-mmc.tex8
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-mml.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-mmp.tex31
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-pml.tex41
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-pmu.tex68
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-pre.tex20
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-run.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-stk.tex235
-rw-r--r--Master/texmf-dist/tex/context/base/xtag-xsl.tex2
277 files changed, 35909 insertions, 9862 deletions
diff --git a/Master/texmf-dist/tex/context/base/colo-ini.tex b/Master/texmf-dist/tex/context/base/colo-ini.tex
index 285c0148643..bb0b8c6e84b 100644
--- a/Master/texmf-dist/tex/context/base/colo-ini.tex
+++ b/Master/texmf-dist/tex/context/base/colo-ini.tex
@@ -72,7 +72,7 @@
title: kleur
1: systeem -- is globaal actief
2: systeem -- is lokaal actief
- 3: -- is niet gedefinieerd
+ 3: -- is niet gedefinieerd --
4: systeem -- wordt geladen
5: onbekend systeem --
6: palet -- is beschikbaar
@@ -88,7 +88,7 @@
title: color
1: system -- is global activated
2: system -- is local activated
- 3: -- is not defined
+ 3: -- is not defined --
4: system -- is loaded
5: unknown system --
6: palette -- is available
@@ -104,7 +104,7 @@
title: farbe
1: system -- ist global aktiviert
2: system -- ist lokal aktiviert
- 3: -- ist undefiniert
+ 3: -- ist undefiniert --
4: system -- ist geladen
5: unbekanntes System --
6: palette -- ist verfuegbar
@@ -120,7 +120,7 @@
title: barva
1: system -- je globalne aktivovana
2: system -- je lokalne activovana
- 3: -- neni definovana
+ 3: -- neni definovana --
4: system -- je nacten
5: neznamy system --
6: palette -- je k dispozici
@@ -136,7 +136,7 @@
title: colore
1: sistema -- attivato globalmente
2: sistema -- attivato localmente
- 3: -- non definito
+ 3: -- non definito --
4: sistema -- caricato
5: sistema -- sconosciuto
6: tavolozza -- resa disponibile
@@ -144,7 +144,7 @@
8: specifica -- del colore -- convertita in nero
9: spazio dei colori -- non supportato
10: spazio dei colori -- supportato
- 11: il colore convertito in grigio
+ 11: il colore ø convertito in grigio
12: -- is registered
\stopmessages
@@ -152,15 +152,15 @@
title: farge
1: system -- er aktivert globalt
2: system -- er aktivert lokalt
- 3: -- er udefinert
+ 3: -- er udefinert --
4: system -- er lest inn
5: ukjent system --
6: palett -- er tilgjengelig
7: palett -- er ikke tilgjengelig
8: spesifikasjon -- for farge -- gir kun svart
- 9: -- fargerom er ikke stttet
- 10: -- fargerom er stttet
- 11: fargen vil bli vist som gr
+ 9: -- fargerom er ikke støttet
+ 10: -- fargerom er støttet
+ 11: fargen vil bli vist som grø
12: -- is registered
\stopmessages
@@ -168,7 +168,7 @@
title: culori
1: sistem -- este activata global
2: sistem -- este activata local
- 3: -- nu este definita
+ 3: -- nu este definita --
4: sistem -- este incarcata
5: sistem -- necunoscuta
6: paleta -- este disponibila
@@ -180,6 +180,22 @@
12: -- is registered
\stopmessages
+\startmessages french library: colors
+ title: couleurs
+ 1: le système -- est globalement activé
+ 2: le système -- est localement activé
+ 3: -- n'est pas défini --
+ 4: le système -- est chargé
+ 5: système -- inconnu
+ 6: la palette -- est disponible
+ 7: le palette -- n'est pas disponible
+ 8: la spécification -- de la couleur -- devient noire
+ 9: l'espace de couleur -- n'est pas supporté
+ 10: -- l'espace de couleur est supporté
+ 11: la couleur est convertie en niveau de gris
+ 12: -- est enregistré
+\stopmessages
+
%D We use a couple of local registers. That way we don't have
%D to group when converting colors. By the way, this is not
%D really faster. We can sqeeze half a second runtime for 50K
@@ -310,31 +326,6 @@
\def\dodefineglobalcolor{\dododefinecolor\doglobal\setgvalue\setxvalue1}
\def\dodefinenamedcolor {\dododefinecolor\doglobal\setvalue \setevalue0}
-% keep this for readability
-%
-% \def\dodefinecolor[#1][#2]%
-% {\addtocommalist{#1}\colorlist
-% \doifassignmentelse{#2}
-% {\@@resetcolorparameters
-% \getparameters[\??cl @@][#2]%
-% \doifelse{\@@cl@@r\@@cl@@g\@@cl@@b}{\@@cl@@z\@@cl@@z\@@cl@@z}
-% {\doifelse{\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k}{\@@cl@@z\@@cl@@z\@@cl@@z\@@cl@@z}
-% {\doifelse\@@cl@@s\@@cl@@z
-% {\showmessage\m!colors8{{[#2]},#1}%
-% \setevalue{\??cr#1}{\colorZpattern}}
-% {\setevalue{\??cr#1}{\colorSpattern}}}
-% {\setevalue{\??cr#1}{\colorCpattern}}}
-% {\setevalue{\??cr#1}{\colorRpattern}}}
-% {\doifdefinedelse{\??cr#2}
-% {\doifelse{#1}{#2}
-% {% this way we can freeze \definecolor[somecolor][somecolor]
-% % and still prevent cyclic definitions
-% \iffreezecolors\setevalue{\??cr#1}{\getvalue{\??cr#2}}\fi}
-% {\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi
-% {\??cr#1}{\getvalue{\??cr#2}}}}
-% {\showmessage\m!colors3{#1}}}%
-% \unexpanded\setvalue{#1}{\color[#1]}} % \unexpanded toegevoegd
-
\def\dododefinecolor#1#2#3#4[#5][#6]% #2==set(g)value #3==set[e|x]value
{#1\addtocommalist{#5}\colorlist % optional
\doifassignmentelse{#6}
@@ -356,18 +347,30 @@
\ifx\@@cl@@e\empty \else
\doregisterspotcolorname{#5}\@@cl@@e
\fi}
- {\doifdefinedelse{\??cr#6}
- {\doifelse{#5}{#6}
- {% this way we can freeze \definecolor[somecolor][somecolor]
- % and still prevent cyclic definitions
- \iffreezecolors#3{\??cr#5}{\getvalue{\??cr#6}}\fi}
- {\iffreezecolors\@EA#3\else\@EA#2\fi
- {\??cr#5}{\getvalue{\??cr#6}}}}
- {\showmessage\m!colors3{#5}}}%
+ {\doifelsenothing\currentpalet
+ \donefalse
+ {\doifdefinedelse{\??cr\currentpalet#6}\donetrue\donefalse}%
+ \ifdone
+ \doifnot{#5}{#6}
+ {#2{\??cr#5}{\paletcolorspec{#6}}}%
+ \else
+ \doifdefinedelse{\??cr#6}
+ {\doifelse{#5}{#6}
+ {% this way we can freeze \definecolor[somecolor][somecolor]
+ % and still prevent cyclic definitions
+ \iffreezecolors#3{\??cr#5}{\csname\??cr#6\endcsname}\fi}
+ {\iffreezecolors\@EA#3\else\@EA#2\fi
+ {\??cr#5}{\csname\??cr#6\endcsname}}}
+ {\showmessage\m!colors3{#5 (def)}}%
+ \fi}%
\ifcase#4\or
\unexpanded#2{#5}{\switchtocolor[#5]}% \unexpanded toegevoegd
\fi}
+\def\paletcolorspec#1%
+% {\executeifdefined{\??cr\currentpalet#1}{\executeifdefined{\??cr#1}\empty}}
+ {\csname\??cr\currentpalet#1\endcsname}
+
%D Hex color support is not enabled by default. You need to say \setupcolor
%D [hex] to get this working.
@@ -388,6 +391,9 @@
\edef\@@cl@@n{#2}%
\getparameters[\??cl @@][#3]%
\doifnothing\@@cl@@p{\let\@@cl@@p\!!plusone}%
+ \ifx\@@cl@@e\empty \else
+ \doregisterspotcolorname{#2}\@@cl@@e
+ \fi
\doglobal\addtocommalist{#2}\allspotcolors
\setxvalue{\??cr#1}{\colorPpattern}% was \setevalue
\setgvalue{#1}{\switchtocolor[#1]}}} % was \setvalue
@@ -473,14 +479,15 @@
\processcommalist[#1]\docommand}}
\def\checkmultitonecolor#1%
- {\getvalue{\??cl#1\s!check}\letgvalue{\??cl#1\s!check}\relax}
+ {\csname\??cl#1\s!check\endcsname\letgvalue{\??cl#1\s!check}\relax}
-\def\dodefinespotcolor[#1][#2][#3]% todo: always global
+\def\dodefinespotcolor[#1][#2][#3]% todo: always global (REDEFINED)
{\doifnot{#1}{#2}
{\@@resetcolorparameters
\edef\@@cl@@n{#2}%
\getparameters[\??cl @@][#3]%
- \doifnothing\@@cl@@p{\let\@@cl@@p\!!plusone}%
+ \doifnothing \@@cl@@p{\let\@@cl@@p\!!plusone}%
+ \doifsomething\@@cl@@e{\doregisterspotcolorname{#2}\@@cl@@e}%
\doglobal\addtocommalist{#2}\allspotcolors
\setxvalue{\??cr#1}{\colorPpattern}% was \setevalue
\setgvalue{#1}{\switchtocolor[#1]}}}% was \setvalue
@@ -587,10 +594,12 @@
\processcommalist[#1]\dodosetupcolor}}
\def\dodosetupcolor#1%
- {\makeshortfilename[\f!colorprefix\truefilename{#1}]%
- \readsysfile\shortfilename
- {\showmessage\m!colors4\colorstyle}
- {\showmessage\m!colors5\colorstyle}}
+ {\makeshortfilename[\truefilename{\f!colorprefix#1}]%
+ \startreadingfile
+ \readsysfile\shortfilename
+ {\showmessage\m!colors4\colorstyle}
+ {\showmessage\m!colors5\colorstyle}%
+ \stopreadingfile}
\let\usecolors\setupcolor
@@ -1351,19 +1360,22 @@
\ifx\initializemaintextcolor\undefined
-% \def\initializemaintextcolor
-% {\doifsomething\@@cltekstkleur
-% {\appendtoks\starttextcolor[\@@cltekstkleur]\to\everystarttext
-% \appendtoks\stoptextcolor \to\everystoptext
-% \let\initializemaintextcolor\relax}}
-
- % global ?
+ \let\@@clprevcolor\empty
\def\initializemaintextcolor
- {\doifelsenothing\@@cltextcolor
+ {% saveguard for setting text color to empty after
+ % it has been set
+ \doifnothing\@@cltextcolor
+ {\ifx\@@clprevcolor\empty\else
+ \let\@@cltextcolor\defaulttextcolor
+ \fi}%
+ \doifelsenothing\@@cltextcolor
{\let\maintextcolor\empty}
- {\let\maintextcolor\@@themaintextcolor
- \definecolor[\@@themaintextcolor][\@@cltextcolor]%
+ {\edef\@@clprevcolor{\@@cltextcolor}%
+ \let\maintextcolor\@@themaintextcolor
+ \doifelsenothing\@@cltextcolor % another saveguard
+ {\definecolor[\@@themaintextcolor][\defaulttextcolor]}%
+ {\definecolor[\@@themaintextcolor][\@@cltextcolor]}%
\doinitializemaintextcolor}}
\def\doinitializemaintextcolor
@@ -1708,14 +1720,14 @@
%D
%D \showsetup{startcolor}
-\def\startcolor
+\unexpanded\def\startcolor
{\ifincolor
\expandafter\doglobalstartcolor
\else
\expandafter\noglobalstartcolor
\fi}
-\def\stopcolor
+\unexpanded\def\stopcolor
{\ifincolor
\doglobalstopcolor
\else
@@ -1766,7 +1778,7 @@
\global\@EA\let\csname\@@currentcolorstop\endcsname\dodoglobalstopcolor
\startcolormode\@@askedcolor}
{\global\@EA\let\csname\@@currentcolorstop\endcsname\donoglobalstopcolor
- \showmessage\m!colors3\@@askedcolor}%
+ \showmessage\m!colors3\@@askedcolor\empty}%
\fi\fi}
\def\doglobalstartcolor[#1]%
@@ -2111,7 +2123,7 @@
{\dodoformatcolor{#1}}
\def\doformatcolor#1:%
- {\getvalue{doformatcolor#1}}
+ {\csname doformatcolor#1\endcsname}
\def\colorvalue
{\dowithcolor\doformatcolor}
@@ -2134,7 +2146,7 @@
{\dowithcolor\doformatcolor{#1}}
\def\doformatgray#1:%
- {\getvalue{doformatgray#1}}
+ {\csname doformatgray#1\endcsname}
\def\grayvalue
{\dowithcolor\doformatgray}
@@ -2237,24 +2249,38 @@
\setevalue{\??pa\??pa#1}{#2}%
\def\dodododefinepalet[##1=##2]%
{\doifvaluesomething{\??pa#1}
- {\setevalue{\??pa#1}{\getvalue{\??pa#1},}}%
- \setevalue{\??pa#1}{\getvalue{\??pa#1}##1}%
- \doifdefinedelse{\??cr##2}
- {\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi
- {\??cr#1:##1}{\getvalue{\??cr##2}}}
- {\letvalue{\??cr#1:##1}\colorXpattern}}%
+ {\setevalue{\??pa#1}{\csname\??pa#1\endcsname,}}%
+ \setevalue{\??pa#1}{\csname\??pa\endcsname##1}%
+ \doifassignmentelse{##2}
+ {% == \definepalet[test][xx={y=.4}]
+ \definecolor[\??pa#1:##1][##2]%
+ \iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi
+ {\??cr#1:##1}{\csname\??cr\??pa#1:##1\endcsname}}
+ {% == \definepalet[test][xx=green]
+ \doifdefinedelse{\??cr##2}
+ {\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi
+ {\??cr#1:##1}{\csname\??cr##2\endcsname}}
+ {\letvalue{\??cr#1:##1}\colorXpattern}}}%
\def\dododefinepalet##1%
{\dodododefinepalet[##1]}%
\processcommalist[#2]\dododefinepalet}
{\doifdefined{\??pa#2}
- {\expanded{\dodefinepalet[#1][\getvalue{\??pa\??pa#2}]}}}}
+ {\expanded{\dodefinepalet[#1][\csname\??pa\??pa#2\endcsname]}}}}
\let\paletsize\!!zerocount
\def\getpaletsize[#1]%
- {\getcommacommandsize[\getvalue{\??pa\??pa#1}]%
+ {\getcommacommandsize[\csname\??pa\??pa#1\endcsname]%
\edef\paletsize{\number\commalistsize}}
+%D Instead of refering to colors, one can also directly specify
+%D a color:
+%D
+%D \starttyping
+%D \definepalet[test][xx=green]
+%D \definepalet[test][xx={y=.4}]
+%D \stoptyping
+
%D \macros
%D {setuppalet}
%D
@@ -2331,7 +2357,7 @@
[#2]
[ \v!cmyk=>\edef\currentcolorspace{C},
\v!rgb=>\edef\currentcolorspace{R},
- \v!gray=>\edef\currentcolorspace{S},
+ \v!gray=>\edef\currentcolorspace{S},
\v!spot=>\edef\currentcolorspace{P},
\v!s=>\edef\currentcolorspace{S},
\s!unknown=>\edef\currentcolorspace{R}]%
@@ -2346,7 +2372,7 @@
{\doloop
{\doifdefinedelse{\??cr#2:\recurselevel}
{\setevalue{\??cr#1:\recurselevel}%
- {\getvalue{\??cr#2:\recurselevel}}}
+ {\csname\??cr#2:\recurselevel\endcsname}}
{\exitloop}}}%
\fi}
diff --git a/Master/texmf-dist/tex/context/base/cont-fil.tex b/Master/texmf-dist/tex/context/base/cont-fil.tex
index b6d3fba6571..6988f57f008 100644
--- a/Master/texmf-dist/tex/context/base/cont-fil.tex
+++ b/Master/texmf-dist/tex/context/base/cont-fil.tex
@@ -14,11 +14,14 @@
\writestatus{loading}{Context File Synonyms}
\definefilesynonym [chemie] [chemic]
+\definefilesynonym [chemics] [chemic]
\definefilesynonym [unit] [units]
\definefilesynonym [eenheid] [units]
\definefilesynonym [einheit] [units]
+\definefilesynonym [pstricks] [pstric]
+
\definefilesynonym [finance] [financ]
\definefilesynonym [con-01] [contml] % will go away
@@ -93,9 +96,14 @@
\definefilesynonym [abr-smallcaps] [abr-02]
\definefilesynonym [chinese] [chi-00]
+\definefilesynonym [japanese] [jap-00]
+
%definefilesynonym [chi-simplified] [chi-01]
%definefilesynonym [chi-traditional] [chi-02]
\definefilesynonym [greek] [grk-00]
+\definefilesynonym [unic-chi] [unic-cjk]
+\definefilesynonym [unic-jap] [unic-cjk]
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-fr.tex b/Master/texmf-dist/tex/context/base/cont-fr.tex
new file mode 100644
index 00000000000..338d6c6d4ed
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/cont-fr.tex
@@ -0,0 +1,38 @@
+%D \module
+%D [ file=cont-de,
+%D version=1997.08.19,
+%D title=\CONTEXT,
+%D subtitle=\CONTEXT\ German Format Generation,
+%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.
+
+\catcode`\{=1 \catcode`\}=2 \def\defaultinterface{french}
+
+\input context.tex
+
+\unprotect
+
+\setupcurrentlanguage[\s!fr]
+
+\loaduserspecifications
+
+\installlanguage [\s!en] [\c!state=\v!start]
+\installlanguage [\s!uk] [\c!state=\v!start]
+\installlanguage [\s!de] [\c!state=\v!start]
+\installlanguage [\s!fr] [\c!state=\v!start]
+\installlanguage [\s!es] [\c!state=\v!start]
+\installlanguage [\s!nl] [\c!state=\v!start]
+\installlanguage [\s!it] [\c!state=\v!start]
+
+% \setupbodyfont [cmr,ams,rm,12pt]
+%
+% \setupencoding[default=ec] \usetypescript[modern][\defaultencoding] \setupbodyfont[modern,rm,12pt]
+
+\setupencoding[default=ec] \usetypescript[fallback][\defaultencoding] \setupbodyfont[rm,12pt]
+
+\protect \errorstopmode \dump \endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-log.tex b/Master/texmf-dist/tex/context/base/cont-log.tex
index aa1e1ce72ad..dae135a1c1f 100644
--- a/Master/texmf-dist/tex/context/base/cont-log.tex
+++ b/Master/texmf-dist/tex/context/base/cont-log.tex
@@ -89,7 +89,7 @@
\kern-.11em\TeX}
\def\AMSswitch#1%
- {$\fam2\ifdim\korpsgrootte>1.1em\scriptstyle\fi#1$}
+ {$\fam2\ifdim\bodyfontsize>1.1em\scriptstyle\fi#1$}
\def\AmSTeX
{\AMSswitch A%
diff --git a/Master/texmf-dist/tex/context/base/cont-new.tex b/Master/texmf-dist/tex/context/base/cont-new.tex
index 87d53cb68dc..0cdb791700c 100644
--- a/Master/texmf-dist/tex/context/base/cont-new.tex
+++ b/Master/texmf-dist/tex/context/base/cont-new.tex
@@ -11,6 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\newcontextversion{2006.08.08 21:51}
+
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
%D features.
@@ -22,8 +24,233 @@
\unprotect
+% \setuplabeltext[\s!itemcount1={{I(},{)}}]
+% \def\labeledcountervalue#1{\labeltexts{#1}{\countervalue{#1}}}
+
\writestatus{\m!systems}{beware: some patches loaded from cont-new.tex}
+% we need to overhaul the page modules anyway
+
+\def\settext
+ {\doquintupleempty\dosettext}
+
+\def\dosettext[#1][#2][#3][#4][#5]% header text middle text/text
+ {\iffifthargument
+ \setvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}%
+ {\dodoubletexts{\??tk#1}{#2}%
+ {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}%
+ {\c!rightstyle\c!rightcolor\c!rightwidth}{#5}}%
+ \else\iffourthargument
+ \setvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}%
+ {\dodoubletexts{\??tk#1}{#2}%
+ {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}%
+ {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}}%
+ \else\ifthirdargument
+ \setvalue{\??tk#1#2\c!middletext}%
+ {\dodoubletexts{\??tk#1}{#2}%
+ {\c!leftstyle \c!leftcolor \c!leftwidth }{#3}%
+ {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}}%
+ \fi\fi\fi}
+
+\def\resettext
+ {\dotripleempty\doresettext}
+
+\def\doresettext[#1][#2][#3]% header text middle
+ {\ifthirdargument
+ \letvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}\empty
+ \else\ifsecondargument
+ \letvalue{\??tk#1#2\c!lefttext }\empty
+ \letvalue{\??tk#1#2\c!middletext}\empty
+ \letvalue{\??tk#1#2\c!righttext }\empty
+ \fi\fi}
+
+\setvalue{:\c!middle:\c!text:}{\c!middletext}
+\setvalue{:\c!left :\c!text:}{\c!lefttext }
+\setvalue{:\c!right :\c!text:}{\c!righttext }
+
+% \settext[header][text][middle][xxx][yyy]
+
+%D A nice example of a plugin:
+%D
+%D \startbuffer
+%D \startitemize[a,random,packed]
+%D \startitem first \stopitem \startitem second \stopitem
+%D \startitem third \stopitem \startitem fourth \stopitem
+%D \stopitemize
+%D
+%D \startitemize[a,random,packed]
+%D \startitem first \stopitem \startitem second \stopitem
+%D \startitem third \stopitem \startitem fourth \stopitem
+%D \stopitemize
+%D
+%D \startitemize[a,packed]
+%D \startitem first \stopitem \startitem second \stopitem
+%D \startitem third \stopitem \startitem fourth \stopitem
+%D \stopitemize
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+% better collectitems als conditional and a real plugin mechanism (some day)
+
+\@EA\long\@EA\def\@EA\collectitemgroupitem\@EA#\@EA1\csname\e!stop\v!item\endcsname
+ {\increment\itemcollectcounter
+ \long\setvalue{\v!item*\itemcollectcounter}{\item#1\par}}
+
+\def\flushcollecteditems
+ {\ifconditional\randomizeitems
+ \getrandomnumber\itemcollectcounternow\plusone\itemcollectcounter
+ \else
+ \increment\itemcollectcounternow
+ \fi
+ \doifdefined{\v!item*\itemcollectcounternow}
+ {\getvalue{\v!item*\itemcollectcounternow}%
+ \letbeundefined{\v!item*\itemcollectcounternow}%
+ \increment\itemcollectcounterdone}%
+ \ifnum\itemcollectcounterdone<\itemcollectcounter\relax
+ \expandafter\flushcollecteditems
+ \fi}
+
+\def\stopcollectitems
+ {\ifconditional\randomizeitems
+ \newcounter\itemcollectcounterdone
+ \ifnum\itemcollectcounter>\zerocount
+ \@EAEAEA\flushcollecteditems
+ \fi
+ \fi}
+
+\def\startcollectitems
+ {\ifconditional\randomizeitems
+ \newcounter\itemcollectcounter
+ \letvalue{\e!start\v!item}\collectitemgroupitem
+ \fi}
+
+% This will move to core-fig asap:
+%
+% todo: process between runs
+
+\startXMLmapping[rli]
+ \defineXMLprocess[rl:identify]
+ \defineXMLsavecontent[rl:width] {\!!zeropoint}
+ \defineXMLsavecontent[rl:height]{\!!zeropoint}
+\stopXMLmapping
+
+\let\rliwidth \!!zeropoint
+\let\rliheight\!!zeropoint
+
+\def\getRLIfiguredimensions#1%
+ {\global\let\rliwidth \!!zeropoint
+ \global\let\rliheight\!!zeropoint
+ \doifelsenothing\@@efconversion
+ {\doiffileelse\@@effilenametype
+ {\doiffileelse{\@@effilenametype.rli}
+ {}
+ {% let's try runtime running first
+ \writestatus\m!figures{using rlxtools to determine size of \@@effilenametype}%
+ \executesystemcommand{texmfstart rlxtools --identify \@@effilenametype}}%
+ \doiffileelse{\@@effilenametype.rli}
+ {}
+ {% we assume that runtime running failed
+ \installprogram{texmfstart rlxtools --identify \@@effilenametype}}%
+ \startnointerference
+ \startXMLmapping[rli]%
+ \startXMLignore
+ \processXMLfile{\@@effilenametype.rli}%
+ \xdef\rliwidth {\XMLflush{rl:width}}%
+ \xdef\rliheight{\XMLflush{rl:height}}%
+ \stopXMLignore
+ \stopXMLmapping
+ \stopnointerference}
+ {}}
+ {}} % no rli when rlx conversion is in place
+
+\def\getfiguredimensionsC
+ {\ifcase\figurestatus\ifcase\figurefilemode\else
+ \doifsomething\@@efcurrentpath
+ {\doifnotinset\@@effiletype{\c!tex,\c!tmp}
+ {\doiffileelse\@@efcurrentfile
+ {\@@eftrace{using rlxtools to identify \@@effilenametype}%
+ \getRLIfiguredimensions{\@@effilenametype}%
+ \ifdim\rliwidth>\zeropoint \ifdim\rliheight>\zeropoint
+ \geteparameters % e !
+ [\??ep]
+ [\c!x=\!!zeropoint,\c!y=\!!zeropoint, % brrr, todo: bbox
+ \c!w=\rliwidth,\c!h=\rliheight]%
+ \let\@@eftype\@@efcurrenttype
+ \let\@@effullname\@@efcurrentfile
+ \chardef\figurestatus\plusfour % todo, message is wrong now
+ \fi \fi
+ \@@eftrace{\ifcase\figurestatus not \fi found}}
+ {}}}%
+ \fi\fi}
+
+\let\doanalyzefigurefilesB\relax % obsolete
+\let\doanalyzefigurefilesC\relax % obsolete
+
+\def\environment #1 % at outermost level only (load only once)
+ {\pushmacro\startenvironment
+ \pushmacro\stopenvironment
+ \def\startenvironment ##1 {}%
+ \let\stopenvironment\relax
+ \startreadingfile
+ \doexecutefileonce{#1}
+ \stopreadingfile
+ \popmacro\startenvironment
+ \popmacro\stopenvironment}
+
+\def\singlewidened #1{\hbox spread 1em{\hss#1\hss}}
+\def\complexwidened[#1]#2{\hbox spread #1{\hss#2\hss}}
+
+\definecomplexorsimple\widened
+
+% todo
+%
+% \def\definelocation{\dodoubleargument\dodefinelocation}
+% \def\dodefinelocation[#1][#2]{\setvalue{loc:#1}{#2}}
+%
+% \definelocation[lt] [\v!left\v!top]
+% \definelocation[tl] [\v!left\v!top]
+% \definelocation[\v!top\v!left][\v!left\v!top]
+%
+% \def\getlocation#1{\executeifdefined{loc:#1}{#1}}
+
+\def\convertencodedtokens{\stringifyencodedtokens}
+
+% test case:
+%
+% \enableregime[cp1250]
+% \mainlanguage[cz]
+%
+% \starttext
+%
+% \title{luouc kon p}
+% \placelist[chapter][criterium=all]
+%
+% \startbuffer
+% <chapter>
+% <title>luouc kon p</title>
+% </chapter>
+% \stopbuffer
+%
+% \defineXMLenvironment
+% [chapter]
+% {\defineXMLsave[title]}
+% {\expanded{\chapter{\XMLflush{title}}}}
+% \processXMLbuffer
+%
+% \setuphead[chapter][expansion=yes]
+% \defineXMLenvironment
+% [chapter]
+% {\defineXMLsave[title]}
+% {\chapter{\XMLflush{title}}}
+% \processXMLbuffer
+%
+% \stoptext
+
+% just in case we load something from a file (pdfr-ec for instance)
+
+\prependtoks \restoreendofline \to \everybeforeshipout
+
% \tracefilestrue
%
% \unexpanded\def\readfile#1#2#3%
@@ -63,9 +290,11 @@
\def\docheckprepfile
{\ifcase\preprocessmethod
+ \iftracefiles\writestatus\m!systems{preprocessing - not needed}\fi
% no preprocessing
\or
% only check for existence
+ \iftracefiles\writestatus\m!systems{preprocessing - check exitence of \readfilename\preprocesssuffix}\fi
\doiffileexistselse{\readfilename\preprocesssuffix}
{\chardef\preprocessstate\plusone}
\donothing
@@ -75,14 +304,21 @@
\splitfilename\readfilename
\ifx\splitofftype\empty
% saveguard and speed up
+ \iftracefiles\writestatus\m!systems{preprocessing - no suffix}\fi
\egroup
\else
- \doifdefinedelse{fp..\splitoffname.\splitofftype}
+ \iftracefiles\writestatus\m!systems{preprocessing - check presence of \readfilename\preprocesssuffix}\fi
+ \doifdefinedelse{fp..\readfilename}
{\egroup
\doiffileexistselse{\readfilename\preprocesssuffix}
{\chardef\preprocessstate\plusone}
{\chardef\preprocessstate\plustwo}}%
- {\egroup}%
+ {\doifdefinedelse{fp..\splitoffname.\splitofftype}
+ {\egroup
+ \doiffileexistselse{\readfilename\preprocesssuffix}
+ {\chardef\preprocessstate\plusone}
+ {\chardef\preprocessstate\plustwo}}%
+ {\egroup}}%
\fi
\fi}
@@ -176,9 +412,6 @@
\relax
\the\everyafterreadfile}
-\def\headparameter#1% to do: everywhere in core-sec
- {\csname\??ko\currenthead#1\endcsname}
-
% The following may be a solution for the fact that one cannot
% change catcodes of characters like : and ; inside an environment.
@@ -588,7 +821,7 @@
%D \getbuffer[c]
\long\def\rescan#1{\scantokens{#1\ignorespaces}}
-\long\def\rescanwithsetup#1#2{\bgroup\directsetup{#1}\scantokens{#2\ignorespaces}\egroup}
+\long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantokens{#2\ignorespaces}\endgroup}
% In 2005 we will abandon support for font encodings that don't have
% the ascii characters { } $ etc in their normal slot, i.e. latin modern
@@ -612,6 +845,8 @@
% \egroup
%
% more generic
+%
+% IS THIS STILL OK? TO BE CHECKED (UTF AND SUCH) ! ! ! !
\def\XMLexpanded#1%
{\bgroup
@@ -649,14 +884,73 @@
\installoutput\synchronizeoutput % maybe add pagediscards
{\ifvoid\normalpagebox\else
\unvbox\normalpagebox
- \pagediscards
+ \pagediscards % maybe not needed ?
\fi}
% temp hack, else no proper default fall back (like \textmultiply); todo: sync encoding
+\def\dealwithmathtextencoding
+ {\expanded{\everyhbox{\the\everyhbox\noexpand\fastenableencoding{\currentencoding}}}%
+ \def\dealwithmathtextencoding{\let\characterencoding\nocharacterencoding}%
+ \dealwithmathtextencoding}
\appendtoks
- \let\characterencoding\nocharacterencoding
+ \dealwithmathtextencoding
+\to \everymathematics
+
+\def\dohandlemathtoken#1%
+ {\csname
+ \ifmmode
+ \ifcsname\@mt@\mathcollection:\outerencoding#1\endcsname
+ \@mt@\mathcollection:\outerencoding
+ \else\ifcsname\@mt@\mathcollection#1\endcsname
+ \@mt@\mathcollection
+ \else\ifcsname\@mt@\nomathcollection#1\endcsname
+ \@mt@\nomathcollection
+ \else\ifcsname\characterencoding#1\endcsname
+ \characterencoding
+ \else
+ \nocharacterencoding
+ \fi\fi\fi\fi
+ \else
+ \ifcsname\characterencoding#1\endcsname
+ \characterencoding
+ \else\ifcsname\nocharacterencoding#1\endcsname
+ \nocharacterencoding
+ \else\ifcsname\@mt@\mathcollection:\outerencoding#1\endcsname
+ \@mt@\mathcollection:\outerencoding
+ \else\ifcsname\@mt@\mathcollection#1\endcsname
+ \strippedcsname\mathematics\expandafter\endcsname\csname\@mt@\mathcollection
+ \else\ifcsname\@mt@\nomathcollection#1\endcsname
+ \strippedcsname\mathematics\expandafter\endcsname\csname\@mt@\nomathcollection
+ \else
+ \nocharacterencoding
+ \fi\fi\fi\fi\fi
+ \fi
+ #1\endcsname}
+
+\let\dohandlecommand\dohandlemathtoken
+
+\let\outerencoding\empty
+
+\def\checkoutermathencoding
+ {\ifx\outerencoding\empty
+ \ifx\outerencoding\s!default\else
+ \edef\outerencoding{\currentencoding}%
+ \fi
+ \fi}
+
+\prependtoks
+ \checkoutermathencoding
\to \everymathematics
+
+% \startmathcollection[euler:texnansi]
+% \definemathsymbol [breve] [accent] [tf] ["15]
+% \stopmathcollection
+% \startmathcollection[euler:ec]
+% \definemathsymbol [breve] [accent] [tf] ["08]
+% \stopmathcollection
+%
+% $\breve e$
% \separatestring123 456\to\test [\test]
@@ -1209,8 +1503,8 @@
\prependtoks \normalenableXML \to \everyXMLinputmode
\appendtoks \processingXMLtrue \to \everyXMLinputmode
-\def\enableXML {\setinputmode[XML]}
-\def\disableXML{\setinputmode[TEX]}
+\unexpanded\def\enableXML {\setinputmode[XML]} % \enableXML is used in edef's and marks
+\unexpanded\def\disableXML{\setinputmode[TEX]}
\beginTEX
@@ -1342,7 +1636,8 @@
%\ifgridsnapping \else \baselinecorrection \fi % ! ! ! test test test ! ! ! !
\doplacefloatbox
\doinsertfloatinfo
- \dochecknextindentation\??bk}
+ \dochecknextindentation\??bk
+ \dorechecknextindentation}
% todo: switch koppelen aan par scheelt pos
@@ -1361,6 +1656,16 @@
% \headsym{xx} test \par test
% \stopitemize
+% \def\removeunwantedspaces
+% {\ifhmode
+% \doloop{\ifdim\lastskip>\zeropoint\unskip\else\exitloop\fi}%
+% \fi}
+
+\def\removeunwantedspaces
+ {\ifhmode \ifdim\lastskip>\zeropoint
+ \unskip \@EAEAEA\removeunwantedspaces
+ \fi \fi}
+
% wait till bugfix in etex is widespead
%
% \beginETEX \lastnodetype
@@ -1420,16 +1725,6 @@
% documentation : \setupregister[alternative=a|b|A|B]
-\def\pushXMLmeaning#1%
- {\@EA\pushmacro\csname\@@XMLelement:#1/\endcsname
- \@EA\pushmacro\csname\@@XMLelement:#1\endcsname
- \@EA\pushmacro\csname\@@XMLelement:/#1\endcsname}
-
-\def\popXMLmeaning#1%
- {\@EA\popmacro\csname\@@XMLelement:#1/\endcsname
- \@EA\popmacro\csname\@@XMLelement:#1\endcsname
- \@EA\popmacro\csname\@@XMLelement:/#1\endcsname}
-
\def\defineXMLstore {\doquadrupleargument\dodefineXMLstore[\saveXMLasdata]}
\def\defineXMLgstore{\doquadrupleargument\dodefineXMLstore[\gsaveXMLasdata]}
@@ -2363,7 +2658,7 @@
\snaptogrid\vbox{\box\columnspanbox}
\fi
\endgraf
- \prevdepth\strutdp
+ \ifvmode\prevdepth\strutdp\fi
\egroup}
\vbox\bgroup
%\topskipcorrection % becomes an option !
@@ -2390,10 +2685,6 @@
\def\stopgeheel
{\stoplinecorrection}
-%D No more news.
-
-\protect
-
%D Next we load a few local optimizations and new features. They
%D live on on my machine and are not distributed, but they may end
%D up in the distributed files.
@@ -2401,4 +2692,4 @@
\readsysfile {cont-loc} {} {} % local improvements, patches, new features
\readsysfile {cont-exp} {} {} % experimental features (e.g. local speed-ups)
-\endinput
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/cont-old.tex b/Master/texmf-dist/tex/context/base/cont-old.tex
index d0529c695ca..70628a10c76 100644
--- a/Master/texmf-dist/tex/context/base/cont-old.tex
+++ b/Master/texmf-dist/tex/context/base/cont-old.tex
@@ -15,6 +15,8 @@
\unprotect
+% \def\middleraggedness {6\bodyfontsize}
+
\def\dosubstitutecommand#1#2%
{\writestatus\m!systems{\string#1\normalspace -> \string#2}%
\gdef#1{#2}%
diff --git a/Master/texmf-dist/tex/context/base/cont-sys.ori b/Master/texmf-dist/tex/context/base/cont-sys.ori
index a74614bd1bf..fff231619b5 100644
--- a/Master/texmf-dist/tex/context/base/cont-sys.ori
+++ b/Master/texmf-dist/tex/context/base/cont-sys.ori
@@ -82,12 +82,15 @@
\resetmapfiles
+% more recent versions of pdftex support map loading on each page
+
\donefalse \ifx\pdftexversion\undefined \else \ifnum\number\pdftexversion>119
\donetrue
\fi \fi \ifdone
\loadmapfile[original-base.map]
\loadmapfile[original-ams-base.map]
+ \loadmapfile[original-ams-euler.map]
\loadmapfile[original-public-lm.map]
\else
diff --git a/Master/texmf-dist/tex/context/base/context.tex b/Master/texmf-dist/tex/context/base/context.tex
index 0d67d6746f0..4dac19ed231 100644
--- a/Master/texmf-dist/tex/context/base/context.tex
+++ b/Master/texmf-dist/tex/context/base/context.tex
@@ -31,7 +31,11 @@
%D 2004.8.30 the low level interface is english. Watch out and adapt
%D your styles an modules.
-\def\contextversion{2005.10.27}
+\def\contextversion{2006.08.08 21:51}
+
+%D For those who want to use this:
+
+\def\fmtname{context}
%D Welcome to the main module. When this module is ran through
%D \type{initex} or \type {tex -i} or \type {whatevertex} using
@@ -123,10 +127,10 @@
\input supp-vis.tex
\input supp-fun.tex
\input supp-eps.tex
-\input supp-pdf.tex
+%input supp-pdf.tex
\input supp-spe.tex
\input supp-mps.tex
-\input supp-mpe.tex
+%input supp-mpe.tex
\input supp-tpi.tex
\input supp-mat.tex
\input supp-ran.tex
@@ -181,10 +185,14 @@
\input filt-ini.tex
\input hand-ini.tex
\input regi-ini.tex
+\input regi-syn.tex
\input lang-ini.tex
\input lang-ctx.tex
\input lang-dis.tex % after lang-ctx !
\input unic-ini.tex
+%input unic-ext.tex % obsolete
+
+% \readfile{lang-url.pat}{}{} % test
\input colo-ini.tex
\input colo-ext.tex
@@ -234,19 +242,21 @@
\input core-vis.tex
%input core-con.tex
\input core-rul.tex
+\input core-num.tex
+\input core-tsp.tex % splitter
\input core-tab.tex
\input core-nav.tex
\input core-ref.tex
\input core-obj.tex
\input core-buf.tex
\input core-lst.tex
-\input core-num.tex
\input core-itm.tex
\input core-des.tex
\input core-mat.tex
\input core-syn.tex
\input core-spa.tex
\input core-sys.tex
+\input core-pos.tex
\input page-ini.tex
\input page-not.tex
@@ -267,6 +277,8 @@
\input page-app.tex % unfinished
\input page-flw.tex % experimental: flows
\input page-spr.tex % experimental: spreads
+\input page-plg.tex % experimental: plugins
+\input page-str.tex % experimental: streams
\input core-job.tex
@@ -283,18 +295,21 @@
%D support is also organized in its own class of modules.
\input meta-ini.tex
+\input meta-pdf.tex
\input meta-pag.tex
\input meta-fig.tex
%D On which the next one depends:
-\input core-pos.tex
+\input core-pgr.tex
+\input core-bar.tex
\input core-snc.tex
%D A few more languages, that have specifics using core
%D functionality:
\input lang-chi.tex
+\input lang-jap.tex
%D How about fill||in fields and related stuff?
@@ -320,11 +335,14 @@
\input type-ini.tex
\input type-def.tex
+\input meta-tex.tex % we need fonts
+
\input prop-ini.tex
\input prop-lay.tex % needs core-ref.tex
\input prop-mis.tex
\input math-ini.tex % needs enco-ini.tex
+\input math-ext.tex
%D Now we're ready for more core modules.
@@ -345,7 +363,7 @@
%D Sorting:
-% not yet: \input sort-ini.tex
+\input sort-ini.tex
%D Only the basic XML parser and remapper are part of the core.
%D These macrosa re loaded last since they overload and|/|or
@@ -354,7 +372,8 @@
\input xtag-ini.tex
\input xtag-ext.tex
\input xtag-prs.tex
-\input xtag-map.tex
+\input xtag-map.tex % may become obsolete
+\input xtag-stk.tex
\input xtag-exp.tex
\input xtag-pre.tex
\input xtag-xsd.tex
@@ -365,6 +384,16 @@
\input meta-xml.tex % to be documented
+%D Temporary hack, will go when we move to newtexexec:
+
+% \unprotect
+% \appendtoks % newtexexec/newtexutil, after option file is loaded:
+% \doif{\systemparameter\c!method} {2}
+% {\def\TEXEXECcommand{texmfstart newtexexec} %
+% \readsysfile {sort-ini} {} {}}%
+% \to \everyjob
+% \protect
+
% %D The next two modules implement some additional
% %D functionality concerning classes of documents and output.
% %D These modules probably will be replaced some day.
@@ -448,15 +477,15 @@
\startinterface italian
-\writestring{Questo pacchetto basato sul Plain TeX. Usa una versione adattata del}
+\writestring{Questo pacchetto è basato sul Plain TeX. Usa una versione adattata del}
\writestring{meccanismo di marcatura esteso di J. Fox (1987) ad alcune parti del}
\writestring{meccanismo per gli oggetti mobili laterali di D. Comenetz (1993).}
-\writestring{La maggior parte del Plain TeX (\fmtversion) di D.E. Knuth disponibile}
-\writestring{e pu essere usata senza problemi. Questo pacchetto usa TaBlE,}
+\writestring{La maggior parte del Plain TeX (\fmtversion) di D.E. Knuth è disponibile}
+\writestring{e può essere usata senza problemi. Questo pacchetto usa TaBlE,}
\writestring{un pacchetto progettato da e con diritti di copia di M.J. Wichura (1988).}
\writestring{Vengono generati pochi file ausiliari, alcuni dei quali devono essere}
\writestring{elaborati da TeXUtil (\utilityversion). La versione attuale del blocco}
-\writestring{ \blockversion.}
+\writestring{è \blockversion.}
\writestring{}
\writestring{L'INTERFACCIA UTENTE ITALIANA E' ANCORA IN VIA DI SVILUPPO!}
\writestring{THE ITALIAN USER INTERFACE IS STILL UNDER DEVELOPMENT!}
diff --git a/Master/texmf-dist/tex/context/base/core-bar.tex b/Master/texmf-dist/tex/context/base/core-bar.tex
new file mode 100644
index 00000000000..eeb3de630a1
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-bar.tex
@@ -0,0 +1,195 @@
+%D \module
+%D [ file=core-bar,
+%D version=2003.03.16,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Margin Bars and alike,
+%D author=Hans Hagen,
+%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.
+
+\writestatus{loading}{Context Plus Macros / Margin Bars etc}
+
+\unprotect
+
+%D We will implement a sidebar mechanism using the
+%D functionality from \type {core-pos}.
+%D
+%D \starttyping
+%D \definesidebar[whow][rulecolor=green,distance=]
+%D
+%D \input tufte \par
+%D \startsidebar
+%D \input tufte \par
+%D \input tufte \par
+%D \startsidebar[whow]
+%D \input tufte \par
+%D \input tufte \par
+%D \input tufte
+%D \stopsidebar \par
+%D \input tufte \par
+%D \input tufte
+%D \stopsidebar \par
+%D \input tufte \par
+%D \input tufte \par
+%D \startsidebar
+%D \input tufte \par
+%D \input tufte \par
+%D \input tufte \par
+%D \input tufte \par
+%D \input tufte
+%D \stopsidebar \par
+%D \input tufte \par
+%D \input tufte \par
+%D \startsidebar
+%D \input tufte
+%D \input tufte
+%D \input tufte
+%D \input tufte
+%D \input tufte
+%D \stopsidebar
+%D \stoptyping
+
+\newcounter\currentsidebar
+\newdimen \sidebardistance
+
+\def\setupsidebars
+ {\dodoubleargument\dosetupsidebars}
+
+\def\dosetupsidebars[#1][#2]%
+ {\ifsecondargument
+ \getparameters[\??br#1][#2]%
+ \else
+ \getparameters[\??br][#1]%
+ \fi}
+
+% \setupMPvariables
+% [mpos:bar]
+% [linecolor=red,
+% linewidth=2pt,
+% distance=5pt]
+
+\setupsidebars
+ [\c!rulethickness=2pt,
+ \c!rulecolor=red,
+ \c!distance=.5\bodyfontsize]
+
+\def\definesidebar
+ {\dodoubleempty\dodefinesidebar}
+
+\def\dodefinesidebar[#1][#2]%
+ {\copyparameters
+ [\??br#1][\??br]
+ [\c!rulethickness,\c!rulecolor,\c!distance]%
+ \getparameters
+ [\??br#1][#2]}
+
+\def\startsidebar
+ {\dosingleempty\dostartsidebar}
+
+\def\dostartsidebar[#1]%
+ {\bgroup
+ \dontleavehmode
+ \checktextbackgrounds
+ \doglobal\increment\currentsidebar
+ \doifelsenothing{#1}
+ {\advance\sidebardistance\@@brdistance}
+ {\doifelsevaluenothing{\??br#1\c!distance}
+ {\advance\sidebardistance\@@brdistance}
+ {\sidebardistance\getvalue{\??br#1\c!distance}}}%
+ \startpositionoverlay{text-1}%
+ \expanded{\setMPpositiongraphicrange
+ {b:side:\currentsidebar}%
+ {e:side:\currentsidebar}%
+ {mpos:bar}%
+ {self=side:\currentsidebar,
+ linewidth=\getvalue{\??br#1\c!rulethickness},
+ linecolor=\getvalue{\??br#1\c!rulecolor},
+ distance=\the\sidebardistance}}%
+ \stoppositionoverlay
+% \edef\stopsidebar{\noexpand\dostopsidebar{\currentsidebar}}%
+ \bpos{side:\currentsidebar}\ignorespaces}
+
+% \def\dostopsidebar#1%
+% {\removelastspace\tpos{side:#1}\carryoverpar\egroup}
+
+\def\stopsidebar
+ {\removelastspace\tpos{side:\currentsidebar}\carryoverpar\egroup}
+
+\startMPpositionmethod{mpos:bar}
+ \startMPpositiongraphic{mpos:bar}{linecolor,linewidth,distance}%
+ StartPage ;
+ path p ; p :=
+ if \MPp\MPbself=\MPp\MPeself :
+ (xpart ulcorner Field[Text][Text],\MPy\MPbself+\MPh\MPbself) --
+ (xpart llcorner Field[Text][Text],\MPy\MPeself-\MPd\MPeself) ;
+ elseif RealPageNumber=\MPp\MPbself :
+ (xpart ulcorner Field[Text][Text],\MPy\MPbself+\MPh\MPbself) --
+ (llcorner Field[Text][Text]) ;
+ elseif RealPageNumber=\MPp\MPeself :
+ (ulcorner Field[Text][Text]) --
+ (xpart llcorner Field[Text][Text],\MPy\MPeself-\MPd\MPeself) ;
+ else :
+ (ulcorner Field[Text][Text]) --
+ (llcorner Field[Text][Text]) ;
+ fi ;
+ p := p shifted (-llcorner Field[Text][Text]-(\MPvar{distance},0)) ;
+ interim linecap := butt ;
+ draw p
+ withpen pencircle scaled \MPvar{linewidth}
+ withcolor \MPvar{linecolor} ;
+ StopPage ;
+ \stopMPpositiongraphic
+ \MPpositiongraphic{mpos:bar}{}%
+\stopMPpositionmethod
+
+%D We now reimplement the margin rules handler defined in
+%D \type {core-rul}:
+%D
+%D \setupmarginrules[level=5]
+%D
+%D \startmarginrule[1]
+%D First we set the level at~5. Next we typeset this first
+%D paragraph as a level~1 one. As expected no rule show up.
+%D \stopmarginrule
+%D
+%D \startmarginrule[5]
+%D The second paragraph is a level~5 one. As we can see here,
+%D the marginal rule gets a width according to its level.
+%D \stopmarginrule
+%D
+%D \startmarginrule[8]
+%D It will of course be no surprise that this third paragraph
+%D has a even thicker margin rule. This behavior can be
+%D overruled by specifying the width explictly.
+%D \stopmarginrule
+
+\definesidebar
+ [\v!margin]
+ [\c!rulecolor=\s!black,
+ \c!rulethickness=\@@karulethickness,
+ \c!distance=\dimexpr\leftmargindistance-\@@karulethickness/2\relax]
+
+\definecomplexorsimple\startmarginrule
+
+\def\simplestartmarginrule
+ {\complexstartmarginrule[1]}
+
+\def\complexstartmarginrule[#1]%
+ {\bgroup
+ \ifnum#1<\@@kalevel\relax
+ \let\stopmarginrule\egroup
+ \else
+ \def\@@kadefaultwidth{#1}%
+ \let\stopmarginrule\dostopmarginrule
+ \@EA\startsidebar\@EA[\@EA\v!margin\@EA]%
+ \fi}
+
+\def\dostopmarginrule
+ {\stopsidebar
+ \egroup}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-box.tex b/Master/texmf-dist/tex/context/base/core-box.tex
index 8875cfe5fd1..184f0647ce1 100644
--- a/Master/texmf-dist/tex/context/base/core-box.tex
+++ b/Master/texmf-dist/tex/context/base/core-box.tex
@@ -164,7 +164,7 @@
\def\dodosetcollector[#1][#2]% todo: keep reference point
{\def\currentcollector{#1}%
- \chardef\collectorbox\csname\@@collectorbox#1\endcsname
+ \mathchardef\collectorbox\csname\@@collectorbox#1\endcsname
\getparameters[\??cb#1][#2]%
\@@layerxsiz\wd\collectorbox
\@@layerysiz\ht\collectorbox
@@ -261,7 +261,7 @@
\def\doadaptcollector[#1][#2]%
{\bgroup
\def\currentcollector{#1}%
- \chardef\collectorbox\csname\@@collectorbox#1\endcsname
+ \mathchardef\collectorbox\csname\@@collectorbox#1\endcsname
\getparameters
[\??cb#1][\c!voffset=\zeropoint,\c!hoffset=\zeropoint,#2]%
\scratchdimen\wd\collectorbox
diff --git a/Master/texmf-dist/tex/context/base/core-buf.tex b/Master/texmf-dist/tex/context/base/core-buf.tex
index 0aab656f9d8..73c93b356f5 100644
--- a/Master/texmf-dist/tex/context/base/core-buf.tex
+++ b/Master/texmf-dist/tex/context/base/core-buf.tex
@@ -97,10 +97,10 @@
\startmessages norwegian library: textblocks
title: tekstblokker
- 1: ny versjon, andre gjennomkjring ndvendig
+ 1: ny versjon, andre gjennomkjøring nødvendig
2: skriver blokker til --
3: leser blokker fra --
- 4: andre gjennomkjring ndvendig
+ 4: andre gjennomkjøring nødvendig
5: -- ikke skjult
6: -- skjult og behandlet
7: -- skjult
@@ -127,6 +127,22 @@
12: -- sarit peste
\stopmessages
+\startmessages french library: textblocks
+ title: blocs de texte
+ 1: nouvelle version, une seconde passe est nécessaire
+ 2: ecriture des blocs vers --
+ 3: lecture des blocs en provenance de --
+ 4: seconde passe nécessaire
+ 5: -- non caché
+ 6: -- caché et traité
+ 7: -- caché
+ 8: -- composé
+ 9: -- non composé
+ 10: -- chargé et traité
+ 11: -- chargé et composé
+ 12: -- sauté
+\stopmessages
+
\unprotect
% more accurate
@@ -199,19 +215,28 @@
\fi
\next}
+\chardef\buffernestmode\plusone % 0: not nested, 1: startbuffer nested, 2: all buffers nested
+
\def\dododostartbuffer[#1][#2][#3][#4]%
{%\showmessage\m!systems{15}{#2}%
\doifelsevalue{\??bu#1\c!paragraph}\v!yes
{\segmentatebuffertrue}
{\doifnumberelse{\getvalue{\??bu#1\c!paragraph}}\segmentatebuffertrue\segmentatebufferfalse}%
+ \doifvalue{\??bu#1\c!local}\v!yes
+ {\chardef\buffernestmode\plustwo}% permit nesting
\doifelsenothing{#4}
{\letbeundefined{\e!stop\v!buffer}% % \let\stopbuffer=\relax % \undefined
\@EA\@EA\@EA\convertargument\@EA\e!start\v!buffer\to\beginofblock % else a space
\@EA\@EA\@EA\convertargument\@EA\e!stop \v!buffer\to\endofblock
- \let\processnextblockline\processnextbufferline}
+ \ifcase\buffernestmode \else
+ \let\processnextblockline\processnextbufferline
+ \fi}
{\letbeundefined{#4}% \letvalue{#4}=\relax % \undefined
\@EA\convertargument\csname#3\endcsname\to\beginofblock
- \@EA\convertargument\csname#4\endcsname\to\endofblock}%
+ \@EA\convertargument\csname#4\endcsname\to\endofblock
+ \ifcase\buffernestmode \or \else
+ \let\processnextblockline\processnextbufferline
+ \fi}%
\def\closeblock
{\ifsegmentatebuffer
\immediate\write\tmpblocks{\string\stopbufferparagraph}%
@@ -274,8 +299,7 @@
\dobuffer{16}[#2]\readjobfile
\getvalue{\??bu#1\c!after}}
-\let\getbuffer \processTEXbuffer % handy
-\let\getbuffer\processTEXbuffer % will move to mult-com.tex
+\let\getbuffer\processTEXbuffer % handy
\def\typebuffer
{\dodoubleempty\dotypebuffer}
@@ -297,7 +321,7 @@
\getparameters[\??bu][#1]%
\fi}
-\def\dodefinebuffer[#1]%
+\def\dodefinebuffer[#1][#2]%
{\iffirstargument % else problems
\doglobal\increment\nofdefinedbuffers
\letvalue{\??bu#1\c!number}\nofdefinedbuffers
@@ -307,11 +331,12 @@
\setevalue{\e!get#1}%
{\noexpand\dodoprocessTEXbuffer[#1][def-\nofdefinedbuffers]}%
\setevalue{\e!type#1}%
- {\noexpand\dodotypebuffer[#1][def-\nofdefinedbuffers]}%
+ {\noexpand\dotypebuffer[#1][def-\nofdefinedbuffers]}%
+ \getparameters[\??bu#1][#2]%
\fi}
\def\definebuffer
- {\dosingleargument\dodefinebuffer}
+ {\dodoubleempty\dodefinebuffer}
% yet another undocumented feature, but who cares:
@@ -468,8 +493,8 @@
\@EA\dosetblockcounters\@EA[\blockstatus]%
\fi}
-\def\getblockstatus#1% is this still ok
- {\dosetfilterlevel{\getvalue{\??by\@@bscriterium}}\empty
+\def\getblockstatus#1%
+ {\dosetfilterlevel{\@@bscriterium}\empty
\expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]}
{\global\blockpermittedtrue}
{\global\blockpermittedfalse}%
@@ -520,7 +545,7 @@
\ifcase\blocklevel\doingblocksfalse\else\doingblockstrue\fi}
\def\opentmpblock
- {\immediate\openout\tmpblocks=\TEXbufferfile{\f!utilityfilename\the\blocklevel}}
+ {\immediate\openout\tmpblocks\TEXbufferfile{\f!utilityfilename\the\blocklevel}}
\def\closetmpblock
{\immediate\write\tmpblocks{}% een lege regel is handig voor \par commando's
@@ -550,7 +575,7 @@
\def\checkcopyingblocks
{\ifcopyingblocks
\else
- \immediate\openout\outblocks\f!utilityfilename.\f!blockextension
+ \immediate\openout\outblocks\f!utilityfilename.\f!blockextension%
\immediate\write\outblocks{\string\thisisblockversion{\blockversion}}%
\immediate\write\outblocks{\string\thisissectionseparator{\sectionseparator}}%
\global\copyingblockstrue
@@ -737,8 +762,11 @@
\c!style=,
\c!file=\jobname]}
+% \def\defineblock
+% {\dosingleargumentwithset\dodefineblock}
+
\def\defineblock
- {\dosingleargumentwithset\dodefineblock}
+ {\dosingleargument\dodefineblock}
\def\dosetupblock[#1][#2]%
{\getparameters[\??tb#1][#2]}
@@ -781,7 +809,7 @@
\def\next
{\def\dobeforeblock####1####2%
{\begingroup
- \global\visiblefalse}%
+ \visiblefalse}%
\def\doafterblock####1####2%
{{\setbox0\vbox
{\catcode`\^^M=\@@endofline\relax
@@ -965,16 +993,15 @@
{\settrue \processblockstatus\douseblocks}
\def\doselectblocks[#1][#2][#3]%
- {\doifelsenothing{#3}
- {\getparameters[\??bs][#2]%
- \douseblocks[#1][]}
- {\getparameters[\??bs][#3]%
- \douseblocks[#1][#2]}}%
+ {\begingroup
+ \doifelsenothing{#3}
+ {\getparameters[\??bs][\c!criterium=\v!all,#2]%
+ \dodouseblocks[#1][]}
+ {\getparameters[\??bs][\c!criterium=\v!all,#3]%
+ \dodouseblocks[#1][#2]}}%
\def\selectblocks
- {\begingroup
- \doassign[\??bs][\c!criterium=\v!all]%
- \dotripleempty\doselectblocks}
+ {\dotripleempty\doselectblocks}
\def\beginblock[#1]% % we also check \endblock[..]
{\getvalue{\e!begin#1}}
@@ -1022,11 +1049,11 @@
\setupcopyblock
\skipblocklineAB}
-% the buffer mechanism handles nesting, add some switch
+% \setvalue{\e!start\v!hiding}%
+% {\dostartbuffer[buf-\nofpostponedblocks]
+% [\e!start\v!hiding][\e!stop\v!hiding]}
-\setvalue{\e!start\v!hiding}%
- {\dostartbuffer[buf-\nofpostponedblocks]
- [\e!start\v!hiding][\e!stop\v!hiding]}
+\definebuffer[\v!hiding] \setupbuffer[\v!hiding][\c!local=\v!yes]
\setupbuffer
[\c!paragraph=\v!no,
diff --git a/Master/texmf-dist/tex/context/base/core-con.tex b/Master/texmf-dist/tex/context/base/core-con.tex
index a6d66641cc1..98837ec6dc3 100644
--- a/Master/texmf-dist/tex/context/base/core-con.tex
+++ b/Master/texmf-dist/tex/context/base/core-con.tex
@@ -20,6 +20,21 @@
%D one and a core one, but to keep things simple as well as
%D preserve the overview, I decided against splitting.
+\let\spr\firstofoneargument % separator
+\let\stp\firstofoneargument % stopper
+
+% cleaner, some day:
+%
+% \def\isolateseparators % etex only, even works with list separator overloading
+% {\unexpanded\def\spr##1{{##1}}%
+% \unexpanded\def\stp##1{{##1}}}
+
+% needed for arab :
+
+\def\isolateseparators % even works with list separator overloading
+ {\def\spr##1{{##1}}%
+ \def\stp##1{{##1}}}
+
%D \macros
%D {numbers}
%D
@@ -43,6 +58,8 @@
\def\numbers#1{\purenumber{#1}}
\def\Numbers#1{\purenumber{#1}}
+\def\twodigits #1{\ifnum #1<10 0\fi\number#1}
+\def\threedigits#1{\ifnum#1<100 \ifnum#1<10 0\fi0\fi\number#1}
%D \macros
%D {romannumerals,Romannumerals}
@@ -308,24 +325,32 @@
%D
%D Anyhow, the conversion looks like:
-\def\doconvertmonth#1%
- {\labeltext
- {\ifcase#1%
- \or \v!january \or \v!february \or \v!march \or \v!april
- \or \v!may \or \v!june \or \v!july \or \v!august
- \or \v!september \or \v!october \or \v!november \or \v!december
- \fi}}
+\def\domonthtag#1%
+ {\ifcase#1%
+ \or \v!january \or \v!february \or \v!march \or \v!april
+ \or \v!may \or \v!june \or \v!july \or \v!august
+ \or \v!september \or \v!october \or \v!november \or \v!december
+ \else
+ \v!unknown
+ \fi}
+
+\def\doconvertmonthlong #1{\labeltext{\domonthtag{#1}}}
+\def\doconvertmonthshort#1{\labeltext{\domonthtag{#1}:\s!mnem}}
+
+\let\doconvertmonth\doconvertmonthlong
%D We redefine the \TEX\ primitive \type{\month} as:
%D
%D \showsetup{month}
%D \showsetup{MONTH}
-\def\month
- {\doconvertmonth}
+\def\monthlong {\doconvertmonthlong}
+\def\monthshort{\doconvertmonthshort}
+\def\month {\doconvertmonth}
-\def\MONTH#1%
- {{\let\labeltext\LABELTEXT\month{#1}}}
+\def\MONTH #1{{\let\labeltext\LABELTEXT\month {#1}}}
+\def\MONTHLONG #1{{\let\labeltext\LABELTEXT\monthlong {#1}}}
+\def\MONTHSHORT#1{{\let\labeltext\LABELTEXT\monthshort{#1}}}
%D We never explicitly needed this, but Tobias Burnus pointed
%D out that it would be handy to convert to the day of the
@@ -596,7 +621,9 @@
{\bgroup
\let\labellanguage\currentlanguage
\def\betweendates{\let\betweendates\dobetweendates}%
- \processcommacommand[#1]\docomplexcurrentdate
+ % was \processcommacommandp[#1]\docomplexcurrentdate
+ \safeedef\ascii{\empty#1}% keep encoded chars
+ \@EA\processcommalist\@EA[\ascii]\docomplexcurrentdate
\ifdim\lastskip=\datesignal\relax
\unskip
\fi
@@ -604,8 +631,7 @@
\def\docomplexcurrentdate#1%
{\lowercase{\edef\!!stringa{#1}}% permits usage in \smallcapped
- \processaction
- [#1]
+ \expanded{\processaction[\!!stringa]}% [#1]
[ \v!day=>\betweendates\the\normalday,
%\v!day+=>\betweendates\ordinaldaynumber\normalday,
\v!day+=>\betweendates\convertnumber{\v!day+}\normalday,
@@ -767,6 +793,22 @@
\dododefineconversion[][#1][#2]%
\fi}
+%D \starttyping
+%D \def\dododefineconversion[#1][#2][#3]%
+%D {\ConvertConstantAfter\doifinstringelse{,}{#3}
+%D {\scratchcounter\zerocount
+%D \def\docommando##1%
+%D {\advance\scratchcounter \plusone
+%D \setvalue{\??cv#1#2\the\scratchcounter}{##1}}%
+%D \processcommalist[#3]\docommando
+%D \setvalue{\??cv#1#2}##1{\executeifdefined{\??cv#1#2##1}\unknown}} % catch out-of-range numbers
+%D {\setvalue{\??cv#1#2}{#3}}}
+%D \stoptyping
+
+%D This approach has the disadvantage that when you run out of
+%D symbols you get unknown results. The following implementation
+%D permits overloading of the converter:
+
\def\dododefineconversion[#1][#2][#3]%
{\ConvertConstantAfter\doifinstringelse{,}{#3}
{\scratchcounter\zerocount
@@ -774,30 +816,22 @@
{\advance\scratchcounter \plusone
\setvalue{\??cv#1#2\the\scratchcounter}{##1}}%
\processcommalist[#3]\docommando
- \setvalue{\??cv#1#2}##1{\csname\??cv#1#2##1\endcsname}}
+ \setevalue{\??cv#1#2}##1%
+ {\noexpand\docheckedconversion{#1#2}{\the\scratchcounter}{##1}}}
{\setvalue{\??cv#1#2}{#3}}}
-% \def\convertnumber#1%
-% {\csname\??cv#1\endcsname}
+\def\docheckedconversion#1#2#3% class maxnumber number
+ {\executeifdefined{\??cv#1#3}\unknown}
-% \def\convertnumber#1%
-% {\csname\??cv
-% \ifundefined{\??cv\currentlanguage#1}\else\currentlanguage\fi
-% #1\endcsname}
+%D When Gerben reported problems with footnote numbering per page,
+%D Taco came with the following wrap around solution. So, let's
+%D overload the checked conversion macro:
-% \def\doifconversiondefinedelse#1%
-% {\ifundefined{\??cv#1}%
-% \@EA\secondoftwoarguments
-% \else
-% \@EA\firstoftwoarguments
-% \fi}
+\def\docheckedconversion#1#2#3% class maxnumber number
+ {\executeifdefined{\??cv#1\modulatednumber{#2}{#3}}\unknown}
-% \def\doifconversiondefinedelse#1%
-% {\ifundefined{\??cv\ifundefined{\??cv\currentlanguage:#1}\else\currentlanguage\fi#1}%
-% \@EA\secondoftwoarguments
-% \else
-% \@EA\firstoftwoarguments
-% \fi}
+%D Taco's modulo code is implemented in the system module
+%D \type {syst-con}.
\beginETEX \ifcsname
@@ -903,6 +937,9 @@
\defineconversion [arabicnumerals] [\numbers]
\defineconversion [persiannumerals] [\numbers]
+\defineconversion [month] [\doconvertmonthlong]
+\defineconversion [month:mnem] [\doconvertmonthshort]
+
\beginXETEX \number
\defineconversionvector{arabicnumerals} {"0660}
diff --git a/Master/texmf-dist/tex/context/base/core-dat.tex b/Master/texmf-dist/tex/context/base/core-dat.tex
index 239b27d70eb..aab352daaa5 100644
--- a/Master/texmf-dist/tex/context/base/core-dat.tex
+++ b/Master/texmf-dist/tex/context/base/core-dat.tex
@@ -2,7 +2,7 @@
%D [ file=core-dat, % was core-02a,
%D version=1999.08.10, % 1997.03.31,
%D title=\CONTEXT\ Core Macros,
-%D subtitle=Database Support, % 2A
+%D subtitle=Database Support, % 2A
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% THIS WILL DISAPPEAR, I.E. BE MOVED TO A MODULE
+% THIS WILL DISAPPEAR, I.E. BE MOVED TO A MODULE
\writestatus{loading}{Context Database Support}
@@ -39,7 +39,7 @@
4: unbekannte Datei --
\stopmessages
-% TOM :
+% TOM :
\startmessages czech library: databases
title: databases
@@ -73,105 +73,113 @@
4: fisier necunoscut --
\stopmessages
+\startmessages french library: databases
+ title: bases de données
+ 1: --
+ 2: fichier local --
+ 3: fichier global --
+ 4: fichier inconnu --
+\stopmessages
+
\unprotect
%D This module is a (limited) rewrite of the original \type
%D {core-02a} module, the module that dealt with managing a
-%D database of addresses. The principles and methods have not
-%D changed; they are only generalized.
-%D
-%D A database file |<|in most cases such a base is generated
-%D from another one|>| is structured as follows:
-%D
-%D \starttyping
+%D database of addresses. The principles and methods have not
+%D changed; they are only generalized.
+%D
+%D A database file |<|in most cases such a base is generated
+%D from another one|>| is structured as follows:
+%D
+%D \starttyping
%D \startrecord{tag}
%D \memberofgroup{grouplist}
%D \setrecordentry{name}{...}
%D ....
%D \stoprecord
-%D \stoptyping
-%D
-%D The interface to such a database is defined as follows:
-%D
-%D \starttyping
+%D \stoptyping
+%D
+%D The interface to such a database is defined as follows:
+%D
+%D \starttyping
%D \definerecord[class][settings]
%D \setuprecord[class][settings]
%D \definerecordentry[class][name]
-%D \stoptyping
-%D
-%D and processed by
-%D
-%D \starttyping
+%D \stoptyping
+%D
+%D and processed by
+%D
+%D \starttyping
%D \processrecords[file list][tag and/or group list]
-%D \stoptyping
-%D
-%D The actual processing is done by a macro assigned to \type
-%D {command}:
-%D
-%D \starttyping
+%D \stoptyping
+%D
+%D The actual processing is done by a macro assigned to \type
+%D {command}:
+%D
+%D \starttyping
%D \setuprecord[class][command=\DoWithRecord]
-%D \stoptyping
-%D
-%D Given that one can ask for a field with
-%D
-%D \starttyping
+%D \stoptyping
+%D
+%D Given that one can ask for a field with
+%D
+%D \starttyping
%D \getrecordentry{name}
-%D \stoptyping
-%D
-%D such a command can look like:
-%D
-%D \starttyping
+%D \stoptyping
+%D
+%D such a command can look like:
+%D
+%D \starttyping
%D \def\DoWithRecord#1%
%D {\startpacked
%D \let\\=\quad
%D name: \getrecordentry{name}~\getrecordentry{family name}\par
%D address: \getrecordentry{postal address}\par
%D \stoppacked}
-%D \stoptyping
-%D
+%D \stoptyping
+%D
%D The argument passed is the tag. The database can look like:
-%D
-%D \starttyping
+%D
+%D \starttyping
%D \startrecord{hagenj}
%D \memberofgroup{a,b}
%D \setrecordentry{naam}{Hans}
%D \setrecordentry{family name}{Hagen}
%D \setrecordentry{postal address}{J. Hagen\\Ridderstraat 29\\Hasselt NL}
%D \stoprecord
-%D
+%D
%D \startrecord{ottenaf}
%D \memberofgroup{a}
%D \setrecordentry{name}{Ton}
%D \setrecordentry{family name}{Otten}
%D \setrecordentry{postal address}{A.F. Otten\\Prinsengracht 17\\Hasselt NL}
%D \stoprecord
-%D \stoptyping
-%D
-%D The definition of this database looks like:
-%D
-%D \starttyping
+%D \stoptyping
+%D
+%D The definition of this database looks like:
+%D
+%D \starttyping
%D \definerecord[address][command=\DoWithRecord]
-%D
+%D
%D \definerecordentry[address][name]
%D \definerecordentry[address][family name]
%D \definerecordentry[address][postal address]
-%D \stoptyping
-%D
-%D The actual processing is now done by (for instance):
-%D
-%D \starttyping
+%D \stoptyping
+%D
+%D The actual processing is now done by (for instance):
+%D
+%D \starttyping
%D \processrecords[datafile][hagenj]
%D \processrecords[datafile][hagenj,offenaf]
%D \processrecords[datafile][all]
%D \processrecords[datafile][a]
%D \processrecords[datafile][b]
-%D \stoptyping
-%D
+%D \stoptyping
+%D
%D Of course one can reassign the command used to handle the
-%D records in between.
+%D records in between.
-% \??kt ->
-% \??kw ->
+% \??kt ->
+% \??kw ->
\def\??db {@@db}
\def\c!velden{velden}
@@ -200,7 +208,7 @@
\letvalue{\??db#1\c!velden}\recordentries}
%D Watch out: the entries are defined global! While
-%D processing a record, no grouping is applied.
+%D processing a record, no grouping is applied.
\def\getrecordentry #1{\getvalue {\??db:#1}}
\def\resetrecordentry #1{\letgvalueempty{\??db:#1}}
@@ -211,7 +219,7 @@
\newif\ifrecordok
-\newtoks\resetrecordlist
+\newtoks\resetrecordlist
\def\processrecords
{\dotripleargument\doprocessrecords}
@@ -225,11 +233,11 @@
\processcommacommand[\getvalue{\??db#1\c!velden}]\docommando
\let\setrecordentry\skiprecord
\the\resetrecordlist
- \doifelse{#2}\v!all % 't Is nu eenmaal alles
+ \doifelse{#2}\v!all % 't Is nu eenmaal alles
\recordoktrue
- {\doifelsenothing{#2} % of niets
+ {\doifelsenothing{#2} % of niets
\recordoktrue
- \recordokfalse}% % zullen we maar zeggen.
+ \recordokfalse}% % zullen we maar zeggen.
\ifrecordok
\let\askedrecords\v!all
\else
@@ -279,10 +287,10 @@
%D experiments with \type {%} before each entry and changing
%D the category code of the comment char. Because \TEX\ scans
%D the line anyway |<|this is needed because the end of line
-%D character can be non standard|>| this is not faster.
-%D
+%D character can be non standard|>| this is not faster.
+%D
%D Although this mechanism could have been combined with the
%D block moving mechaism, the current implementation is
-%D prefered out of speed reasons.
+%D prefered out of speed reasons.
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-des.tex b/Master/texmf-dist/tex/context/base/core-des.tex
index f2612be3db5..382dc8ca703 100644
--- a/Master/texmf-dist/tex/context/base/core-des.tex
+++ b/Master/texmf-dist/tex/context/base/core-des.tex
@@ -15,6 +15,8 @@
\unprotect
+% beware: \insidedescription should be set to zero inside footnotes
+
% Dit kan en moet dus anders:
%
% \start... : \vbox\bgroup
@@ -51,7 +53,7 @@
\newbox\@@descriptionbox
-\def\descriptionparameter #1{\csname\??dd\currentdescription#1\endcsname}
+\def\descriptionparameter#1{\csname\??dd\currentdescription#1\endcsname}
\def\@@descriptionhandler{\descriptionparameter{\s!do\c!command}}
@@ -240,14 +242,14 @@
\advance\leftskip -\leftskipadaption \relax
\ifdim\leftskipadaption=\zeropoint
\leftskipadaption1.5em % just some default
- \ifnum\insidedefinition=\plusone
+ \ifnum\insidedescription=\plusone
\ifdim\leftskip>\zeropoint \relax
\leftskipadaption\leftskip
\fi
\fi
\fi
- \ifnum\insidedefinition=\plusone
- \advance\leftskip \leftskipadaption
+ \ifnum\insidedescription>\zerocount % was \ifnum\insidedescription=\plusone
+ \advance\leftskip \leftskipadaption % but we're already further on
\fi
\hskip-\leftskipadaption
\ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox
@@ -266,7 +268,10 @@
%D A new key 'headalign' in definitions.
-\chardef\insidedefinition=0
+\def\resetdescriptions % to be used in e.g. footnotes
+ {\chardef\insidedescription\zerocount}
+
+\resetdescriptions
\let\@@leftdescriptionskip \!!zeropoint
\let\@@rightdescriptionskip\!!zeropoint
@@ -307,26 +312,28 @@
\doifelse{\descriptionparameter\c!aligntitle}\v!no
{\edef\@@leftdescriptionskip {\the\leftskip }%
\edef\@@rightdescriptionskip{\the\rightskip}}
- {\ifcase\insidedefinition
+ {\ifcase\insidedescription
\edef\@@leftdescriptionskip {\the\leftskip }%
\edef\@@rightdescriptionskip{\the\rightskip}%
\fi}%
\expanded{\indenting[\descriptionparameter\c!indenting]}%
% better a system mode
- \ifcase\insidedefinition
- \chardef\insidedefinition\plusone
+ \ifcase\insidedescription
+ \chardef\insidedescription\plusone
\or
- \chardef\insidedefinition\plustwo
+ \chardef\insidedescription\plustwo
\fi} % now happens elsewhere : \noindent\ignorespaces
\def\@@stopdescription#1%
{\def\currentdescription{#1}%
- \dostopattributes
- \par % maybe better after \dostopattributes
+ % was \par \dostopattributes % here, else problems with interlinespace and font change
+ \dostopparbasedattributes % == \settrue\parbasedattributes \dostopattributes
\endgroup
- \descriptionparameter\c!after
+ \descriptionparameter\c!after %hm, which currentdescription?
\egroup % temporary hack
- \dochecknextindentation{\??dd#1}}% \currentdescription}}
+ \def\currentdescription{#1}%
+ \dochecknextindentation{\??dd\currentdescription}%
+ \dorechecknextindentation}
\def\@@dodescription
{\dostartattributes{\??dd\currentdescription}\c!style\c!color\empty
@@ -334,18 +341,6 @@
% starters:
-% \def\@@startdescription[#1][#2]%
-% {\def\currentdescription{#1}%
-% \doifelse{\descriptionparameter{\s!do\c!state}}\v!start
-% {\@@startsomedescription{#1}[#2]{}}
-% {\dowithwargument{\@@startsomedescription{#1}[#2]}}}
-%
-% \def\@@description[#1][#2]%
-% {\def\currentdescription{#1}%
-% \doifelse{\descriptionparameter{\s!do\c!state}}\v!start
-% {\@@somedescription{#1}[#2]{}}
-% {\dowithwargument{\@@somedescription{#1}[#2]}}}
-
\def\@@startdescription[#1][#2]%
{\def\currentdescription{#1}%
\doifelse{\descriptionparameter\c!title}\v!yes
@@ -373,7 +368,8 @@
% which calls:
\def\@@makedescription#1%
- {\def\currentdescription{#1}%
+ {\postponefootnotes % new, assumes grouping
+ \def\currentdescription{#1}%
\executeifdefined
{@@description\descriptionparameter\c!location}
{\getvalue{@@description\v!left}}}
@@ -398,23 +394,9 @@
\def\dodosetupdescriptions[#1]% [#2]%
{\getparameters[\??dd#1]} % [#2]}
-% \def\dodefinedescription[#1][#2]%
-% {\copyparameters[\??dd#1][\??dd]
-% [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor,
-% \c!width,\c!hang,\c!sample,\c!before,\c!inbetween,\c!after,\c!margin,
-% \c!indenting,\c!indentnext,\c!align,\c!text,\c!distance,\c!titledistance,\c!command]%
-% \getparameters[\??dd#1]
-% [\s!do\c!state=\v!stop,\s!do\c!command=\normal@@descriptionhandler,\c!level=,#2]%
-% %\doifvalue{\??dd#1\c!location}\v!top{\doassign[\??dd#1][\c!inbetween=\blank]}%
-% \doifvalue{\??dd#1\c!location}\v!top % we actually need more granularity
-% {\doifnotvalue{\??dd#1\c!inbetween}{\doassign[\??dd#1][\c!inbetween=\blank]}}%
-% \setvalue {#1}{\dodoubleempty\@@description[#1]}%
-% \setvalue{\e!start#1}{\dodoubleempty\@@startdescription[#1]}%
-% \setvalue{\e!stop #1}{\@@stopdescription{#1}}}%
-
\def\dodefinedescription[#1][#2]%
{\copyparameters[\??dd#1][\??dd]
- [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor,
+ [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor,\c!title,
\c!width,\c!hang,\c!sample,\c!before,\c!inbetween,\c!after,\c!margin,
\c!indenting,\c!indentnext,\c!align,\c!text,\c!distance,\c!titledistance,\c!command]%
\getparameters[\??dd#1]
@@ -436,62 +418,6 @@
\def\currentdescriptionnumber
{\csname\??dd\currentdescription\??dd\c!number\endcsname}
-% \def\special@@descriptionhandler[#1]#2#3%
-% {\strut
-% \doifelse{\descriptionparameter\c!number}\v!no
-% \!!doneafalse{\doifelse{#1}{-}\!!doneafalse\!!doneatrue}%
-% \chardef\descriptioncoupling\zerocount
-% \iflocation
-% \doifsomething{\descriptionparameter\c!coupling}
-% {\processaction % genereert > of <
-% [\descriptionparameter\c!couplingway]
-% [ \v!local=>\chardef\descriptioncoupling\plusone, % old: default
-% \v!global=>\chardef\descriptioncoupling\plustwo]}% new: global crosslinking
-% \fi
-% \setupnumber % the number is called indirectly
-% [\currentdescriptionnumber]
-% [\c!sectionnumber=\descriptionparameter\c!sectionnumber]%
-% \if!!donea
-% \makeprecedingsectionnumber[\currentdescriptionnumber]%
-% \preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
-% \iftrialtypesetting\startlocal\fi
-% \getvalue{\e!next\currentdescription}% tricky but we need the preroll
-% \iftrialtypesetting\stoplocal\fi
-% % \getvalue{\e!next#2#1}%
-% \iflocation
-% \bgroup
-% \letvalue{\??dd\currentdescription\c!sectionnumber}\v!yes
-% \protectconversion
-% \makeprecedingsectionnumber[\currentdescriptionnumber]%
-% \preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
-% \ifcase\descriptioncoupling \or
-% \xdef\@@internalenumber{\doshowdnnumber}%
-% \rawreference\s!num{#1:\@@internalenumber}{}%
-% \or
-% \xdef\@@internalenumber{\countervalue{\??dd\c!coupling\currentdescription}}%
-% \rawreference\s!num{\currentdescription:\@@internalenumber}{}%
-% \fi
-% \egroup
-% \fi
-% %\makeprecedingsectionnumber[\currentdescriptionnumber]%
-% %\preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
-% \disablepseudocaps % sorry, uppercase causes troubles
-% \doattributes % \nocase primitive needed
-% {\??dd\currentdescription}\c!headstyle\c!headcolor % todo: sub as well
-% {\descriptionparameter\c!command{\showdntext\domakednnumber}}% hook for taco
-% \iflocation\ifcase\descriptioncoupling \else
-% \edef\localconnection{\descriptionparameter\c!coupling:\@@internalenumber}%
-% \doifreferencefoundelse\localconnection
-% {\in[\localconnection]}\donothing % genereert > of <
-% \fi\fi
-% \doifnot{#1}{-}{\rawreference\s!num{#1}{\doshowdnnumber}}%
-% \else % Why was this strange expansion needed?
-% \edef\!!stringa{\showdnpuretext}% nog eens testen binnen \expanded
-% \expanded{\doattributes{\??dd\currentdescription}\noexpand\c!headstyle\noexpand\c!headcolor
-% {\noexpand\descriptionparameter\noexpand\c!command{\!!stringa}}}%
-% \doifnot{#1}{-}{\rawreference\s!num{#1}{}}%
-% \fi}
-
\def\special@@descriptionhandler[#1]#2#3%
{\strut
\doifelse{\descriptionparameter\c!number}\v!no
@@ -509,7 +435,7 @@
[\c!sectionnumber=\descriptionparameter\c!sectionnumber]%
\if!!donea
\makeprecedingsectionnumber[\currentdescriptionnumber]%
- \preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
+ \prepareprefixnumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
\iftrialtypesetting\startlocal\fi
\getvalue{\e!next\currentdescription}% tricky but we need the preroll
\iftrialtypesetting\stoplocal\fi
@@ -519,7 +445,7 @@
\letvalue{\??dd\currentdescription\c!sectionnumber}\v!yes
\protectconversion
\makeprecedingsectionnumber[\currentdescriptionnumber]%
- \preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
+ \prepareprefixnumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
\ifcase\descriptioncoupling \or
\xdef\@@internalenumber{\doshowdnnumber}%
\rawreference\s!num{#1:\@@internalenumber}{}%
@@ -530,7 +456,7 @@
\egroup
\fi
%\makeprecedingsectionnumber[\currentdescriptionnumber]%
- %\preparethenumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
+ %\prepareprefixnumber{\??dd\currentdescription}\precedingsectionnumber\preparednumber
\disablepseudocaps % sorry, uppercase causes troubles
\doattributes % \nocase primitive needed
{\??dd\currentdescription}\c!headstyle\c!headcolor % todo: sub as well
@@ -582,17 +508,17 @@
\setvalue{showdn\v!sub\c!number}%
{\getvalue{showdn\c!number}%
- \descriptionparameter\c!separator
+ \spr{\descriptionparameter\c!separator}%
\convertednumber[\v!sub\currentdescriptionnumber]}
\setvalue{showdn\v!sub\v!sub\c!number}%
{\getvalue{showdn\v!sub\c!number}%
- \descriptionparameter\c!separator
+ \spr{\descriptionparameter\c!separator}%
\convertednumber[\v!sub\v!sub\currentdescriptionnumber]}
\setvalue{showdn\v!sub\v!sub\v!sub\c!number}%
{\getvalue{showdn\v!sub\v!sub\c!number}%
- \descriptionparameter\c!separator
+ \spr{\descriptionparameter\c!separator}%
\convertednumber[\v!sub\v!sub\v!sub\currentdescriptionnumber]}
\def\domakednnumber
@@ -667,49 +593,6 @@
\def\setupenumerations
{\dodoubleempty\dosetupenumerations}
-% \def\dododefineenumeration#1#2#3[#4][#5]%
-% {\makecounter{\??dd\c!coupling#1}% new: global cross linking
-% \dodefinedescription[#3#1]%
-% [\s!do\c!state=\v!start,\c!level=#3,
-% \s!do\c!command=\special@@descriptionhandler]%
-% \copyparameters[\??dd#3#1][\??dn]
-% [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor,
-% \c!width,\c!number,\c!distance,\c!command,
-% \c!sample,\c!hang,\c!align,\c!before,\c!inbetween,\c!after,
-% \c!levels,\c!way,\c!blockway,\c!separator,\c!margin,
-% \c!indenting,\c!indentnext,\c!stopper,\c!sectionnumber,
-% \c!number]%
-% \doifassignmentelse{#4}
-% {\getparameters[\??dd#3#1]%
-% [\c!text=#1,\??dd\c!number=#1,\c!conversion=,
-% \c!left=,\c!right=,\c!coupling=,\c!couplingway=\v!local,#4]}%
-% {\doifelsenothing{#4}
-% {\getparameters[\??dd#3#1]%
-% [\c!text=#1,\??dd\c!number=#1,\c!conversion=,
-% \c!stopper=,
-% \c!left=,\c!right=,\c!coupling=,\c!couplingway=,#4]}%
-% {\copyparameters[\??dd#3#1][\??dd#3#4]
-% [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor,
-% \c!width,\c!number,\c!distance,\c!command,\c!margin,
-% \c!sample,\c!hang,\c!align,\c!before,\c!inbetween,\c!after,
-% \c!stopper,\c!indenting,\c!indentnext,\c!left,\c!right,
-% \c!coupling,\c!couplingway]%
-% \getparameters[\??dd#3#1]
-% [\c!text=#1,\??dd\c!number=#4,\c!conversion=,#5]}}%
-% \doifvalue{\??dd#3#1\??dd\c!number}{#1}
-% {\definenumber
-% [#3#1]
-% [\c!way=\descriptionparentparameter\c!way,
-% \c!blockway=\descriptionparentparameter\c!blockway,
-% \c!sectionnumber=\descriptionparentparameter\c!sectionnumber]%
-% \doifvalue{\??dd#1\c!levels}{#2}% % for
-% {\doifsomething{\getvalue{\??dd#1\c!conversion}}% % old
-% {\setupnumber[#3#1] % times
-% [\c!conversion=\descriptionparameter\c!conversion]}}}% % sake
-% \setvalue{\s!set #3#1}{\dosetenumerationnumber[#1][#3]}%
-% \setvalue{\s!reset#3#1}{\doresetenumerationnumber[#1][#3]}%
-% \setvalue{\e!next #3#1}{\dotripleempty\donextenumerationnumber[#1][#3]}}
-
\def\dododefineenumeration#1#2#3[#4][#5]%
{\makecounter{\??dd\c!coupling#1}% new: global cross linking
\dodefinedescription[#3#1]%
@@ -751,9 +634,14 @@
[\c!conversion=\descriptionparameter\c!conversion]}}}% % sake
\doifvaluesomething{\??dd#3#1\c!list}
{\definelist[\getvalue{\??dd#3#1\c!type}:\getvalue{\??dd#3#1\c!list}]}% new
- \setvalue{\s!set #3#1}{\dosetenumerationnumber[#1][#3]}%
- \setvalue{\s!reset#3#1}{\doresetenumerationnumber[#1][#3]}%
- \setvalue{\e!next #3#1}{\dotripleempty\donextenumerationnumber[#1][#3]}}
+ % should work ...
+ %setvalue{\s!set #3#1}{\dosetenumerationnumber[#1][#3]}%
+ %setvalue{\s!reset#3#1}{\doresetenumerationnumber[#1][#3]}%
+ %setvalue{\e!next #3#1}{\dotripleempty\donextenumerationnumber[#1][#3]}}
+ % but since we use \currentdescription, we need ...
+ \setevalue{\s!set #3#1}{\noexpand \dosetenumerationnumber [#1][#3]}%
+ \setevalue{\s!reset#3#1}{\noexpand \doresetenumerationnumber[#1][#3]}%
+ \setevalue{\e!next #3#1}{\noexpand\dotripleempty\noexpand\donextenumerationnumber [#1][#3]}}
\def\descriptionparentparameter#1{\csname\??dd\currentdescriptionnumber#1\endcsname}
@@ -818,7 +706,8 @@
{\getvalue{\??ds#1\c!width}}
{\doattributes
{\??ds#1}\c!headstyle\c!headcolor
- {\getvalue{\??ds#1\c!sample}\getvalue{\??ds#1\c!separator}}}
+ {\getvalue{\??ds#1\c!sample}%
+ \spr{\getvalue{\??ds#1\c!separator}}}}
{\getvalue{\??ds#1\c!distance}}%
\advance\!!widtha \getvalue{\??ds#1\c!distance}%
\setbox2\hbox to \!!widtha
@@ -827,7 +716,7 @@
{\strut
\getvalue{\??ds#1\c!text}%
\hss
- \getvalue{\??ds#1\c!separator}%
+ \spr{\getvalue{\??ds#1\c!separator}}%
\hskip\getvalue{\??ds#1\c!distance}}}%
\parindent\zeropoint
\hskip#2\!!widtha\indent\box2%
@@ -923,7 +812,7 @@
\c!conversion=, % to be upward compatible
\c!way=\v!by\v!text,
\c!sectionnumber=\v!yes,
- \c!separator=.,
+ \c!separator=\@@koseparator, % per 2006.06.23, was .
\c!stopper=,
\c!number=,
\c!command=]
diff --git a/Master/texmf-dist/tex/context/base/core-fig.tex b/Master/texmf-dist/tex/context/base/core-fig.tex
index 572500bbdaf..f8d58e03838 100644
--- a/Master/texmf-dist/tex/context/base/core-fig.tex
+++ b/Master/texmf-dist/tex/context/base/core-fig.tex
@@ -101,7 +101,7 @@
\startmessages italian library: figures
title: figure
1: figura -- non trovata
- 2: la figura -- non preimpostata
+ 2: la figura -- non è preimpostata
3: dimensioni della figura -- prese da --
4: dimensioni di -- caricate dal file di immagini stesso
5: dimensioni di -- caricate dal file di immagini --
@@ -128,6 +128,21 @@
11: including resource --
\stopmessages
+\startmessages french library: figures
+ title: figures
+ 1: la figure -- ne peut être trouvée
+ 2: la figure -- n'est pas pré-sélectionnée
+ 3: les dimensions de la figure -- adaptées à partir de --
+ 4: les dimensions de -- chargées implicitement à partir du fichier de figure
+ 5: les dimensions de -- chargées à partir du fichier de figure --
+ 6: les dimensions de -- calculées par TeXUtil
+ 7: regénérer le fichier de figure --
+ 8: figureobject -- est réutilisé
+ 9: la figure -- n'est pas manipulée
+ 10: la figure -- a des dimensions nulles
+ 11: inclusion de la ressource --
+\stopmessages
+
%D Due to the mere fact that \DVI|/|\PDF\ drivers differ in their
%D needs for figure dimensions, we have to provide the width,
%D height, horizontal and vertical scale. Also we want to
@@ -346,6 +361,9 @@
%D Here we start scanning the other types:
+% TODO: svg, get figuresize from file, but when not supported by
+% backend, don't use it yet (else backend will force replacement).
+
\def\@@dogetfiguresize{dogetfiguresize}
\def\getfiguredimensionsA
@@ -418,8 +436,14 @@
\startnointerference
\startXMLignore
\defineXMLcommand[svg][width=100,height=75]
- {\global\dimen1=\XMLop{width}\onebasepoint
- \global\dimen3=\XMLop{height}\onebasepoint
+% {\global\dimen1=\XMLpar{svg}{width}{0}\onebasepoint
+% \global\dimen3=\XMLpar{svg}{height}{0}\onebasepoint
+ {\doifdimensionelse{\XMLop{width}}
+ {\global\dimen1=\XMLop{width}}
+ {\global\dimen1=\XMLop{width}\onebasepoint}%
+ \doifdimensionelse{\XMLop{width}}
+ {\global\dimen3=\XMLop{height}}
+ {\global\dimen3=\XMLop{height}\onebasepoint}%
\endinput}%
\processXMLfilegrouped{#1}%
\stopXMLignore
@@ -452,7 +476,7 @@
\@EA\DOIF\@EA{\@@effilenametype}{#1} % hm, tzt ook nog eens met pad/naam
{\getparameters[\??ep][#2]%
\ExpandBothAfter\doif\@@epe\@@efcurrenttype
- {\chardef\figurestatus4
+ {\chardef\figurestatus\plusfour
\let\@@eftype\@@efcurrenttype
\let\@@effullname\@@efcurrentfile}}%
\else
@@ -462,24 +486,22 @@
\def\getfiguredimensionsC
{\ifconsultutilityfile \ifrunutilityfile
\ifcase\figurestatus\ifcase\figurefilemode\else
-\doifsomething\@@efcurrentpath
-{%
- \doifnotinset\@@effiletype{\c!tex,\c!tmp}
- {\doiffileelse\@@efcurrentfile
- {\edef\@@effilenametype{\@@effilename.\@@efcurrenttype}%
- \@@eftrace{running texutil on \@@effilenametype}%
- \def\@@efloadname{\f!utilityfilename.\f!temporaryextension}%
- \executesystemcommand{texutil --fig --out=\@@efloadname\space\@@effilenametype}%
- \@@eftrace{analyzing \@@efloadname\space on \@@effilenametype}%
- \pushendofline
- \startreadingfile
- \let\presetfigure\presetfigureB
- \readsetfile{.}\@@efloadname\donothing\donothing
- \stopreadingfile
- \popendofline
- \@@eftrace{\ifcase\figurestatus not \fi found}}
- {}}%
-}%
+ \doifsomething\@@efcurrentpath
+ {\doifnotinset\@@effiletype{\c!tex,\c!tmp}
+ {\doiffileelse\@@efcurrentfile
+ {\edef\@@effilenametype{\@@effilename.\@@efcurrenttype}%
+ \@@eftrace{running texutil on \@@effilenametype}%
+ \def\@@efloadname{\f!utilityfilename.\f!temporaryextension}%
+ \executesystemcommand{texutil --fig --out=\@@efloadname\space\@@effilenametype}%
+ \@@eftrace{analyzing \@@efloadname\space on \@@effilenametype}%
+ \pushendofline
+ \startreadingfile
+ \let\presetfigure\presetfigureB
+ \readsetfile{.}\@@efloadname\donothing\donothing
+ \stopreadingfile
+ \popendofline
+ \@@eftrace{\ifcase\figurestatus not \fi found}}
+ {}}}%
\fi\fi
\fi\fi}
@@ -494,19 +516,17 @@
\def\doanalyzefigurefilesB
{\ifconsultutilityfile\ifcase\figurestatus\ifcase\figurefilemode\else
-\doifsomething\@@efcurrentpath
-{%
- \assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname
- \edef\@@effilenametype{\@@effilename.\figureextension{\@@efcurrenttype}}%
- \@@eftrace{analyzing \@@efloadname\space on \@@efcurrentpath\space for \@@effilenametype}%
- \pushendofline
- \startreadingfile
- \let\presetfigure\presetfigureC
- \readsetfile\@@efcurrentpath\@@exfile\donothing\donothing
- \stopreadingfile
- \popendofline
- \@@eftrace{\ifcase\figurestatus not \fi found}%
-}%
+ \doifsomething\@@efcurrentpath
+ {\assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname
+ \edef\@@effilenametype{\@@effilename.\figureextension{\@@efcurrenttype}}%
+ \@@eftrace{analyzing \@@efloadname\space on \@@efcurrentpath\space for \@@effilenametype}%
+ \pushendofline
+ \startreadingfile
+ \let\presetfigure\presetfigureC
+ \readsetfile\@@efcurrentpath\@@exfile\donothing\donothing
+ \stopreadingfile
+ \popendofline
+ \@@eftrace{\ifcase\figurestatus not \fi found}}%
\fi\fi\fi}
\def\presetfigureC[#1][#2]%
@@ -514,7 +534,7 @@
\@EA\DOIF\@EA{\@@effilenametype}{#1}
{\getparameters[\??ep][#2]%
\doif\@@epe\@@efcurrenttype
- {\chardef\figurestatus4
+ {\chardef\figurestatus\plusfour
\let\@@eftype\@@efcurrenttype
\let\@@effullname\@@efcurrentfile}}%
\else
@@ -526,18 +546,16 @@
\def\doanalyzefigurefilesC
{\ifconsultutilityfile\ifcase\figurestatus\ifcase\figurefilemode\else
-\doifsomething\@@efcurrentpath
-{%
- \assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname
- \@@eftrace{analyzing \@@efloadname\space on \@@efcurrentpath\space for \@@effilename.* surrogate}%
- \pushendofline
- \startreadingfile
- \let\presetfigure\presetfigureD
- \readsetfile\@@efcurrentpath\@@exfile\donothing\donothing
- \stopreadingfile
- \popendofline
- \@@eftrace{\ifcase\figurestatus not \fi found}%
-}%
+ \doifsomething\@@efcurrentpath
+ {\assignfullfilename\@@efcurrentpath\@@exfile\to\@@efloadname
+ \@@eftrace{analyzing \@@efloadname\space on \@@efcurrentpath\space for \@@effilename.* surrogate}%
+ \pushendofline
+ \startreadingfile
+ \let\presetfigure\presetfigureD
+ \readsetfile\@@efcurrentpath\@@exfile\donothing\donothing
+ \stopreadingfile
+ \popendofline
+ \@@eftrace{\ifcase\figurestatus not \fi found}}%
\fi\fi\fi}
\def\presetfigureD[#1][#2]%
@@ -617,7 +635,11 @@
{\global\fighei\@@efheight}%
\doifsomething\@@efscale
{\figxsca\@@efscale
- \figysca\@@efscale}}
+ \figysca\@@efscale}%
+ \doifsomething\@@efxscale
+ {\figxsca\@@efxscale}%
+ \doifsomething\@@efyscale
+ {\figxsca\@@efyscale}}
\def\setfactorfiguresize
{\doifinsetelse\@@effactor{\v!max,\v!fit,\v!broad}
@@ -655,9 +677,9 @@
\fi}
\def\setscalefiguresize
- {\doifsomething\@@efscale
- {\doapplyfigurescale\figwid\@@epw\figxsca
- \doapplyfigurescale\fighei\@@eph\figysca
+ {\doifsomething{\@@efscale\@@efxscale\@@efxscale}
+ {\doapplyfigurescale\figwid\@@epw\figxsca\@@efxscale
+ \doapplyfigurescale\fighei\@@eph\figysca\@@efyscale
\global\figwid\zeropoint
\global\fighei\zeropoint
\doifelsenothing\@@efmaxwidth
@@ -700,8 +722,8 @@
{\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
\else
\dosetdimensionfiguresize
- {\doapplyfigurescale\figwid\@@epw\figxsca
- \doapplyfigurescale\fighei\@@eph\figysca}%
+ {\doapplyfigurescale\figwid\@@epw\figxsca\@@efxscale
+ \doapplyfigurescale\fighei\@@eph\figysca\@@efyscale}%
{\docalculatefigurescales\figwid\@@epw\fighei\@@eph}%
{\docalculatefigurescales\fighei\@@eph\figwid\@@epw}%
\fi
@@ -821,13 +843,29 @@
\divide\dimen0 \dimen2
#3=\dimen0 } % #3 = schaal
- \def\doapplyfigurescale#1#2#3%
+% \def\doapplyfigurescale#1#2#3%
+% {\global#1=#2\relax
+% \ifcase0\@@efscale\relax % beter: doifnum...
+% #3=\plusthousand
+% \else
+% #3=\@@efscale
+% \fi\relax % important !
+% \ifnum#3=\plusthousand\else
+% \global\divide #1 \plusthousand
+% \global\multiply#1 #3\relax
+% \fi}
+
+ \def\doapplyfigurescale#1#2#3#4%
{\global#1=#2\relax
- \ifcase0\@@efscale\relax % beter: doifnum...
- #3=\plusthousand
+ \ifcase0#4\relax % @@ef.scale kan empty zijn
+ \ifcase0\@@efscale\relax % @@efscale kan empty zijn
+ #3=\plusthousand
+ \else
+ #3=\@@efscale
+ \fi
\else
- #3=\@@efscale
- \fi\relax % important !
+ #3=#4%
+ \fi
\ifnum#3=\plusthousand\else
\global\divide #1 \plusthousand
\global\multiply#1 #3\relax
@@ -839,6 +877,8 @@
\beginETEX \dimexpr
+ % todo: use \relax instead of ()
+
\def\docalculatefigurescales#1#2#3#4%
{\scratchdimen\dimexpr(#1/\dimexpr(#2/\plusthousand))%
\figxsca\scratchdimen
@@ -848,14 +888,28 @@
\def\docalculatefigurescale#1#2#3%
{#3\dimexpr(#1/\dimexpr(#2/\plusthousand))}
- \def\doapplyfigurescale#1#2#3%
- {% #3=\ifnum0\number\@@efscale=\zerocount\plusthousand\else\@@efscale\fi
- \ifcase0\@@efscale\relax % @@efschaal kan empty zijn
- #3=\plusthousand
+% \def\doapplyfigurescale#1#2#3%
+% {% #3=\ifnum0\number\@@efscale=\zerocount\plusthousand\else\@@efscale\fi
+% \ifcase0\@@efscale\relax % @@efscale kan empty zijn
+% #3=\plusthousand
+% \else
+% #3=\@@efscale
+% \fi\relax % important !
+% \global#1\ifnum#3=\plusthousand#2\else\dimexpr(#3\dimexpr(#2/\plusthousand))\fi
+% \relax}
+
+ \def\doapplyfigurescale#1#2#3#4% todo: also #5 being sx/sy (\ifdim0#5=0pt ...)
+ {\ifcase0#4\relax % @@ef.scale kan empty zijn
+ \ifcase0\@@efscale\relax % @@efscale kan empty zijn
+ #3=\plusthousand
+ \else
+ #3=\@@efscale
+ \fi
\else
- #3=\@@efscale
- \fi\relax % important !
- \global#1\ifnum#3=\plusthousand#2\else\dimexpr(#3\dimexpr(#2/\plusthousand))\fi
+ #3=#4%
+ \fi
+ \relax % important !
+ \global#1\ifnum#3=\plusthousand#2\else\dimexpr#3\dimexpr#2/\plusthousand\relax\relax\fi
\relax}
\endETEX
@@ -1031,7 +1085,7 @@
\getparameters
[\??ep]
[\c!e=\s!unknown,
- %\c!w=15\korpsgrootte,\c!h=10\korpsgrootte,
+ %\c!w=15\bodyfontsize,\c!h=10\bodyfontsize,
\c!w=8\lineheight,\c!h=6\lineheight,
\c!x=\!!zeropoint,\c!y=\!!zeropoint,
\c!t=,\c!s=,\c!a=,\c!f=\@@effilename]%
@@ -1041,7 +1095,7 @@
\c!object=\@@exobject,\c!preset=\v!yes,\c!split=,\c!size=,
\c!page=0,\c!controls=\v!no,\c!preview=\v!no,\c!repeat=\v!no,
\c!maxwidth=\@@exmaxwidth,\c!maxheight=\@@exmaxheight,
- \c!scale=,\c!width=,\c!height=,\c!display=,\c!lines=,\c!grid=,
+ \c!scale=,\c!xscale=,\c!yscale=,\c!width=,\c!height=,\c!display=,\c!lines=,\c!grid=,
%\c!foregroundcolor=,
\c!color=,\c!conversion=\@@exconversion,\c!prefix=\@@exprefix,\c!cache=\@@excache,
\c!factor=,\c!hfactor=,\c!wfactor=]%
@@ -1105,8 +1159,8 @@
{\let\@@eftype\c!mps}
{\processaction
[\@@effiletype]
- [ \c!tex=>\let\@@eftype\c!tex,
- \c!tmp=>\let\@@eftype\c!tex
+ [ \c!tex=>\let\@@eftype\c!tex, % check
+ \c!tmp=>\let\@@eftype\c!tex % check
\edef\@@effilepref{\bufferprefix}%
\edef\@@effilename{\@@effilepref\@@effilename},
% todo: nop when conversion
@@ -1120,7 +1174,7 @@
% up in files, therefore:
\let\@@efobject\v!no
\fi
- \edef\@@efobjectname{\@@effilename-\@@eftype-\@@effiletype-\@@efpage}%
+ \edef\@@efobjectname{\@@effilename-\@@eftype-\@@effiletype-\@@efpage}% will be configurable
\doifelse\@@efobject\v!no
\donefalse
{\doifspecialavailableelse\dostartscaling
@@ -1167,19 +1221,19 @@
\edef\@@effullname{\@@effilename.\@@effiletype}%
\def\figureextension##1{\@@effiletype}%
\fi}%
-% begin prelocate to be converted image
-\let\@@efconversionpath\empty
-\let\@@efconversionfile\@@effilename
-\let\@@efconversiontype\@@effiletype
-\doifmodeelse{\systemmodeprefix\v!first}
- {\doifelsenothing\@@efconversion\donefalse\donetrue}%
- {\donefalse}%
-\ifdone
- \chardef\figurestatus\zerocount
- \locatefigureconversionfile
- \chardef\figurestatus\zerocount
-\fi
-% end
+ % begin prelocate to be converted image
+ \let\@@efconversionpath\empty
+ \let\@@efconversionfile\@@effilename
+ \let\@@efconversiontype\@@effiletype
+ \doifmodeelse{\systemmodeprefix\v!first}
+ {\doifelsenothing\@@efconversion\donefalse\donetrue}%
+ {\donefalse}%
+ \ifdone
+ \chardef\figurestatus\zerocount
+ \locatefigureconversionfile
+ \chardef\figurestatus\zerocount
+ \fi
+ % end
\doifelse\@@efpreset\v!no
{\doifelse\@@eftype\s!unknown
{\chardef\figurestatus\zerocount
@@ -1333,7 +1387,7 @@
\fi
\xdef\figurewidth {\the\figwid}%
\xdef\figureheight{\the\fighei}%
- \global\setbox\foundexternalfigure\vbox to \fighei
+ \global\setbox\foundexternalfigure\naturalvbox to \fighei
{\vfill
\hsize\figwid
\ifdone
@@ -1436,7 +1490,7 @@
\box\foundexternalfigure
\fi\fi\fi
\else
- \feedbackexternalfigure
+ \iftrialtypesetting \else \feedbackexternalfigure \fi
\settrue\externalfigurelevel
\ifskipexternalfigures
\externalfigurereplacement\figurelabel\figurefullname{skipped}%
@@ -1469,7 +1523,8 @@
\fi\fi\fi
\fi
\else
- \feedbackexternalfigure % maybe also; \the\externalfigurepostprocessors
+ % maybe also \the\externalfigurepostprocessors
+ \iftrialtypesetting \else \feedbackexternalfigure \fi
\fi}%
\globalpopmacro\figurefilecache
\globalpopmacro\figurefilepath
@@ -2145,6 +2200,24 @@
\egroup}%
\hbox}
+%D \startbuffer
+%D \startuseMPgraphic{test}
+%D path p ; p := fullcircle scaled 4cm ;
+%D draw p withpen pencircle scaled 1cm ;
+%D setbounds currentpicture to boundingbox p ;
+%D \stopuseMPgraphic
+%D
+%D \hbox to \hsize \bgroup
+%D \hss
+%D \ruledhbox{\useMPgraphic{test}}%
+%D \hss
+%D \ruledhbox{\clip{\useMPgraphic{test}}}%
+%D \hss
+%D \egroup
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
\def\clip{\dosingleempty\doclip}
\def\setupclipping
@@ -2251,10 +2324,10 @@
\c!reset=\v!no,
\c!maxwidth=\@@efwidth,
\c!maxheight=\@@efheight,
- \c!bodyfont=\korpsgrootte,
+ \c!bodyfont=\bodyfontsize,
\c!directory=,
\c!file=\f!utilityfilename.\f!figureextension,
- \c!radius=.5\korpsgrootte,
+ \c!radius=.5\bodyfontsize,
\c!corner=\v!rectangular,
\c!frame=\v!off,
\c!background=, % new
diff --git a/Master/texmf-dist/tex/context/base/core-fil.tex b/Master/texmf-dist/tex/context/base/core-fil.tex
index 5820798cdc5..c3a7c52d1a5 100644
--- a/Master/texmf-dist/tex/context/base/core-fil.tex
+++ b/Master/texmf-dist/tex/context/base/core-fil.tex
@@ -41,7 +41,7 @@
\startmessages italian library: files
title: file
- 1: sinonimo file -- gi in uso per --
+ 1: sinonimo file -- già in uso per --
\stopmessages
\startmessages norwegian library: files
@@ -54,6 +54,26 @@
1: sinonimul fisierelor -- este folosit deja pentru --
\stopmessages
+\startmessages french library: files
+ title: fichiers
+ 1: le synonyme de fichier -- est déjà utilisé pour --
+\stopmessages
+
+%D Files registered as temporary files will be deleted after a
+%D run by texexec:
+
+% \starttext
+% \immediate\openout\scratchwrite=oeps.tmp
+% \immediate\write\scratchwrite{oeps}
+% \immediate\closeout\scratchwrite
+% \registertempfile{oeps.tmp}
+% \typefile{oeps.tmp}
+% \stoptext
+
+\let\usedtempfile\gobbleoneargument
+
+\def\registertempfile#1{\immediatewriteutility{f t {#1}}}
+
%D \macros
%D {definefilesynonym}
%D
@@ -158,9 +178,9 @@
\ifconditional\moduleisloaded % sometimes (see xtag-map)
\let\next\relax % or: \expandafter\gobbleoneargument
\else
- \makeshortfilename[#1\truefilename{#2}]%
+ \makeshortfilename[#1\truefilename{#2}]% beware: *- is not part of syn
\doifelseflagged\shortfilename
- {\showmessage\m!systems7{#2}%
+ {\showmessage\m!systems7{#2 (line \number\inputlineno)}%
\settrue\moduleisloaded
\let\next\relax}
{\doglobal\setflag\shortfilename
@@ -187,22 +207,112 @@
\showmessage\m!systems6{#2}%
\fi}
-\def\dousemodules[#1][#2]%
- {\ifsecondargument
+% \def\usemodules
+% {\dodoubleempty\dousemodules}
+%
+% \def\dousemodules[#1][#2]%
+% {\ifsecondargument
+% \doifelsenothing{#2}
+% {\let\next\relax}
+% {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}%
+% \else
+% \def\next{\usemodules[][#1]}%
+% \fi
+% \next}
+%
+% \let\usemodule\usemodules
+
+\def\usemodules
+ {\dotripleempty\dousemodules}
+
+\def\dousemodules[#1][#2][#3]%
+ {\pushmacro\currentmodule
+ \pushmacro\currentmoduleparameters
+ \let\currentmoduleparameters\empty
+ \ifthirdargument
+ \doifelsenothing{#2}
+ {\let\next\relax}
+ {\def\currentmoduleparameters{#3}%
+ \def\next{\processcommalist[#2]{\dodousemodules{#1}}}}%
+ \else\ifsecondargument
\doifelsenothing{#2}
{\let\next\relax}
- {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}%
+ {\doifassignmentelse{#2}
+ {\def\currentmoduleparameters{#2}%
+ \def\next{\processcommalist[#1]{\dodousemodules{}}}}
+ {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}}%
\else
- \def\next{\usemodules[][#1]}%
+ \def\next{\processcommalist[#1]{\dodousemodules{}}}%
+ \fi\fi
+ \next
+ \popmacro\currentmoduleparameters
+ \popmacro\currentmodule}
+
+\let\currentmoduleparameters\empty
+\let\currentmodule \s!unknown
+
+\def\startmodule
+ {\doifnextcharelse[\dostartmodule\nostartmodule}
+
+\def\nostartmodule #1 %
+ {\dostartmodule[#1]}
+
+\def\dostartmodule[#1]%
+ {\pushmacro\currentmodule
+ \pushmacro\currentmoduleparameters
+ \def\currentmodule{#1}}
+
+\def\stopmodule
+ {\popmacro\currentmoduleparameters
+ \popmacro\currentmodule}
+
+\def\setupmodule
+ {\dodoubleempty\dosetupmodule}
+
+\def\dosetupmodule[#1][#2]%
+ {\scratchtoks\expandafter{\currentmoduleparameters}%
+ \ifsecondargument
+ \getparameters[\??md:#1:][#2]%
+ \expanded{\getparameters[\??md:#1:][\the\scratchtoks]}%
+ \else
+ \getparameters[\??md:\currentmodule:][#1]%
+ \expanded{\getparameters[\??md:\currentmodule:][\the\scratchtoks]}%
\fi
- \next}
+ \let\currentmoduleparameters\empty}
-\def\usemodules
- {\dodoubleempty\dousemodules}
+\def\moduleparameter #1#2{\executeifdefined{\??md:#1:#2}\s!empty}
+\def\currentmoduleparameter#1{\executeifdefined{\??md:\currentmodule:#1}\s!empty}
-\let\usemodule\usemodules
+% \usemodule[newmml]
+% \usemodule[newmml][a=b]
+% \usemodule[x][newmml]
+% \usemodule[x][newmml][a=b]
+%
+% \startmodule [mathml]
+% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars will be set afterwards
+% \setupmodule[a=c] \relax [\currentmoduleparameter{a}] % user vars are now forgotten
+% \stopmodule
-% \usemodule[t][speech]
+% one can introduce test sections with:
+%
+% \enablemode[newmml:test:\currentmoduleparameter{test}]
+% \startmode[newmml:test:yes} ... \stopmode
+%
+% these will be ignored unless test=yes
+%
+% however, a better way is:
+
+\let\stopmoduletestsection\donothing
+
+\def\startmoduletestsection
+ {\bgroup
+ \setupmodule % we need to make sure that the vars are set
+ \doifelse{\currentmoduleparameter\v!test}\v!yes
+ {\egroup
+ \writestatus{\currentmodule}{loading experimental code}}
+ {\egroup
+ \writestatus{\currentmodule}{skipping experimental code}%
+ \gobbleuntil\stopmoduletestsection}}
%D We also support a singular call, which saves us for
%D frustrations when we do a typo.
diff --git a/Master/texmf-dist/tex/context/base/core-fld.tex b/Master/texmf-dist/tex/context/base/core-fld.tex
index 5f03d699ed6..4262bbdd210 100644
--- a/Master/texmf-dist/tex/context/base/core-fld.tex
+++ b/Master/texmf-dist/tex/context/base/core-fld.tex
@@ -28,6 +28,19 @@
\unprotect
+%D First we hook fields into the (viewer based) layering mechanism
+%D (implemented as properties).
+
+\ifx\currentlayerproperty\undefined\else \let\currentlayerproperty\empty\fi
+
+\appendtoks
+ \doif\@@iafieldlayer\v!auto
+ {\def\@@iafieldlayer{\currentlayerproperty}}%
+\to \everysetupinteraction
+
+\setupinteraction
+ [\c!fieldlayer=\v!auto] % auto by default
+
%D Internal command, linked to \type{\definesymbol}.
\def\dogetfieldsymbol#1%
@@ -93,7 +106,6 @@
\@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
\@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
\def\presettextfield
{\preparefieldvariables
\dopresettextfield
@@ -771,7 +783,7 @@
{\setvalue{\strippedcsname\setupfield##1}{\dosetupfield[##1][#1,##2][#2,##3][#3,##4][#4,##5]}}}%
\else\iffirstargument
\doifelse{#1}\v!reset
- {\let\dodosetupfield\normaldodosetupfield}
+ {\resetfields}
{\setupfields[][][][#1]}% checken
\else
\writestatus\m!fields{provide either 1 or 4 arguments}%
@@ -780,6 +792,11 @@
\def\setupfields
{\doquadrupleempty\dosetupfields}
+\def\resetfields
+ {\let\dodosetupfield\normaldodosetupfield}
+
+% \setupfields[\v!reset]
+
% opties: veld, label, kader, vertikaal/horizontaal
\newif\ifShowFieldLabel
@@ -798,8 +815,8 @@
\HorizontalFieldfalse\VerticalFieldfalse,
\v!label=>\ShowFieldLabeltrue,
\v!frame=>\ShowFieldFrametrue,
- \v!horizontal=>\HorizontalFieldtrue,
- \v!vertical=>\VerticalFieldtrue]%
+ \v!horizontal=>\HorizontalFieldtrue,
+ \v!vertical=>\VerticalFieldtrue]%
\ifVerticalField
\getparameters[\??fd]
[\c!distance=\!!zeropoint,\c!inbetween=\vskip\@@localoffset,
@@ -846,7 +863,7 @@
\c!afterkey=,\c!format=,\c!validate=,\c!calculate=,
\c!focusin=,\c!focusout=,
\c!fieldoffset=\!!zeropoint,\c!fieldbackgroundcolor=,
- \c!fieldframecolor=,\c!fieldlayer=,#5]%
+ \c!fieldframecolor=,\c!fieldlayer=\@@iafieldlayer,#5]%
\scratchdimen\framedwidth \edef\@@DriverFieldWidth {\the\scratchdimen}%
\scratchdimen\framedheight\edef\@@DriverFieldHeight{\the\scratchdimen}%
\vfill
@@ -887,7 +904,7 @@
\c!focusin=,\c!focusout=,
\c!afterkey=,\c!format=,\c!validate=,\c!calculate=,
\c!fieldoffset=\!!zeropoint,\c!fieldbackgroundcolor=,
- \c!fieldframecolor=,\c!fieldlayer=,#5,\c!align=]
+ \c!fieldframecolor=,\c!fieldlayer=\@@iafieldlayer,#5,\c!align=]
{\dogetcommacommandelement1\from\@@DriverFieldValues\to\@@DriverFieldValue
\ifx\@@DriverFieldValue\empty
\let\@@DriverFieldValue\@@DriverFieldDefault
@@ -995,7 +1012,8 @@
[\c!frame=\v!off,
\c!option=,
\c!regionin=JS(Vide_Field{\currentsystemfield:txt}),
- \c!regionout=JS(Hide_Field{\currentsystemfield:txt})]%
+ \c!regionout=JS(Hide_Field{\currentsystemfield:txt}),
+ \c!fieldlayer=\@@iafieldlayer]%
\lower2ex\hbox to \zeropoint
{\fitfield[\currentsystemfield:but]}%
#2}%
@@ -1004,7 +1022,7 @@
%D And one more:
-\def\definefieldstack%
+\def\definefieldstack
{\dotripleargument\dodefinefieldstack}
\def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings
diff --git a/Master/texmf-dist/tex/context/base/core-fnt.tex b/Master/texmf-dist/tex/context/base/core-fnt.tex
index 6a55849f454..dc6b8153d03 100644
--- a/Master/texmf-dist/tex/context/base/core-fnt.tex
+++ b/Master/texmf-dist/tex/context/base/core-fnt.tex
@@ -149,6 +149,11 @@
\def\cap{\mathortext\normalcap\smallcapped}
\def\Cap{\mathortext\normalCap\SmallCapped}
+\appendtoks
+ \let\cap\firstofoneargument
+ \let\Cap\firstofoneargument
+\to \simplifiedcommands
+
%D \macros
%D {setupcapitals}
%D
diff --git a/Master/texmf-dist/tex/context/base/core-ini.tex b/Master/texmf-dist/tex/context/base/core-ini.tex
index a63b0c74ee9..4f6e9fe1d87 100644
--- a/Master/texmf-dist/tex/context/base/core-ini.tex
+++ b/Master/texmf-dist/tex/context/base/core-ini.tex
@@ -36,7 +36,7 @@
\appendtoks \registerparoptions \to \everypar
\appendtoks \flushsyncpositions \to \everypar
\appendtoks \flushpostponednodedata \to \everypar
-\appendtoks \dohandlespeech \to \everypar
+\appendtoks \dohandlerepeatdelimitedtext \to \everypar
\appendtoks \insertparagraphintro \to \everypar
\appendtoks \flushpostponedbookmark \to \neverypar
diff --git a/Master/texmf-dist/tex/context/base/core-int.tex b/Master/texmf-dist/tex/context/base/core-int.tex
index 44d4fa7789b..b4bcd4c5f86 100644
--- a/Master/texmf-dist/tex/context/base/core-int.tex
+++ b/Master/texmf-dist/tex/context/base/core-int.tex
@@ -89,6 +89,16 @@
6: attachment file -- does not exist
\stopmessages
+\startmessages french library: interactions
+ title: interaction
+ 1: ratio d'aspect -- x -- (b x h)
+ 2: actif
+ 3: inactif
+ 4: pas de synchronisation de page (--) dans le hmode
+ 5: le fichier joint -- est inconnu
+ 6: le fichier joint -- n'existe pas
+\stopmessages
+
\startmessages dutch library: versions
title: versie
1: er mankeert een @+
@@ -138,6 +148,13 @@
3: pagini selectate: --
\stopmessages
+\startmessages french library: versions
+ title: version
+ 1: @+ manquant
+ 2: marquage des pages
+ 3: pages sélectionnées : --
+\stopmessages
+
\unprotect
\definesystemconstant {link}
@@ -334,17 +351,16 @@
\@EA\processcommalist\@EA[\!!stringa]\doprepareidentity
\global\let\doprepareidentity\relax}
-\def\doinitializeidentity#1%
- {%\iflocation
- \doprepareidentity
- \dosetupidentity % no \expanded{..} will be done in special (else no pdfdoc)
- {\@@iatitle}{\@@iasubtitle}{\@@iaauthor}{#1}%
- {\@@iadate}{\@@iakeyword}%
- \global\let\initializeidentity\relax
- }%\fi}
+%D The Creator field is changed per 12/04/2006 due to user presure. This
+%D means that I need to put my own status info someplace else.
-\def\initializeidentity % not to be changed !
- {\doinitializeidentity{ConTeXt/user/\jobname.tex}}
+\def\initializeidentity
+ {\doprepareidentity
+ \dosetupidentity % no \expanded{..} will be done in special (else no pdfdoc)
+ {\@@iatitle}{\@@iasubtitle}{\@@iaauthor}%
+ {ConTeXt - \contextversion}%
+ {\@@iadate}{\@@iakeyword}%
+ \global\let\initializeidentity\relax}
\appendtoks \initializeidentity \to \everyshipout
@@ -491,7 +507,9 @@
\iffirstargument
\bgroup
\ifsecondargument
- \edef\openbookmarklist{#2}%
+ \doifelse{#2}\v!all
+ {\edef\openbookmarklist{#1}}
+ {\edef\openbookmarklist{#2}}%
\else
\let\openbookmarklist\empty
\fi
diff --git a/Master/texmf-dist/tex/context/base/core-itm.tex b/Master/texmf-dist/tex/context/base/core-itm.tex
index 976daf129c6..d495011f1b2 100644
--- a/Master/texmf-dist/tex/context/base/core-itm.tex
+++ b/Master/texmf-dist/tex/context/base/core-itm.tex
@@ -33,33 +33,38 @@
\stopmessages
\startmessages italian library: layouts
- 9: attualmente non pi di -- livelli di elencazione
+ 9: attualmente non più di -- livelli di elencazione
\stopmessages
\startmessages norwegian library: layouts
- 9: for yeblikket maksimalt -- niver i opplisting
+ 9: for øyeblikket maksimalt -- nivåer i opplisting
\stopmessages
\startmessages romanian library: layouts
9: acum nu se supota mai mult de -- nivele de adancime la iteratii
\stopmessages
+\startmessages french library: layouts
+ 9: pas plus de -- niveaux pour l'instant dans les élémentarisations
+\stopmessages
+
\unprotect
% - instellingen in macro
% - [0] voor start op 0
% - start=2
-\newif\ifsubitem \subitemfalse
-\newif\ifsymbolitem \symbolitemfalse
-\newif\ifheaditem \headitemfalse
-\newif\ifitemintro \itemintrofalse
-\newif\ifautoitemintro \autoitemintrofalse
-\newif\ifoptimizeitems \optimizeitemstrue
-\newif\ifpackeditems \packeditemsfalse
-\newif\iffirstlist \firstlistfalse
-\newif\ifparagraphitems \paragraphitemsfalse
-\newif\iftextitems \textitemsfalse
+\newconditional\sublistitem \setfalse\sublistitem
+\newconditional\symbollistitem \setfalse\symbollistitem
+\newconditional\headlistitem \setfalse\headlistitem
+\newconditional\introlistitem \setfalse\introlistitem
+\newconditional\randomizeitems \setfalse\randomizeitems
+\newconditional\autointrolistitem \setfalse\autointrolistitem
+\newconditional\optimizelistitem \settrue \optimizelistitem
+\newconditional\packlistitem \setfalse\packlistitem
+\newconditional\paragraphlistitem \setfalse\paragraphlistitem
+\newconditional\textlistitem \setfalse\textlistitem
+\newconditional\firstlistitem \setfalse\firstlistitem
\newcounter\noflists
\newcounter\itemlevel
@@ -75,9 +80,19 @@
% #1=level #2=parameter
\def\getitemparameter #1#2{\csname\??op\currentitemgroup#1#2\endcsname}
-\def\setitemparameter #1#2{\@EA\def\csname\??op\currentitemgroup#1#2\endcsname}
+\def\setitemparameter #1#2{\@EA\def\csname\??op\currentitemgroup#1#2\endcsname} % #3 -> {#3}
\def\letitemparameter #1#2{\@EA\let\csname\??op\currentitemgroup#1#2\endcsname}
+% test this: saves hash entries and is also faster
+%
+% \let\doinitializeitemgrouplevel\gobbleoneargument % todo ! ! !
+
+\def\getitemparameter#1#2%
+ {\executeifdefined{\??op\currentitemgroup#1#2}%
+ {\executeifdefined{\??op\currentitemgroup #2}%
+ {\executeifdefined{\??oo #2}%
+ {}}}}
+
\def\doitemattributes #1{\doattributes{\??op\currentitemgroup#1}}
\def\@@globalitemsymbol #1{\??op\currentitemgroup\c!symbol\s!global#1}
@@ -86,11 +101,11 @@
\def\@@itemcounter{\s!itemcount\currentitemgroup}
-% \def\doitembreak#1{\iftextitems\else\dosomebreak#1\fi}
+% \def\doitembreak#1{\ifconditional\textlistitem\else\dosomebreak#1\fi}
%
% s-pre-61 / pre-dis, test extensively, 2004/5
-\def\doitembreak#1{\ifoptimizeitems\iftextitems\else\dosomebreak#1\fi\fi}
+\def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else\dosomebreak#1\fi\fi}
\def\dolistreference
{\immediatewriteutilitycommand
@@ -120,7 +135,8 @@
\c!beforehead,\c!afterhead,\c!before,\c!inbetween,\c!after,
\c!stopper,\c!placestopper,\c!indenting,
\c!n,\c!inner,\c!symbol,\c!margin,\c!items,
- \c!leftmargin,\c!rightmargin,
+ \c!leftmargin,\c!rightmargin,\c!indentnext,
+ \c!command,
\c!start,\c!lefttext,\c!righttext]}
\def\setupitemgroups
@@ -145,7 +161,7 @@
{\expandafter\doitemreference\itemreferences,,\\}
\def\packitems
- {\ifcase\itemlevel \else \packeditemstrue \fi}
+ {\ifcase\itemlevel \else \settrue\packlistitem \fi}
\def\dosetupitemgroupvariable[#1]% [#2]% niveau instellingen
{\doifelsenothing{#1}
@@ -158,12 +174,13 @@
{\processaction
[#2#3#4]
[ \v!packed*=>\packitems,
- \v!intro*=>\itemintrotrue,
- \v!autointro*=>\autoitemintrotrue,
+ \v!intro*=>\settrue\introlistitem, % here? not set to false
+% no: \v!random*=>\settrue\randomizeitems,% here? not set to false
+ \v!autointro*=>\settrue\autointrolistitem,
\v!broad*=>\setitemparameter{#1}\c!factor{1},
#2#3*\v!broad*=>\setitemparameter{#1}\c!factor{#2#3},
#2*\v!broad*=>\setitemparameter{#1}\c!factor{#2},
- \v!text*=>\textitemstrue
+ \v!text*=>\settrue\textlistitem
\settrue\inlinelistitem
\dosetuppackeditemgroup{#1}%
\packitems,
@@ -172,16 +189,16 @@
\v!inmargin*=>\setitemparameter{#1}\c!width{-2em}, % signal
\v!atmargin*=>\doifnot{#1}{1}{\setitemparameter{#1}\c!width{0em}}, % signal
\v!intext*=>\settrue\inlinelistitem, % new
- \v!loose*=>\optimizeitemsfalse,
- \v!paragraph*=>\paragraphitemstrue
+ \v!loose*=>\setfalse\optimizelistitem,
+ \v!paragraph*=>\settrue\paragraphlistitem
\packitems,
\v!joinedup*=>\dosetuppackeditemgroup{#1}%
\packitems,
\v!serried*=>\setitemparameter{#1}\c!factor{-1},
#2#3*\v!serried*=>\setitemparameter{#1}\c!factor{-#2#3},
#2*\v!serried*=>\setitemparameter{#1}\c!factor{-#2},
- \v!stopper*=>\setitemparameter{#1}\c!placestopper\v!yes,
- \v!unpacked*=>\packeditemsfalse,
+ \v!stopper*=>\setitemparameter{#1}\c!placestopper{\v!yes}, % keep {}
+ \v!unpacked*=>\setfalse\packlistitem,
\v!repeat*=>\settrue\repeatlistitem, % new
\v!standard*=>\dosetupstandarditemgroup{#1}]}
@@ -205,21 +222,11 @@
\letitemparameter{#1}\c!after \empty
\letitemparameter{#1}\c!inbetween \empty}
-% \def\dosetupitemgroupconstant[#1][#2]%
-% {\def\dodosetupitemgroupconstant##1%
-% {\dododosetupitemgroupconstant[#1][##1*]}%
-% \processcommacommand[#2]\dodosetupitemgroupconstant} % expansion of #2 is handy for xml
-
\def\dosetupitemgroupconstant[#1][#2]%
{\def\dodosetupitemgroupconstant##1% catches empty in [a,b,] handy for xml
{\doifsomething{##1}{\dododosetupitemgroupconstant[#1][##1*]}}%
\processcommacommand[#2]\dodosetupitemgroupconstant} % expansion of #2 is handy for xml
-%\def\dododododosetupitemgroup[#1][#2]%
-% {\doifassignmentelse{#2}
-% {\dosetupitemgroupvariable[#1][#2]}
-% {\setitemparameter{#1}\empty{\dosetupitemgroupconstant[#1][#2]}}}%
-
\def\dododododosetupitemgroup[#1][#2]%
{\doifassignmentelse{#2}%
{\dosetupitemgroupvariable[#1][#2]}%
@@ -258,25 +265,13 @@
{\doquadrupleempty\dosetupitemgroup}
\def\doadvanceitem
- {\ifsubitem\else\ifsymbolitem\else
+ {\ifconditional\sublistitem\else\ifconditional\symbollistitem\else
\pluscounter{\@@itemcounter\itemlevel}%
\fi\fi}
-% \def\setitemlevel#1%
-% {\ifnum\itemlevel>0\relax
-% \firstlisttrue
-% \doifnotinset\v!verder{#1}
-% {\resetcounter{\@@itemcounter\itemlevel}}%
-% \def\tempnumber%
-% {\countervalue{\@@itemcounter\itemlevel}}%
-% \doifelse{\getitemparameter\itemlevel\c!plaatsafsluiter}\v!ja
-% {\def\tempsymbol{\getitemparameter\itemlevel\c!afsluiter}}
-% {\let\tempsymbol\empty}%
-% \fi}
-
\def\setitemlevel#1%
{\ifnum\itemlevel>\zerocount
- \firstlisttrue
+ \settrue\firstlistitem
\doifnotinset\v!continue{#1}
{\doifinset{0}{#1}{\setitemparameter\itemlevel\c!start{0}}%
\doifsomething{\getitemparameter\itemlevel\c!start}
@@ -306,16 +301,16 @@
\setxvalue{\@@globalitemsymbol\itemlevel}{\currentitemsymbol}%
\setgvalue{\@@localitemsymbol \itemlevel}%
{\convertnumber{\currentitemsymbol}{\countervalue{\@@itemcounter\itemlevel}}}%
- \iftextitems
+ \ifconditional\textlistitem
\doifsomething{\getitemparameter\itemlevel\c!lefttext}
{\let\tempsymbol\empty}%
\fi
\def\listitem
{\getitemparameter\itemlevel
- {\iftextitems\c!lefttext\else\c!left\fi}%
+ {\ifconditional\textlistitem\c!lefttext\else\c!left\fi}%
\getvalue{\@@localitemsymbol\itemlevel}\tempsymbol
\getitemparameter\itemlevel
- {\iftextitems\c!righttext\else\c!right\fi}}%
+ {\ifconditional\textlistitem\c!righttext\else\c!right\fi}}%
\let\@@opsymbol\empty}%\let\docommando\gobbleoneargument}
{}}}
@@ -368,73 +363,36 @@
\fi
\expanded{\redostartitemgroup[\itemgroupoptions]}}% [#2]
+\let\startcollectitems\relax
+\let\stopcollectitems \relax
+
\def\redostartitemgroup[#1][#2]%
{\setfalse\inlinelistitem % new, no indent (leftskip)
\setfalse\concatnextitem % new, concat
+ \setfalse\txtlistitem
\ifhmode
\ifconditional\autoconcatnextitem % new, concat
\ifdim\lastskip=\itemsignal % new, concat
\settrue\concatnextitem % new, concat
\fi % new, concat
\fi % new, concat
- \iftextitems\else\doifnotinset\v!text{#1}\par\fi % suboptimal
+ \ifconditional\textlistitem\else\doifnotinset\v!text{#1}\par\fi % suboptimal
\fi
\begingroup
- \ifnum\itemlevel=\plusone % NIEUW
- \doadaptleftskip {\getitemparameter1\c!margin}%
- \doadaptleftskip {\getitemparameter1\c!leftmargin}%
- \doadaptrightskip{\getitemparameter1\c!rightmargin}%
- \fi
- \dosetraggedcommand{\getitemparameter\itemlevel\c!align}\raggedcommand
- \doifsomething{\getitemparameter\itemlevel\c!indenting}
- {% is \expanded needed?
- \expanded{\setupindenting[\getitemparameter\itemlevel\c!indenting]}}%
- \doifinset\v!columns{#1}%
- {\ifinsidecolumns\else\ifnum\itemcolumndepth=\zerocount
- \globallet\itemcolumndepth\itemlevel
- \getitemparameter\itemlevel\c!before
- \processfirstactioninset
- [#1]
- [ \v!one=>\!!counta1\relax,
- \v!two=>\!!counta2\relax,
- \v!three=>\!!counta3\relax,
- \v!four=>\!!counta4\relax,
- \v!five=>\!!counta5\relax,
- \s!unknown=>\@EA\!!counta\getitemparameter\itemlevel\c!n]%
- % new
-% now handled in column routines
-% \edef\columneditemleftskip{\the\leftskip}%
-% \def\postprocesscolumnbox##1%
-% {\scratchdimen\columneditemleftskip
-% \divide\scratchdimen \nofcolumns
-% \hbox{\hskip\columneditemleftskip\hbox{\box##1}}}%
-% \scratchdimen-\columneditemleftskip
-% \multiply\scratchdimen \nofcolumns
-% \advance\scratchdimen \columneditemleftskip
-% \advance\scratchdimen \hsize
-% \edef\columntextwidth{\the\scratchdimen}%
-% \leftskip\zeropoint
- % so far
- \startcolumns
- [\c!n=\!!counta, % netter \??op\itemlevel\c!n
- \c!height=,
- \c!rule=\v!off,
- \c!balance=\v!yes,
- \c!align=\v!no]%
- \fi\fi}%
- \doifinsetelse\v!intro{#1}\itemintrotrue\itemintrofalse
+ \doifinsetelse\v!intro{#1}{\settrue\introlistitem}{\setfalse\introlistitem}%
+ \doifinsetelse\v!random{#1}{\settrue\randomizeitems}{\setfalse\randomizeitems}%
+ % == \doifinsetelse\v!intro{#1}\settrue\setfalse\introlistitem
\doglobal\increment\noflists
\let\currentlist\noflists
\newcounter\noflistelements
- \headitemfalse
- \subitemfalse
- \symbolitemfalse
+ \setfalse\headlistitem
+ \setfalse\sublistitem
+ \setfalse\symbollistitem
\let\marsymbol\relax
\globallet\somdestination\empty
\let\symsymbol\empty
\the\itemgroupcommands
- \setitemlevel{#1}%
- %\getitemparameter\itemlevel\empty
+ % \getitemparameter\itemlevel\empty
\let\listitem\empty % ** start value
\doifelsenothing{#1} % iffirstargument
{\edef\@@opsymbol{\getitemparameter\itemlevel\c!symbol}%
@@ -455,28 +413,60 @@
{\doifnot{##1}{0}{\setitemmark{##1}}}%
% \processcommalist[#1,\@@opsymbol]\docommando
\processcommalist[#1]\docommando}% ** preset sequence or provided sequence
+ % moved to here, after settings
+ \ifnum\itemlevel=\plusone % NIEUW
+ \doadaptleftskip {\getitemparameter1\c!margin}%
+ \doadaptleftskip {\getitemparameter1\c!leftmargin}%
+ \doadaptrightskip{\getitemparameter1\c!rightmargin}%
+ \fi
+ \dosetraggedcommand{\getitemparameter\itemlevel\c!align}\raggedcommand
+ \doifsomething{\getitemparameter\itemlevel\c!indenting}
+ {% is \expanded needed?
+ \expanded{\setupindenting[\getitemparameter\itemlevel\c!indenting]}}%
+ %
+ \setitemlevel{#1}% moved to here
\ifx\listitem\empty
\setitemmark\@@opsymbol % ** default value
\ifx\listitem\empty
\edef\currentitemsymbol{\itemlevel}% ** fall back
\fi
\fi
- \ifautoitemintro\ifnum\prevgraf<3
- \itemintrotrue
+ \ifconditional\autointrolistitem\ifnum\prevgraf<3
+ \settrue\introlistitem
\fi\fi
- \ifparagraphitems
+ \ifconditional\paragraphlistitem
\ifnum\itemlevel>\plusone
\letitemparameter\itemlevel\c!inbetween\empty
\fi
- \else\ifpackeditems
+ \else\ifconditional\packlistitem
\letitemparameter\itemlevel\c!inbetween\empty
\fi\fi
+ \doifinset\v!columns{#1}%
+ {\ifinsidecolumns\else\ifnum\itemcolumndepth=\zerocount
+ \globallet\itemcolumndepth\itemlevel
+ \getitemparameter\itemlevel\c!before
+ \processfirstactioninset
+ [#1]
+ [ \v!one=>\!!counta1\relax,
+ \v!two=>\!!counta2\relax,
+ \v!three=>\!!counta3\relax,
+ \v!four=>\!!counta4\relax,
+ \v!five=>\!!counta5\relax,
+ \s!unknown=>\@EA\!!counta\getitemparameter\itemlevel\c!n]%
+ \startcolumns
+ [\c!n=\!!counta, % netter \??op\itemlevel\c!n
+ \c!height=,
+ \c!rule=\v!off,
+ \c!balance=\v!yes,
+ \c!align=\v!no]%
+ \fi\fi}
\calculatelistwidth\itemlevel{\dimen0}%
\ifdim\dimen0>\zeropoint\relax
\ifconditional\inlinelistitem\else
\advance\leftskip \dimen0\relax
\fi
- \fi}
+ \fi
+ \startcollectitems}
% test / example
%
@@ -493,22 +483,25 @@
% \stopitemize \blank
\def\stopitemgroup
- {\iftextitems
+ {\stopcollectitems
+ \ifconditional\textlistitem
\removeunwantedspaces\space\ignorespaces
\else
\par
\fi
\ifnum\itemcolumndepth=\zerocount \dolistreference \fi % beware !
- \iffirstlist \else \endgroup \fi % toegevoegd, eerste \som opent groep
+ \ifconditional\firstlistitem \else \endgroup \fi % toegevoegd, eerste \som opent groep
\ifnum\itemcolumndepth=\itemlevel\relax
\stopcolumns
\doglobal\newcounter\itemcolumndepth
\getitemparameter\itemlevel\c!after
+ \dontrechecknextindentation
\else
\ifnum\itemlevel=\plusone
\doitembreak\allowbreak % toegevoegd
\getitemparameter1\c!after
- \dochecknextindentation\??oo
+ % was: \dochecknextindentation\??oo, is now:
+ \dochecknextindentation{\??op\currentitemgroup\itemlevel}%
\else
% nieuw, not yet nobreak handling
\ifcase\autoitemgroupspacing
@@ -516,13 +509,15 @@
\or
\getitemparameter\itemlevel\c!after
\fi
+ \dontrechecknextindentation
\fi
\fi
\endgroup
\doglobal\decrement(\itemlevel,\itemincrement)%
\egroup
% new needed in sidefloats (surfaced in volker's proceedings)
- \iftextitems\else\par\fi}
+ \ifconditional\textlistitem\else\par\fi
+ \dorechecknextindentation}
\newtoks\itemgroupcommands
@@ -537,11 +532,12 @@
{\itemgroupsymbol{\strut}\strut}
\def\itemgroupsubitem
- {\subitemtrue\itemgroupitem}
+ {\settrue\sublistitem
+ \itemgroupitem}
\def\itemgroupsymbol#1%
{\def\symsymbol{\doitemattributes\itemlevel\c!symstyle\c!symcolor{#1}}%
- \symbolitemtrue
+ \settrue\symbollistitem
\itemgroupitem}
\def\itemgroupedge#1%
@@ -551,7 +547,7 @@
{#1\hskip\getitemparameter\itemlevel\c!distance}}}
\def\itemgrouphead
- {\headitemtrue\doitemgrouphead}
+ {\settrue\headlistitem\doitemgrouphead}
\def\itemgroupitems
{\dosingleempty\doitemgroupitems}
@@ -579,6 +575,28 @@
\appendtoks \letvalue\v!its \itemgroupitems \to \itemgroupcommands
\appendtoks \letvalue\v!mar \itemgroupmargin \to \itemgroupcommands
+% todo : \startitem .. \stopitem
+
+% quick hack ...
+
+\def\v!item{item}
+
+\appendtoks
+ \letvalue{\e!start\v!item}\itemgroupitem
+ \letvalue{\e!stop \v!item}\endgraf
+\to \itemgroupcommands
+
+\appendtoks
+ \setvalue{\e!start\v!head}#1{\itemgrouphead#1\par}%
+ \letvalue{\e!stop \v!head}\endgraf
+\to \itemgroupcommands
+
+% \startitemize
+% \starthead {xx} test \stophead
+% \startitem test \stopitem
+% \startitem test \stopitem
+% \stopitemize
+
% Sometimes the user demands get pretty weird:
%
% \startitemize
@@ -587,13 +605,33 @@
% \headsym{xx} test \par test
% \stopitemize
+\appendtoks \let\headsym \itemgroupheadsym \to \itemgroupcommands
+
\def\itemgroupheadsym#1%
{\def\symsymbol{\doitemattributes\itemlevel\c!symstyle\c!symcolor{#1}}%
- \symbolitemtrue
- \headitemtrue
+ \settrue\symbollistitem
+ \settrue\headlistitem
\doitemgrouphead}
-\appendtoks \let\headsym \itemgroupheadsym \to \itemgroupcommands
+% \defineitemgroup[gbitemize]
+% \setupitemgroup[gbitemize][each][headstyle=bold]
+
+% \startgbitemize
+% \txt{italian} some italians like this kind of cross||breed between
+% an itemize and a description
+% \txt{sicilians} i wonder how many sicilian mathematicians do a thesis
+% on the math involved in predicting the next big bang of the vulcano
+% \stopgbitemize
+
+\appendtoks \letvalue\v!txt \itemgrouptext \to \itemgroupcommands
+
+\newconditional\txtlistitem \setfalse\txtlistitem
+
+\def\itemgrouptext#1%
+ {\def\symsymbol{\doitemattributes\itemlevel\c!headstyle\c!headcolor{#1}}%
+ \settrue\symbollistitem
+ \settrue\txtlistitem
+ \itemgroupitem}
\def\itembreak % -10
{\flushnotes\penalty-5\relax}
@@ -601,15 +639,26 @@
\def\itemnobreak % +5
{\flushnotes\penalty+5\ifinsidecolumns\else00\fi\relax}
+\def\dodotxtitem
+ {\scratchdimen\wd8
+ \advance \scratchdimen \getitemparameter\itemlevel\c!distance\relax
+ \ifdim\scratchdimen>\dimen0
+ \advance\scratchdimen -\dimen0
+ \else
+ \scratchdimen\z@
+ \fi
+ \llap{\hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hfill}}%
+ \hskip\scratchdimen}
+
\def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken
- {\iftextitems
+ {\ifconditional\textlistitem
% begin of item
\else
\par
\fi
- \ignorespaces
+% \ignorespaces
\increment\noflistelements
- \ifnum\itemcolumndepth=\zerocount \ifoptimizeitems
+ \ifnum\itemcolumndepth=\zerocount \ifconditional\optimizelistitem
\ifnum\noflistelements=\plusone % tgv bv kolommen/nesting
\findtwopassdata\s!list{\noflists:}% % wordt soms de volgorde
\fi % verstoord, vandaar \find
@@ -623,7 +672,7 @@
\fi
\else\ifnum\twopassdata>3
\ifnum\noflistelements=2
- \ifitemintro
+ \ifconditional\introlistitem
\doitembreak\nobreak
\else
\doitembreak\itemnobreak
@@ -633,20 +682,26 @@
\else\ifnum\noflistelements>2
\doitembreak\itembreak
\else
- \ifitemintro\else\doitembreak\itembreak\fi
+ \ifconditional\introlistitem\else\doitembreak\itembreak\fi
\fi\fi\fi
\fi\fi
\fi
\fi\fi
\noindent
\setbox8\hbox
- {\ifheaditem
- \doitemattributes\itemlevel\c!headstyle\c!headcolor{\listitem}%
- \else\ifsymbolitem
- \symsymbol
+ {\ifconditional\headlistitem
+ \ifconditional\symbollistitem
+ \symsymbol
+ \else
+ \doitemattributes\itemlevel\c!headstyle\c!headcolor{\listitem}%
+ \fi
\else
- \doitemattributes\itemlevel\c!style\c!color{\listitem}%
- \fi\fi}%
+ \ifconditional\symbollistitem
+ \symsymbol % no attributes, why?
+ \else
+ \doitemattributes\itemlevel\c!style\c!color{\listitem}%
+ \fi
+ \fi}%
\doifsomething\somdestination
{\setbox8\hbox{\goto{\box8}[\somdestination]}}%
\globallet\somdestination\empty
@@ -655,35 +710,35 @@
\ht8=\strutheight
\dp8=\strutdepth
% so that content differs per run (esp mp graphics afterwards)
-\checkforrepeatedlistitem
+ \checkforrepeatedlistitem
\ifdim\dimen2<\zeropoint\relax
- \llap{\ifsubitem\llap{+}\fi\box8\hskip\leftmargindistance}%
+ \llap{\ifconditional\sublistitem\llap{+}\fi\box8\hskip\leftmargindistance}%
\else
\ifdim\dimen2=\zeropoint\relax
\calculatelistwidth1{\dimen0}%
\else
\calculatelistwidth\itemlevel{\dimen0}%
\fi
- \iftextitems
- \hbox{\ifsubitem+\fi\box8\hskip\fontdimen2\font}\nobreak
+ \ifconditional\textlistitem
+ \hbox{\ifconditional\sublistitem+\fi\box8\hskip\fontdimen2\font}\nobreak
+ \else\ifconditional\inlinelistitem
+ \hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hfill}%
+ \else\ifconditional\txtlistitem
+ \dodotxtitem
\else
- \ifconditional\inlinelistitem
- \hbox to \dimen0{\ifsubitem\llap{+}\fi\box8\hfill}%
- \else
- % todo: align+marge binnen de hbox
- \llap{\hbox to \dimen0{\ifsubitem\llap{+}\fi\box8\hfill}}%
- \fi
- \fi
+ % todo: align+marge binnen de hbox
+ \llap{\hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hfill}}%
+ \fi\fi\fi
\fi
-\forceunexpanded % needed for m conversion (\os) / i need to look into this
+ \forceunexpanded % needed for m conversion (\os) / i need to look into this
\setevalue{\@@currentitemsymbol\itemlevel}%
{\getvalue{\@@localitemsymbol\itemlevel}}% still problems with \uchar ?
%{\noexpand\getvalue{\@@localitemsymbol\itemlevel}}% no, spoils subrefs
\resetunexpanded
- \headitemfalse
- \subitemfalse
- \symbolitemfalse
- \EveryPar{\ignorespaces}%
+ \setfalse\headlistitem
+ \setfalse\sublistitem
+ \setfalse\symbollistitem
+ \EveryPar{\ignorespaces}% needed ?
\ignorespaces}
% For Frank Grieshaber and Mojca Miklavec:
@@ -691,31 +746,55 @@
\newconditional\repeatlistitem
\def\checkforrepeatedlistitem
- {\ifnum\itemlevel=\plusone \ifnum\itemlevel=\plusone
+ {\ifnum\itemlevel=\plusone
\initializeboxstack{item}%
- \fi \fi
+ \fi
\ifconditional\repeatlistitem
- \savebox{item}{\itemlevel}{\hbox{\ifnum\itemlevel>\plusone \copy8\else\fi}}%
- \setbox8\hbox
- {\setbox\scratchbox\hbox{\foundbox{item}{\itemlevel}}%
+ \savebox{item}{\itemlevel}{\hbox{\copy8}}%
+ \setbox8\hbox to \wd8
+ {\setbox\scratchbox\hbox
+ {\scratchcounter\itemlevel
+ \advance\scratchcounter\minusone
+ \dorecurse\scratchcounter{\foundbox{item}{\recurselevel}}}%
\ifnum\itemlevel>\plusone
- \hskip-\wd\scratchbox
- \ifnum\countervalue{\@@itemcounter\itemlevel}>\plusone
- \llap{\box\scratchbox}%
+ \ifdim\wd\scratchbox>\zeropoint
+ \hskip-\dimen2
+ \box\scratchbox
\fi
\fi
- \box8}%
+ \box8 }%
\fi}
+% \startbuffer
+% \item
+% \startitemize[n]
+% \item item 1.1
+% \item item 1.2
+% \startitemize[n] \item item 1.2.1 \item item 1.2.2 \stopitemize
+% \item item 1.3
+% \stopitemize
+% \item
+% \startitemize[n] \item item 2.1 \item item 2.2 \stopitemize
+% \item item 3
+% \startitemize[n] \item item 3.1 \item item 3.2 \stopitemize
+% \item
+% \startitemize[n] \item item 4.1 \item item 4.2 \stopitemize
+% \stopbuffer
+%
+% \startitemize[n,repeat,6*broad,packed] \getbuffer \stopitemize \blank[3*big]
+% \startitemize[n,repeat,packed] \getbuffer \stopitemize \blank[3*big]
+% \setupitemize[each][atmargin][width=3em]
+% \startitemize[n,repeat,packed] \getbuffer \stopitemize
+
\chardef\autoitemgroupspacing=2 % 0 = voor/na, 1=tussen als geen voor 2=(prev)tussen=old/normal
\def\complexdoitemgroupitem[#1]%
- {\iftextitems
+ {\ifconditional\textlistitem
% begin of item
\else
\par
\fi
- \ignorespaces
+% \ignorespaces
\ifconditional\concatnextitem % new, concat
\doitembreak\nobreak % new, concat
\fi % new, concat
@@ -723,18 +802,18 @@
\ifnum\itemcolumndepth=0\relax\ifnum\noflistelements>0\relax
\doitembreak\nobreak
\fi\fi
- \iffirstlist
- \firstlistfalse
+ \ifconditional\firstlistitem
+ \setfalse\firstlistitem
\begingroup
\ifcase\itemlevel
\or % 1
\ifnum\itemcolumndepth=0\relax
- \ifitemintro\doitembreak\nobreak\fi
+ \ifconditional\introlistitem\doitembreak\nobreak\fi
\getitemparameter1\c!before
- \ifitemintro\doitembreak\nobreak\fi
+ \ifconditional\introlistitem\doitembreak\nobreak\fi
\fi
\else % 2 en hoger
- \ifparagraphitems \else
+ \ifconditional\paragraphlistitem \else
\let\previtemlevel\itemlevel
\decrement\previtemlevel
\ifcase\autoitemgroupspacing\relax % nieuw
@@ -756,9 +835,10 @@
\vskip-\lineheight % new, concat
\nobreak % new, concat
\fi % new, concat
- \ignorespaces
+% \ignorespaces
\dolistitem
- \ifpackeditems
+ \relax
+ \ifconditional\packlistitem
\setupwhitespace[\v!none]%
\fi
\getitemparameter\itemlevel\c!inner
@@ -773,11 +853,27 @@
\strut % added 11-08-99
\setfalse\concatnextitem % new, concat
\hskip\itemsignal % new, concat
+ \getitemparameter\itemlevel\c!command} % \defaultitemcommand
+
+\def\defaultitemcommand
+ {\EveryPar{\ignorespaces}% needed ?
\ignorespaces}
+% For Giuseppe "Oblomov" Bilotta, inspired on a suggestion by Taco
+% Hoekwater.
+%
+% \def\MyItemCommand#1{{\bf#1}\quad}
+% \setupitemgroup[itemize][command=\MyItemCommand]
+%
+% \startitemize
+% \item {test} is this okay?
+% \item {test} is this okay?
+% \item {test} is this okay?
+% \stopitemize
+
\def\complexitem[#1]#2\par % todo: no two pass data
- {\startitemgroup[#1]
- \complexdoitemgroupitem[]\ignorespaces\begstrut#2\unskip\endstrut\par
+ {\startitemgroup[#1]%
+ \complexdoitemgroupitem[]\begstrut#2\endstrut\par
\stopitemgroup}
\definecomplexorsimpleempty\item
@@ -785,24 +881,24 @@
\def\complexhead[#1]#2\par#3\par
{\startitemgroup[#1]%
- \complexdoitemgrouphead[]\ignorespaces#2\par#3\par
+ \complexdoitemgrouphead[]\begstrut#2\endstrut\par\begstrut#3\endstrut\par
\stopitemgroup}
% \def\complexdoitemgrouphead[#1]#2\par% % beter in \complexdosom hangen met een if
-% {\iffirstlist\else\doitembreak\allowbreak\fi
-% \ifpackeditems\else\getitemparameter\itemlevel\c!beforehead\fi
-% \iffirstlist\ifitemintro\else\ifcase\itemlevel % incr in \complexdosom
+% {\ifconditional\firstlistitem\else\doitembreak\allowbreak\fi
+% \ifconditional\packlistitem\else\getitemparameter\itemlevel\c!beforehead\fi
+% \ifconditional\firstlistitem\ifconditional\introlistitem\else\ifcase\itemlevel % incr in \complexdosom
% \doitembreak\allowbreak
% \fi\fi\fi
% \complexdoitemgroupitem[#1]{\doitemattributes\itemlevel\c!headstyle\c!headcolor
% {\ignorespaces#2}}%
-% \iftextitems
+% \ifconditional\textlistitem
% \removeunwantedspaces\space\ignorespaces
% \else
% \par
% \fi
% \doitembreak\nobreak
-% \ifpackeditems\else\getitemparameter\itemlevel\c!afterhead\fi
+% \ifconditional\packlistitem\else\getitemparameter\itemlevel\c!afterhead\fi
% \doitembreak\nobreak
% \noindentation}
%
@@ -812,9 +908,9 @@
\def\dostopitemattributes {\dostopattributes}
\def\complexdoitemgrouphead[#1]% beter in \complexdosom hangen met een if
- {\iffirstlist\else\doitembreak\allowbreak\fi
- \ifpackeditems\else\getitemparameter\itemlevel\c!beforehead\fi
- \iffirstlist\ifitemintro\else\ifcase\itemlevel % incr in \complexdosom
+ {\ifconditional\firstlistitem\else\doitembreak\allowbreak\fi
+ \ifconditional\packlistitem\else\getitemparameter\itemlevel\c!beforehead\fi
+ \ifconditional\firstlistitem\ifconditional\introlistitem\else\ifcase\itemlevel % incr in \complexdosom
\doitembreak\allowbreak
\fi\fi\fi
\complexdoitemgroupitem[#1]%
@@ -827,13 +923,13 @@
{\removeunwantedspaces
\dostopitemattributes
\egroup
- \iftextitems
+ \ifconditional\textlistitem
\space\ignorespaces
\else
\par
\fi
\doitembreak\nobreak
- \ifpackeditems\else\getitemparameter\itemlevel\c!afterhead\fi
+ \ifconditional\packlistitem\else\getitemparameter\itemlevel\c!afterhead\fi
\doitembreak\nobreak
\noindentation}
@@ -895,6 +991,7 @@
\c!righttext=),
\c!start=1,
\c!option=,
+ \c!command=\defaultitemcommand,
\c!symbol=\itemlevel] % \v!niveau
\def\defineitemgroup
diff --git a/Master/texmf-dist/tex/context/base/core-job.tex b/Master/texmf-dist/tex/context/base/core-job.tex
index 0a398f462de..03d91f5a45e 100644
--- a/Master/texmf-dist/tex/context/base/core-job.tex
+++ b/Master/texmf-dist/tex/context/base/core-job.tex
@@ -54,7 +54,7 @@
{% #1=\readlocfile|\readsetfile{dir} #2=filename
% #1{#2}\donothing\donothing
#1{#2}\donothing{\readfile{#2}\donothing\donothing}}
-
+
\def\processfile#1%
{\ifx\allinputpaths\empty
\def\next{\processlocalfile\readlocfile}%
@@ -74,6 +74,22 @@
\fi
\next{#1}}
+\def\doifinputfileelse#1% rarely used
+ {\ifx\allinputpaths\empty
+ \@EA\secondoftwoarguments
+ \else
+ \let\filepath\empty
+ \def\docommando##1%
+ {\doiffileelse{\pathplusfile{##1}{#1}}{\donetrue\def\filepath{##1}}\donefalse
+ \ifdone\expandafter\quitcommalist\fi}%
+ \processcommacommand[.,\allinputpaths]\docommando
+ \ifx\filepath\empty
+ \@EAEAEA\secondoftwoarguments
+ \else
+ \@EAEAEA\firstoftwoarguments
+ \fi
+ \fi}
+
\let\allinputpaths\empty
% \def\usepath[#1]%
@@ -147,6 +163,8 @@
\processcommacommand[\@@svdirectory]\doloadsystemfile
\fi}
+\ifx\disableXML\undefined \let\disableXML\relax \fi
+
\def\loadsystemfiles
{\reportprotectionstate
\readsysfile\f!newfilename
@@ -160,7 +178,10 @@
\loadallsystemfiles\f!sysfilename
{\loadallsystemfiles{\f!sysfilename.rme}\donothing % new, fall back
\doglobal\appendtoks
+ \bgroup
+ \disableXML
\loadallsystemfiles\f!errfilename\donothing
+ \egroup
\to\everygoodbye}}
%\loadallsystemfiles\f!modfilename
@@ -332,13 +353,21 @@
% \expandafter\endinput
% \fi}
-\let\currentcomponent\v!text
+\let\currentcomponent \v!text
+\let\currentcomponentpath\f!currentpath
\def\donextlevel#1#2#3#4#5#6#7\\%
{\pushmacro\currentcomponent
- \let\currentcomponent#1
+ \pushmacro\currentcomponentpath
+ \let\currentcomponent#1%
\setsystemmode\currentcomponent
- \beforesplitstring#7\at.\to#2\relax
+ \splitfilename{#1}%
+ \ifx\splitoffpath\empty
+ \let\currentcomponentpath\f!currentpath
+ \else
+ \let\currentcomponentpath\splitoffpath
+ \fi
+ \beforesplitstring#7\at.\to#2\relax % can become path + base
\ifcase\filelevel\relax
\starttext
\def\project ##1 {#3{##1}}%
@@ -350,7 +379,8 @@
\fullexpandoneargafter\addtocommalist{#1}\loadedfiles}
\def\doprevlevel
- {\popmacro\currentcomponent
+ {\popmacro\currentcomponentpath
+ \popmacro\currentcomponent
\setsystemmode\currentcomponent
\ifnum\filelevel=\plusone
\expandafter\stoptext
@@ -426,7 +456,7 @@
\currentcomponent,\currentenvironment}
{\loadedlocalenvironments}
{\letvalue{\e!stop\v!localenvironment}\relax}
- {\grabuntil{\e!stop\v!localenvironment}\relax}}
+ {\grabuntil{\e!stop\v!localenvironment}\gobbleoneargument}} % TH: fixed, was \relax
\setvalue{\v!localenvironment}#1 {\doexecutefileonce{#1}}
@@ -454,23 +484,23 @@
\def\executesystemcommand{\immediate\write18}
% soon, when pdftex 1.22 is out in the field:
-%
-% \chardef\systemcommandmode\zerocount % 0=unknown 1=disabled 2=enabled
-%
-% \ifx\pdftexversion\undefined \else \ifnum\number\pdftexversion>122
-% \prependtoks
-% \chardef\systemcommandmode \ifeof18 \plusone \else \plustwo \fi
-% \to \everyjob
-% \fi
-%
-% maybe in meta-ini
-%
-% \appendtoks
-% \ifrunMPgraphics \ifcase\systemcommandmode \or
-% \writestatus\m!systems{system commands are disabled}%
-% \runMPgraphicsfalse
-% \fi \fi
-% \to \everyjob
+
+\chardef\systemcommandmode\zerocount % 0=unknown 1=disabled 2=enabled
+
+\ifx\pdfshellescape\undefined \else
+ \prependtoks
+ \chardef\systemcommandmode \ifcase\pdfshellescape \plusone \else \plustwo \fi
+ \to \everyjob
+\fi
+
+\appendtoks
+ \ifcase\systemcommandmode
+ \or
+ \writestatus\m!systems{system commands are disabled}%
+ \or
+ \writestatus\m!systems{system commands are enabled}%
+ \fi
+\to \everyjob
\ifx\etexversion\undefined \else \ifnum\etexversion<202
\prependtoks
diff --git a/Master/texmf-dist/tex/context/base/core-lnt.tex b/Master/texmf-dist/tex/context/base/core-lnt.tex
index 9c215c992d4..b19019bb825 100644
--- a/Master/texmf-dist/tex/context/base/core-lnt.tex
+++ b/Master/texmf-dist/tex/context/base/core-lnt.tex
@@ -106,6 +106,8 @@
% \stoplinenumbering
% \stopbuffer
%
+% \setupnotedefinition[linenote] [location=serried,distance=.5em]
+%
% {\typebuffer[test] \getbuffer[test]} \page
%
% \startbuffer[setup]
diff --git a/Master/texmf-dist/tex/context/base/core-lst.tex b/Master/texmf-dist/tex/context/base/core-lst.tex
index d3a5ebdb4d1..8029d4fe15b 100644
--- a/Master/texmf-dist/tex/context/base/core-lst.tex
+++ b/Master/texmf-dist/tex/context/base/core-lst.tex
@@ -141,24 +141,63 @@
\addutilityreset{listentries}
-\setvalue{\??li\c!alternative a}% nr - tit - pag
-% {\def\listfill {\hskip 1.75em}% was \hskip.5em\hskip 1.25em
- {\def\listfill {\hskip .25em}% omdat nu check
- \def\listskip {0em}%
- \def\listwidth{2em}}
-
-\setvalue{\??li\c!alternative b}% nr - tit - fill - pag
- {\def\listfill {\hfill}% was \hskip.5em\hfill
- \def\listskip {5em}%
- \def\listwidth{2em}}
-
-\setvalue{\??li\c!alternative c}% nr - tit - dots - pag
- {\def\listfill {\hskip.5em\listdots\hskip.5em}%
- \def\listskip {5em}%
- \def\listwidth{0pt}}
+% old values:
+%
+% a: \def\listfill {\hskip 1.75em}
+% b: \def\listfill {\hskip.5em\hfill}
+% c: \def\listfill {\hskip.5em\listdots\hskip.5em}
+
+% todo: interface them
+
+% \setvalue{\??li\c!alternative a}% nr - tit - pag
+% {\def\listfill {\hskip.25em\relax}%
+% \def\listskip {0pt}%
+% \def\listwidth {2em}%
+% \def\liststretch{10em}}
+
+% \setvalue{\??li\c!alternative b}% nr - tit - fill - pag
+% {\def\listfill {\hfill}%
+% \def\listskip {5em}%
+% \def\listwidth {2em}%
+% \def\liststretch{10em}}
+
+% \setvalue{\??li\c!alternative c}% nr - tit - dots - pag
+% {\def\listfill {\hskip.5em\listdots\hskip.5em\relax}%
+% \def\listskip {5em}%
+% \def\listwidth {0pt}%
+% \def\liststretch{10em}}
+
+\def\listalternativeparameter#1%
+ {\csname\??li\??li\listparameter\c!alternative#1\endcsname}
+
+\def\setuplistalternative[#1]%
+ {\dodoubleargument\getparameters[\??li\??li#1]}
+
+ % \listfill cum suis will be replaced by the direct call
+
+\def\listfill {\listalternativeparameter\c!command }
+\def\listskip {\listalternativeparameter\c!distance}
+\def\listwidth {\listalternativeparameter\c!width }
+\def\liststretch{\listalternativeparameter\c!stretch }
+
+% a : nr - tit - pag
+% b : nr - tit - fill - pag
+% c : nr - tit - dots - pag
+
+\setuplistalternative[a][\c!distance=0pt,\c!width=2em,\c!stretch=10em,\c!command=\hskip.25em\relax]
+\setuplistalternative[b][\c!distance=5em,\c!width=2em,\c!stretch=10em,\c!command=\hfill]
+\setuplistalternative[c][\c!distance=5em,\c!width=0pt,\c!stretch=10em,\c!command=\hskip.5em\listdots\hskip.5em\relax]
\def\listdots{\leaders\hbox to .5em{\hss.\hss}\hfill}
+% \starttext
+% \placelist[section][alternative=c]
+% \setuplistalternative[c][distance=1em,stretch=0em]
+% \placelist[section][alternative=c]
+% \section{test}
+% \section{\readfile{tufte}{}{}}
+% \stoptext
+
\setvalue{\??li\c!alternative}{\getvalue{\??li\c!alternative b}}
\getvalue{\??li\c!alternative}
@@ -282,7 +321,7 @@
\dosetlistmode
\endgroup}
-% the simple appreach:
+% the simple approach:
%
% \def\dosettoclevel#1#2%
% {\dosetfilterlevel{\getvalue{#1#2\c!criterium}}\empty}
@@ -404,7 +443,7 @@
{\let\splitlistsymbol\currentlistnumber}}% geen \edef ivm enz
\doif{\listparameter\c!label}\v!yes{\leftlabeltext\currentlist}%
\strut
- \def\numberseparator{\listparameter\c!separator}%
+ \def\numberseparator{\listparameter\c!separator}% overloaded, todo
\@EA\dohandlelistnumber\@EA{\splitlistsymbol}%
\listparameter\c!stopper
\doif{\listparameter\c!label}\v!yes{\rightlabeltext\currentlist}}
@@ -591,17 +630,15 @@
{\forgetall
\dostartlistattributes\c!style\c!color\empty
\!!widthb\hsize
-\doifelse{\listparameter\c!headnumber}\v!yes{%
- \setbox2\hbox \ifdim\!!widtha>\zeropoint to \!!widtha \fi
- {\makelistelement\v!sectionnumber
- {\donestedlistattributes\c!numberstyle\c!numbercolor
- {\listparameter\c!numbercommand{\currentlistsymbol}}%
- \hfill}}%
-}{%
- \!!widtha\zeropoint
- \!!widthc\zeropoint
- \setbox2\hbox{}%
-}%
+ \doifelse{\listparameter\c!headnumber}\v!yes
+ {\setbox2\hbox \ifdim\!!widtha>\zeropoint to \!!widtha \fi
+ {\makelistelement\v!sectionnumber
+ {\donestedlistattributes\c!numberstyle\c!numbercolor
+ {\listparameter\c!numbercommand{\currentlistsymbol}}%
+ \hfill}}}
+ {\!!widtha\zeropoint
+ \!!widthc\zeropoint
+ \setbox2\hbox{}}%
\setbox4\hbox
{\doif{\listparameter\c!pagenumber}\v!yes
{\doifsomething{#5} % \listwidth is new ; temp hack
@@ -625,7 +662,7 @@
% we kunnen gewoon afbreken aan het eind
\else
\ifdim\listskip>\zeropoint\relax
- \rightskip\listskip\!!plus10em\relax
+ \rightskip\listskip\!!plus\liststretch\relax
\parfillskip-\rightskip
\fi
\fi
@@ -1040,10 +1077,10 @@
\setvalue{\e!complete#1}%
{\dodoubleempty\docompletecombinedlist[#1]}}
-\def\definecombinedlist%
+\def\definecombinedlist
{\dotripleempty\dodefinecombinedlist}
-\def\placecombinedlist%
+\def\placecombinedlist
{\dodoubleempty\doplacecombinedlist}
% new and yet undocumented (used in cocoa qa)
diff --git a/Master/texmf-dist/tex/context/base/core-mak.tex b/Master/texmf-dist/tex/context/base/core-mak.tex
index 68315ea5715..761f83156c7 100644
--- a/Master/texmf-dist/tex/context/base/core-mak.tex
+++ b/Master/texmf-dist/tex/context/base/core-mak.tex
@@ -48,24 +48,6 @@
\def\doplacement
{\dodoubleempty\dodoplacement}
-% \def\dodoplacement[#1][#2]% correctie moet mooier
-% {\bgroup
-% \dowithnextbox
-% {\setlocalhsize
-% \getparameters[#1][#2]%
-% \getvalue{#1\c!voor}%
-% \doifvalue{#1\c!regelcorrectie}\v!aan \startbaselinecorrection
-% \doifinset{\getvalue{#1\c!marge}}{\v!standaard,\v!ja}\noindent
-% \hbox to \localhsize
-% {\getvalue{#1\c!links}%
-% \flushnextbox
-% \getvalue{#1\c!rechts}}%
-% \doifvalue{#1\c!dieptecorrectie}\v!aan\baselinecorrection
-% \doifvalue{#1\c!regelcorrectie }\v!aan\stopbaselinecorrection
-% \getvalue{#1\c!na}%
-% \egroup}
-% \vbox}
-
\def\dodoplacement[#1][#2]% correctie moet mooier
{\bgroup
\dowithnextboxcontent
diff --git a/Master/texmf-dist/tex/context/base/core-mar.tex b/Master/texmf-dist/tex/context/base/core-mar.tex
index cdc09838e03..257c3dc4cc0 100644
--- a/Master/texmf-dist/tex/context/base/core-mar.tex
+++ b/Master/texmf-dist/tex/context/base/core-mar.tex
@@ -36,12 +36,12 @@
\beginTEX
\def\mainmarking#1%
- {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\else
+ {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\relax\else
\csname\??mk#1\c!coupling\endcsname
\fi}
\def\fastresetmarker#1%
- {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\else
+ {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\relax\else
\@EA\resetmark\csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
\fi}
@@ -103,14 +103,17 @@
\ifx\decouplemarking\undefined \def\decouplemarking[#1]{} \fi
+\let\alldefinedmarks\empty
+
\def\dododefinemarking[#1][#2]%
{\getparameters[\??mk#1]
- [\c!expansion=\v!no, % saves a macro
- \c!separator={ --- }, % watch the spaces
+ [\c!expansion=\v!no, % saves a macro
+ \c!separator={\space\emdash\space},
\c!limittext=\@@kolimittext,
\c!state=\v!start]%
\decouplemarking[#1]% % no coupling with sections
\setevalue{\??mk#1\c!coupling}{#2}%
+ \doglobal\addtocommalist{#2}\alldefinedmarks
\expandafter\newmark\csname\??mk#2\endcsname
\showmessage\m!systems{13}{#1,[#2]}}
@@ -138,71 +141,235 @@
{\doifdefinedelse{\??mk#1}}
% \def\fetchmark[#1][#2]% never \unexpanded
-% {\@EA\@EA\csname\??mk\??mk#2\endcsname
-% \csname\??mk\mainmarking{#1}\endcsname}
+% {\@EA\csname\??mk\??mk#2\@EA\endcsname\csname\??mk\mainmarking{#1}\endcsname}
+
+% \beginTEX
+%
+% \def\fetchmark[#1][#2]% never \unexpanded
+% {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\relax\else
+% \csname\??mk\??mk#2\@EA\endcsname
+% \csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
+% \fi}
+%
+% \endTEX
+%
+% \beginETEX \ifcsname
+%
+% \def\fetchmark[#1][#2]% never \unexpanded
+% {\ifcsname\??mk#1\c!coupling\endcsname
+% \csname\??mk\??mk#2\@EA\endcsname
+% \csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
+% \fi}
+%
+% \endETEX
+%
+% \def\fetchtwomarks[#1]%
+% {\doifsomething{\fetchmark[#1][\v!first]}
+% {\fetchmark[#1][\v!first]%
+% \doifsomething{\fetchmark[#1][\v!last]}
+% {\doifnot{\fetchmark[#1][\v!first]}{\fetchmark[#1][\v!last]}
+% {\getvalue{\??mk#1\c!separator}\fetchmark[#1][\v!last]}}}}
+%
+% \def\fetchallmarks[#1]%
+% {\doifsomething{\fetchmark[#1][\v!first]}
+% {\doifsomething{\fetchmark[#1][\v!previous]}
+% {\doifnot{\fetchmark[#1][\v!previous]}{\fetchmark[#1][\v!first]}
+% {\fetchmark[#1][\v!previous]\getvalue{\??mk#1\c!separator}}}}%
+% \fetchtwomarks[#1]}
+%
+% \def\dogetmarking[#1][#2]%
+% {\doifvalue{\??mk#1\c!state}\v!start
+% {\bgroup
+% %\def\nomarking##1{\unknown\ }%
+% \def\nomarking{\splitsequence{\getvalue{\??mk#1\c!limittext}}}%
+% \setfullsectionnumber{\??mk#1}%
+% \processaction % slow
+% [#2]
+% [ \v!both=>{\fetchtwomarks[#1]},
+% \v!all=>{\fetchallmarks[#1]},
+% \s!default=>{\fetchmark [#1][\v!first]},
+% \s!unknown=>{\fetchmark [#1][#2]}]%
+% \egroup}}
+%
+% \def\nogetmarking[#1][#2]%
+% {}
+%
+% \unexpanded\def\getmarking
+% {\dodoubleargument\dogetmarking}
\beginTEX
-\def\fetchmark[#1][#2]% never \unexpanded
- {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\else
- \@EA\@EA\csname\??mk\??mk#2\endcsname
- \csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
+\def\fetchmark[#1][#2]% % expandable / never use \unexpanded
+ {\@EA\ifx\csname\??mk::#1\endcsname\relax
+ \@EA\ifx\csname\??mk#1\c!coupling\endcsname\relax
+ % nothing
+ \else
+ \csname\??mk\??mk#2\@EA\endcsname
+ \csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
+ \fi
+ \else
+ \csname\??mk::\??mk::#2\@EA\@EA\@EA\endcsname
+ \csname\??mk::#1\endcsname
\fi}
\endTEX
\beginETEX \ifcsname
-\def\fetchmark[#1][#2]% never \unexpanded
- {\ifcsname\??mk#1\c!coupling\endcsname
- % \@EA\@EA\csname\??mk\??mk#2\endcsname
- % \csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
+\def\fetchmark[#1][#2]% % expandable / never use \unexpanded
+ {\ifcsname\??mk::#1\endcsname % saved mark
+ \csname\??mk::\??mk::#2\@EA\@EA\@EA\endcsname
+ \csname\??mk::#1\endcsname
+ \else\ifcsname\??mk#1\c!coupling\endcsname % real mark
\csname\??mk\??mk#2\@EA\endcsname
\csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
- \fi}
+ \fi\fi}
\endETEX
+% \def\fetchmark[#1][#2]% % expandable / never use \unexpanded
+% {\ifcsname\??mk::#1\endcsname % saved mark
+% \csname\??mk::\??mk::#2\@EA\@EA\@EA\endcsname
+% \csname\??mk::#1\endcsname
+% \else\ifcsname\??mk#1\c!coupling\endcsname % real mark
+% \csname\??mk\??mk#2\@EA\endcsname
+% \csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
+% \fi\fi}
+
+\letvalue{\??mk::\??mk::\v!previous}\firstoffourarguments
+\letvalue{\??mk::\??mk::\v!first }\secondoffourarguments
+\letvalue{\??mk::\??mk::\v!last }\thirdoffourarguments
+\letvalue{\??mk::\??mk::\v!current }\fourthoffourarguments
+
+% this version can be used when a page is built up in steps without
+% feedback of the otr'd list to the mvl (i.e.\ a page made of pages,
+% as in column sets where content is buffered)
+
+% reset at begin
+% preset before page
+% bubble in column
+% refresh at end
+
+\def\refreshsavedmark[#1][#2]% mark tag (packing saves many hash entries)
+ {\setxvalue{\??mk::#1:#2}%
+ {{\@EA\ifx\csname\??mk::#1:pp\endcsname\relax
+ % empty
+ \else
+ \csname\??mk::#1:pp\endcsname
+ \fi}%
+ {\@EA\ifx\csname\??mk::#1:ff\endcsname\relax
+ \fetchmark[#1][\v!first]%
+ \else
+ \csname\??mk::#1:ff\endcsname
+ \fi}%
+ {\fetchmark[#1][\v!last]}%
+ {\fetchmark[#1][\v!current]}}%
+ \setxvalue{\??mk::#1:pp}{\fetchmark[#1][\v!first]}%
+ \letgvalue{\??mk::#1:ff}\relax
+ }
+
+\def\bubblesavedmark[#1][#2]% no packing (not now, maybe make a six-pack later)
+ {\@EA\ifx\csname\??mk::#1:ff\endcsname\relax
+ \setxvalue{\??mk::#1:ff}{\fetchmark[#1][\v!first]}%
+ \fi}
+
+\def\resetsavedmark[#1][#2]% mark tag
+ {\doifelsenothing{\fetchmark[#1][\v!previous]}
+ {\letgvalue{\??mk::#1:pp}\relax}
+ {\setxvalue{\??mk::#1:pp}{\fetchmark[#1][\v!previous]}}%
+ \doifelsenothing{\fetchmark[#1][\v!first]}
+ {\letgvalue{\??mk::#1:ff}\relax}
+ {\setxvalue{\??mk::#1:ff}{\fetchmark[#1][\v!first]}}%
+ \letgvalue{\??mk::#1:#2}\emptysavedmark}
+
+\def\presetsavedmark[#1][#2]% mark tag
+ {\letgvalue{\??mk::#1:#2}\emptysavedmark}
+
+\def\emptysavedmark{{}{}{}{}}
+
+% new (can be used in column sets)
+%
+% \getsavedmarking[M][previous]
+% \getsavedmarking[M][first]
+% \getsavedmarking[M][last]
+
+\def\getsavedmarking
+ {\dodoubleargument\dogetsavedmarking}
+
+\def\dogetsavedmarking[#1][#2]%
+ {\doifelse{#2}\v!previous
+ {\getmarking[#1][1][\v!previous]}
+ {\doifelse{#2}\v!first
+ {\getmarking[#1][1][\v!first]}
+ {\getmarking[#1][\v!last]}}}
+
+% fetching
+
\def\fetchtwomarks[#1]%
- {\doifsomething{\fetchmark[#1][\v!first]}
- {\fetchmark[#1][\v!first]%
- \doifsomething{\fetchmark[#1][\v!last]}
- {\doifnot{\fetchmark[#1][\v!first]}{\fetchmark[#1][\v!last]}
- {\getvalue{\??mk#1\c!separator}\fetchmark[#1][\v!last]}}}}
+ {\dofetchtwomarks[#1][#1]}
\def\fetchallmarks[#1]%
- {\doifsomething{\fetchmark[#1][\v!first]}
- {\doifsomething{\fetchmark[#1][\v!previous]}
- {\doifnot{\fetchmark[#1][\v!previous]}{\fetchmark[#1][\v!first]}
- {\fetchmark[#1][\v!previous]\getvalue{\??mk#1\c!separator}}}}%
- \fetchtwomarks[#1]}
+ {\dofetchallmarks[#1][#1]}
+
+\def\dofetchtwomarks[#1][#2]% class class:tag
+ {\doifsomething{\fetchmark[#2][\v!first]}
+ {\fetchmark[#2][\v!first]%
+ \doifsomething{\fetchmark[#2][\v!last]}
+ {\doifnot{\fetchmark[#2][\v!first]}{\fetchmark[#2][\v!last]}
+ {\getvalue{\??mk#1\c!separator}\fetchmark[#2][\v!last]}}}}
+
+\def\dofetchallmarks[#1][#2]%
+ {\doifsomething{\fetchmark[#2][\v!first]}
+ {\doifsomething{\fetchmark[#2][\v!previous]}
+ {\doifnot{\fetchmark[#2][\v!previous]}{\fetchmark[#2][\v!first]}
+ {\fetchmark[#2][\v!previous]\getvalue{\??mk#1\c!separator}}}}%
+ \fetchtwomarks[#1][#2]}
+
+% \newtoks \everymarking
+
+% \def\Interesting{\doifmodeelse{*\v!marking}{Interesting}{Boring}}
+% \setupheadertexts[chapter]
+% \starttext
+% \chapter{This Is \Interesting}
+% \stoptext
-\def\dogetmarking[#1][#2]%
+\def\dogetmarking[#1][#2][#3]%
{\doifvalue{\??mk#1\c!state}\v!start
{\bgroup
+ \setsystemmode\v!marking
+ \the\everymarking
%\def\nomarking##1{\unknown\ }%
\def\nomarking{\splitsequence{\getvalue{\??mk#1\c!limittext}}}%
\setfullsectionnumber{\??mk#1}%
- \processaction % slow
- [#2]
- [ \v!both=>{\fetchtwomarks[#1]},
- \v!all=>{\fetchallmarks[#1]},
- \s!default=>{\fetchmark [#1][\v!first]},
- \s!unknown=>{\fetchmark [#1][#2]}]%
+ \ifthirdargument
+ \processaction % slow
+ [#3]
+ [ \v!both=>{\dofetchtwomarks[#1][#1:#2]},
+ \v!all=>{\dofetchallmarks[#1][#1:#2]},
+ \s!default=>{\fetchmark [#1:#2][\v!first]},
+ \s!unknown=>{\fetchmark [#1:#2][#3]}]%
+ \else
+ \processaction % slow
+ [#2]
+ [ \v!both=>{\dofetchtwomarks[#1][#1]},
+ \v!all=>{\dofetchallmarks[#1][#1]},
+ \s!default=>{\fetchmark [#1][\v!first]},
+ \s!unknown=>{\fetchmark [#1][#2]}]%
+ \fi
\egroup}}
-\def\nogetmarking[#1][#2]%
+\def\nogetmarking[#1][#2][#3]%
{}
\unexpanded\def\getmarking
- {\dodoubleargument\dogetmarking}
+ {\dotripleargument\dogetmarking}
\let\setsomemark\setmark
\beginTEX
\def\domarking[#1]#2%
- {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\else
+ {\@EA\ifx\csname\??mk#1\c!coupling\endcsname\relax\else
\bgroup
\doifelsevalue{\??mk#1\c!expansion}\v!yes
\expandmarkstrue\expandmarksfalse
diff --git a/Master/texmf-dist/tex/context/base/core-mat.tex b/Master/texmf-dist/tex/context/base/core-mat.tex
index 10f8d16f34a..72a620973bb 100644
--- a/Master/texmf-dist/tex/context/base/core-mat.tex
+++ b/Master/texmf-dist/tex/context/base/core-mat.tex
@@ -1,11 +1,11 @@
%D \module
%D [ file=core-mat,
-%D version=1998.12.07,
+%D version=2006.03.27, % 1998.12.07
%D title=\CONTEXT\ Core Macros,
%D subtitle=Math Fundamentals,
-%D author=Hans Hagen,
+%D author={Hans Hagen \& Taco Hoekwater},
%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%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
@@ -17,6 +17,32 @@
\unprotect
+% \definemessageconstant{math}
+
+% \startmessages all library: math
+% title: math
+% 1: don't use -- here (line \the\inputlineno)
+% \stopmessages
+
+% \def\invalidmathcommand#1{\showmessage\m!math1{#1}}
+
+% \let\normaleqno \eqno
+% \let\normalleqno\leqno
+
+% \appendtoks
+% \def\eqno {\invalidmathcommand{\string\eqno }}%
+% \def\leqno{\invalidmathcommand{\string\leqno}}%
+% \to \everydisplay
+
+% \appendtoks
+% \let\eqno\normaleqno
+% \let\leqno\normaleqno
+% \to \everymath
+
+% \placeformula\startformula
+% H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}}
+% \stopformula
+
\def\mathortext
{\ifmmode
\expandafter\firstoftwoarguments
@@ -129,7 +155,8 @@
[\c!text=\v!formula,
\c!way=\@@fmway,
\c!blockway=\@@fmblockway,
- \c!location=\v!intext]
+ \c!location=\v!intext,
+ \c!conversion=\@@fmconversion]
\def\setupformulas
{\dodoubleargument\getparameters[\??fm]}
@@ -137,6 +164,8 @@
\newconditional\handleformulanumber
\newconditional\incrementformulanumber
+\def\formuladistance{\formulaparameter\c!distance}
+
\def\dododoformulanumber#1#2#3#4% (#1,#2)=outer(ref,sub) (#3,#4)=inner(ref,sub)
{\hbox\bgroup
\ifconditional\handleformulanumber
@@ -150,22 +179,25 @@
\else
\let\hetsubnummer\empty
\fi
- \doifsomething{#1}{\rawreference{\s!for}{#1}{\hetnummer\hetsubnummer}}%
+ \doifsomething{#1}{\rawreference{\s!for}{#1}{\composedsectionnumber\hetsubnummer}}%
\setbox0\hbox{\ignorespaces#4\unskip}%
\ifdim\wd0>\zeropoint
\edef\hetsubnummer{#4}%
\fi
- \doifsomething{#3}{\rawreference\s!for{#3}{\hetnummer\hetsubnummer}}%
+ \doifsomething{#3}{\rawreference\s!for{#3}{\composedsectionnumber\hetsubnummer}}%
+ \doflushformulalistentry{\composedsectionnumber\hetsubnummer}%
\rm % nodig ?
+ \doif{\formulaparameter\c!location}\v!right{\hskip\formuladistance}%
\@@fmnumbercommand
{\dostartattributes\??fm\c!numberstyle\c!numbercolor
\strut
\@@fmleft
- \preparethenumber\??fm\hetnummer\preparednumber
+ \preparefullnumber\??fm\composedsectionnumber\preparednumber
\labeltexts\v!formula
{\ignorespaces\preparednumber\ignorespaces\hetsubnummer\unskip}%
\@@fmright
\dostopattributes}%
+ \doif{\formulaparameter\c!location}\v!left{\hskip\formuladistance}%
\fi
\egroup}
@@ -213,6 +245,7 @@
[\c!way=\@@nrway,
\c!blockway=,
\c!sectionnumber=\@@nrsectionnumber,
+ \c!conversion=\v!numbers,
\c!location=\v!right,
\c!left=(,
\c!right=),
@@ -268,7 +301,8 @@
\fi
\advance\displaywidth-\displayindent
\advance\displaywidth-\rightdisplayskip
- \advance\displaywidth-\rightdisplaymargin}
+ \advance\displaywidth-\rightdisplaymargin
+ \hsize\displaywidth} % new, else overfull in itemize
\newif\ifoptimizedisplayspacing
@@ -281,6 +315,13 @@
% hm, invoke otr in hmode in order to move skips to mvl, could be an option
+%D \startbuffer
+%D \startformula[9pt] x = 1 \stopformula
+%D \startformula[7pt] x = 1 \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
\def\dodostartformula[#1][#2]% setting leftskip adaption is slow !
{% todo: test first
%
@@ -294,6 +335,11 @@
\switchtoformulabodyfont[#2]%
\parskip\formulaparskip
\def\currentformula{#1}%
+% may look better in itemizations
+\doif{\formulaparameter\c!option}\v!middle
+ {\def\leftdisplayskip{\zeropoint}%
+ \def\rightdisplayskip{\zeropoint}}%
+% this was an experiment
\doifsomething{\formulaparameter\c!margin}% so we test first
{\dosetleftskipadaption{\formulaparameter\c!margin}%
\edef\leftdisplaymargin{\the\leftskipadaption}}% overloaded
@@ -333,7 +379,9 @@
\resetlastlinewidth
\nonoindentation
\dochecknextindentation{\??fm\currentformula}%
- \egroup}
+ \egroup
+ \setfalse\handleformulanumber
+ \dorechecknextindentation} % here ?
\newif\ifinformula
@@ -395,9 +443,9 @@
%\forgetall % otherwise backgrounds fail
\ifdim\lastskip<\zeropoint\else
\par
- \ifvmode \ifdim\parskip>\zeropoint\relax
- \whitespace \vskip-\parskip % kind of forces and cancels again
- \fi \fi
+ \ifvmode \ifdim\parskip>\zeropoint\relax
+ \whitespace \vskip-\parskip % kind of forces and cancels again
+ \fi \fi
\fi
\doif\displaygridcorrection{-\v!top}{\kern-\strutht}% new, currently only option/default
\beforedisplayspace
@@ -519,22 +567,22 @@
% \defineformulaalternative[multi][\begindmath][\enddmath]
%
% \fakewords{20}{40}\epar
-% \plaatsformule {a} $$ \fakespacingformula $$
+% \placeformula {a} $$ \fakespacingformula $$
% \fakewords{20}{40}\epar
-% \plaatsformule {b} \startformule \fakespacingformula \stopformule
-% \plaatsformule {b} \startformule \fakespacingformula \stopformule
+% \placeformula {b} \startformule \fakespacingformula \stopformule
+% \placeformula {b} \startformule \fakespacingformula \stopformule
% \fakewords{20}{40}\epar
-% \plaatsformule {c} \startmdformule \fakespacingformula \stopmdformule
-% \plaatsformule {c} \startmdformule \fakespacingformula \stopmdformule
+% \placeformula {c} \startmdformule \fakespacingformula \stopmdformule
+% \placeformula {c} \startmdformule \fakespacingformula \stopmdformule
% \fakewords{20}{40}\epar
-% \plaatsformule {d} \startmpformule \fakespacingformula \stopmpformule
-% \plaatsformule {d} \startmpformule \fakespacingformula \stopmpformule
+% \placeformula {d} \startmpformule \fakespacingformula \stopmpformule
+% \placeformula {d} \startmpformule \fakespacingformula \stopmpformule
% \fakewords{20}{40}\epar
-% \plaatsformule {e} \startsdformule \fakespacingformula \stopsdformule
-% \plaatsformule {e} \startsdformule \fakespacingformula \stopsdformule
+% \placeformula {e} \startsdformule \fakespacingformula \stopsdformule
+% \placeformula {e} \startsdformule \fakespacingformula \stopsdformule
% \fakewords{20}{40}\epar
-% \plaatsformule {f} \startspformule \fakespacingformula \stopspformule
-% \plaatsformule {f} \startspformule \fakespacingformula \stopspformule
+% \placeformula {f} \startspformule \fakespacingformula \stopspformule
+% \placeformula {f} \startspformule \fakespacingformula \stopspformule
% \fakewords{20}{40}
% \convertcommand\next\to\ascii \getfirstcharacter\ascii
@@ -548,36 +596,123 @@
{\setfalse\incrementformulanumber
\dodoubleempty\doplaceformula}
+%D Experimental goodie:
+%D
+%D \startbuffer
+%D \placelist[formula][criterium=text] \blank[2*big]
+%D \placenamedformula[one]{first} \startformula a = 1 \stopformula \endgraf
+%D \placeformula \startformula a = 2 \stopformula \endgraf
+%D \placenamedformula {second} \startformula a = 3 \stopformula \endgraf
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+\definelist[\v!formula]
+
+\global\let\doflushformulalistentry\gobbleoneargument
+
+\def\setformulalistentry#1%
+ {\gdef\doflushformulalistentry##1%
+ {\expanded{\writetolist[\v!formula]{##1}}{#1}%
+ \global\let\doflushformulalistentry\gobbleoneargument}}
+
+\def\placenamedformula
+ {\dosingleempty\doplacenamedformula}
+
+\def\doplacenamedformula[#1]#2%
+ {\iffirstargument
+ \def\next{\placeformula[#1]}%
+ \else
+ \let\next\placeformula
+ \fi
+ \setformulalistentry{#2}%
+ \next}
+
+%D The implementation of placement is a bit ugly:
+
+% \def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces
+% {\def\redoplaceformula
+% {\bgroup\def\dostartformula####1{\relax}%
+% \ifx\next\bgroup
+% \@EA\moreplaceformula % [ref]{}
+% \else
+% \expandafter\convertargument\e!start\to\asciiA % actually, \next's meaning is \dostartformula
+% \expandafter\convertargument\next \to\asciiB
+% \ExpandBothAfter\doifincsnameelse\asciiA\asciiB
+% {\egroup \@EA\dodoplaceformula}% [ref]\start
+% {\egroup \@EA\dispplaceformula}% [ref]$$
+% \fi[#1]{}}%
+% \futurelet\next\redoplaceformula}
+%
+% \long\def\moreplaceformula[#1]#2#3#4% #2 dummy #4 gobbles spaces
+% {\def\redoplaceformula
+% {\expandafter\convertargument\e!start\to\asciiA
+% \expandafter\convertargument\next \to\asciiB
+% \ExpandBothAfter\doifincsnameelse\asciiA\asciiB
+% {\egroup \dodoplaceformula}% [ref]\start
+% {\egroup \dispplaceformula}% [ref]$$
+% [#1]{#3}}%
+% \futurelet\next\redoplaceformula#4}
+%
+% BEGIN OF PATCH (CORE-MAT.TEX)
+
\def\doplaceformula[#1][#2]% #2 = dummy, gobbles spaces
- {\def\redoplaatsformule
- {\bgroup\def\dostartformula####1{\relax}%
+ {\def\redoplaceformula
+ {\bgroup
\ifx\next\bgroup
- \@EA\moreplaatsformule % [ref]{}
+ \egroup \@EA\moreplaceformula % [ref]{}
\else
- \expandafter\convertargument\e!start\to\asciiA
- \expandafter\convertargument\next \to\asciiB
- \ExpandBothAfter\doifincsnameelse\asciiA\asciiB
- {\egroup \@EA\dodoplaceformula}% [ref]\start
- {\egroup \@EA\dispplaatsformule}% [ref]$$
+ \def\nextnext{$}%
+ \ifx\next\nextnext
+ \egroup \@EAEAEA\dispplaceformula % [ref]$$
+ \else
+ \egroup \@EAEAEA\dodoplaceformula % [ref]\start
+ \fi
\fi[#1]{}}%
- \futurelet\next\redoplaatsformule}
-
-\long\def\moreplaatsformule[#1]#2#3#4% #2 dummy #4 gobbles spaces
- {\def\redoplaatsformule
- {\expandafter\convertargument\e!start\to\asciiA
- \expandafter\convertargument\next \to\asciiB
- \ExpandBothAfter\doifincsnameelse\asciiA\asciiB
- {\egroup \dodoplaceformula}% [ref]\start
- {\egroup \dispplaatsformule}% [ref]$$
+ \futurelet\next\redoplaceformula}
+
+\long\def\moreplaceformula[#1]#2#3#4% #2 dummy #4 gobbles spaces
+ {\def\redoplaceformula
+ {\bgroup
+ \def\nextnext{$}%
+ \ifx\next\nextnext
+ \egroup \@EA\dispplaceformula % [ref]$$
+ \else
+ \egroup \@EA\dodoplaceformula % [ref]\start
+ \fi
[#1]{#3}}%
- \futurelet\next\redoplaatsformule#4}
+ \futurelet\next\redoplaceformula#4}
+
+% END OF PATCH
-\def\dispplaatsformule[#1]#2$$#3$$%
+\def\startformulas#1\stopformulas % new / to be internationalized
+ {\bgroup
+ \forgetdisplayskips
+ \startdisplaymath
+ \setlocalhsize
+ \long\def\startformula##1\stopformula{\advance\scratchcounter\plusone}%
+ \scratchcounter\zerocount #1% preroll
+ \divide \hsize \scratchcounter
+ \hbox to \localhsize \bgroup
+ \hss
+ \def\normalstartformula{\vskip-\strutdepth$$}% i hate this
+ \def\normalstartformula{\vskip-\strutdepth$$}% i hate this
+ \def\normalstopformula {$$}%
+ \def\startformula{$\vcenter\bgroup\normalstartformula}%
+ \def\stopformula {\normalstopformula\egroup$\hss}%
+ #1%
+ \egroup
+ \stopdisplaymath
+ \egroup}
+
+\def\dispplaceformula[#1]#2$$#3$$%
{\dodoplaceformula[#1]{#2}\dostartformula{}#3\dostopformula}
\let\normalreqno\eqno
\let\normalleqno\leqno
+\let\donestedformulanumber\gobbletwoarguments
+
\def\dodoplaceformula[#1]#2% messy, needs a clean up
{\doifelse{#1}{-}
{\setfalse\handleformulanumber}
@@ -588,6 +723,9 @@
\def\formulanumber
{%\global\let\subformulanumber\doformulanumber % no, bug
\doformulanumber[#1][#2]}%
+ \def\donestedformulanumber##1##2%
+ {\doifsomething{##1}
+ {\doifelse{##1}{+}{\doformulanumber[#1]}{\doformulanumber[##1]}[##2][]{}}}%
\def\subformulanumber
{\setfalse\incrementformulanumber
\formulanumber}%
@@ -598,7 +736,8 @@
{\normalreqno{\doformulanumber[#1][#2][]{}}}}%
\else
\def\formulanumber{\doformulanumber[#1][#2]}%
- \global\let\subformulanumber\doformulanumber
+ \let\donestedformulanumber\gobbletwoarguments
+ \let\subformulanumber\doformulanumber % was \global
\global\let\doplaceformulanumber\empty
\fi}
@@ -615,7 +754,7 @@
\def\resetdisplaymatheq
{\let\normalleqno\relax \let\leqno\relax
\let\normalreqno\relax \let\eqno \relax
- \let\doplaceformulanumber\relax}
+ \let\doplaceformulanumber\empty}
\let\normaldispl@y\displ@y
@@ -644,8 +783,47 @@
\def\mathhbox
{\iftracemath\ruledhbox\else\hbox\fi}
-\def\startmathbox#1#2%
+% \def\startmathbox#1#2%
+% {\hsize\displaywidth
+% \global\let\@eqno \empty \def\eqno {\gdef\@eqno }%
+% \global\let\@leqno\empty \def\leqno{\gdef\@leqno}%
+% % added
+% \let\normalreqno\eqno
+% \let\normalleqno\leqno
+% % added
+% \doplaceformulanumber
+% \mathhbox to \displaywidth\bgroup
+% \mathinnerstrut
+% $\displaystyle
+% \ifx\@leqno\empty\else \ifcase#2
+% \rlap{\@leqno}%
+% \else
+% \@leqno\hskip\formulaparameter\c!distance
+% \fi \fi
+% #1}
+
+% \def\stopmathbox#1#2%
+% {$#1%
+% \ifx\@eqno\empty\else \ifcase#2
+% \llap{\@eqno}%
+% \else
+% \hskip\formulaparameter\c!distance\@eqno
+% \fi \fi
+% \egroup}
+
+% \defineinnermathhandler\v!right {\startmathbox\empty1}{\stopmathbox\hfill0}
+% \defineinnermathhandler\v!left {\startmathbox\hfill0}{\stopmathbox\empty1}
+% \defineinnermathhandler\v!middle{\startmathbox\hfill0}{\stopmathbox\hfill0}
+
+\chardef\mathraggedstatus=0 % normal left center right
+\chardef\mathnumberstatus=0 % nothing normal shift_right
+\let\mathnumbercorrection\!!zeropoint
+
+\def\startmathbox#1%
{\hsize\displaywidth
+ \global\chardef\mathnumberstatus\plusone
+ \chardef\mathraggedstatus#1\relax
+ \let\mathnumbercorrection\!!zeropoint
\global\let\@eqno \empty \def\eqno {\gdef\@eqno }%
\global\let\@leqno\empty \def\leqno{\gdef\@leqno}%
% added
@@ -653,28 +831,74 @@
\let\normalleqno\leqno
% added
\doplaceformulanumber
- \mathhbox to \displaywidth\bgroup
+ \setbox\scratchbox\mathhbox to \displaywidth\bgroup
\mathinnerstrut
- $\displaystyle
- \ifx\@leqno\empty\else \ifcase#2
- \rlap{\@leqno}%
- \else
- \@leqno\hskip\formulaparameter\c!distance
- \fi \fi
- #1}
-
-\def\stopmathbox#1#2%
- {$#1%
- \ifx\@eqno\empty\else \ifcase#2
+ $%
+ \displaystyle
+ \ifcase\mathraggedstatus\or\hfill\or\hfill\fi}
+
+\def\llappedmathno
+ {\ifcase\mathraggedstatus\or
+ \@eqno
+ \or
\llap{\@eqno}%
+ \or
+ \llap{\@eqno}%
+ \fi}
+
+\def\rlappedmathno
+ {\ifcase\mathraggedstatus\or
+ \rlap{\@leqno}%
+ \or
+ \rlap{\@leqno}%
+ \or
+ \@leqno
+ \fi}
+
+\def\stopmathbox
+ {$%
+ \ifcase\mathraggedstatus\or\or\hfill\or\hfill\fi
+ \egroup
+ \setbox0\hbox{\unhcopy\scratchbox}%
+ \scratchdimen\wd0
+ \ifdim\scratchdimen>\displaywidth
+ \donetrue
\else
- \hskip\formulaparameter\c!distance\@eqno
- \fi \fi
+ \donefalse
+ \fi
+ \hbox to \displaywidth\bgroup
+ \ifcase\mathnumberstatus
+ \box\scratchbox
+ \or
+ \ifx\@leqno\empty
+ \ifx\@eqno\empty
+ \box\scratchbox
+ \else
+ \ifdone
+ \vbox{\box\scratchbox\hbox to \displaywidth{\hss\llappedmathno}}%
+ \else
+ \hss\box\scratchbox\llappedmathno % hss makes room for number
+ \fi
+ \fi
+ \else
+ \ifdone
+ \vbox{\hbox to \displaywidth{\rlappedmathno\hss}\box\scratchbox}%
+ \else
+ \rlappedmathno\box\scratchbox\hss % hss makes room for number
+ \fi
+ \fi
+ \or
+ \hskip\mathnumbercorrection
+ \box\scratchbox
+ \hss
+ \else
+ \box\scratchbox
+ \fi
\egroup}
-\defineinnermathhandler\v!right{\startmathbox\empty1}{\stopmathbox\hfill0}
-\defineinnermathhandler\v!left {\startmathbox\hfill0}{\stopmathbox\empty1}
-\defineinnermathhandler\v!middle{\startmathbox\hfill0}{\stopmathbox\hfill0}
+\defineinnermathhandler\v!left {\startmathbox\plusone }{\stopmathbox}
+\defineinnermathhandler\v!middle{\startmathbox\plustwo }{\stopmathbox}
+\defineinnermathhandler\v!right {\startmathbox\plusthree}{\stopmathbox}
%D [The examples below are in english and don't process in the
%D documentation style, which will be english some day.]
@@ -1421,6 +1645,833 @@
\appendtoks \let\text\mathtext \to \everymathematics
%D \macros
+%D {\definemathalignment, setupmathalignment, startmathalignment}
+%D
+%D Modules may provide additional alignment features. The following
+%D mechanisms are provided by the core.
+
+% n>1 #### needed, strange # interaction in recurse
+
+\def\presetdisplaymath{\displ@y} % some day i will relocate the plain stuff
+
+\def\buildeqalign
+ {\scratchtoks\emptytoks
+ \dorecurse{\mathalignmentparameter\c!m}
+ {\ifnum\recurselevel>\plusone
+ \appendtoks
+ \tabskip\mathalignmentparameter\c!distance&\tabskip\zeropoint
+ \to\scratchtoks
+ \fi
+ \expanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}%
+ \dorecurse{\numexpr\mathalignmentparameter\c!n-\plusone\relax}
+ {\expanded{\scratchtoks{\the\scratchtoks\the\!!toksb}}}}%
+ \expanded{\scratchtoks{\the\scratchtoks\the\!!toksc}}}
+
+\def\forgetalign
+ {\tabskip\zeropoint\everycr\emptytoks}
+
+\let\firstineqalign\empty
+\let\nextineqalign \empty
+\let\leftofeqalign \empty
+\let\rightofeqalign\empty
+
+\def\mathineqalign#1{$\forgetalign\displaystyle{{}#1{}}$}
+\def\textineqalign#1{$\forgetalign#1$}
+
+% \def\eqalign#1% why no halign here, probably because of displaywidth
+% {\!!toksa{\strut\hfil$\displaystyle{##}$}%
+% \!!toksb{&$\displaystyle{{}##{}}$\hfil}%
+% \!!toksc\emptytoks
+% \buildeqalign
+% \null\,\vcenter
+% {\openup.25\bodyfontsize% was: \openup\jot
+% \mathsurround\zeropoint
+% \expandafter \ialign \expandafter {\the\scratchtoks\crcr#1\crcr}%
+% }\,}
+
+\def\eqalign#1% why no halign here, probably because of displaywidth
+ {\null\,\vcenter
+ {\openup.25\bodyfontsize% was: \openup\jot
+ \mathsurround\zeropoint
+ \ialign{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##{}}$\hfil\crcr#1\crcr}%
+ }\,}
+
+% preamble is scanned for tabskips so we need the span to prevent an error message
+
+\chardef\eqalignmode\plusone
+
+% \def\preparereqalignno
+% {\!!toksa{\strut\firstineqalign\hfil\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
+% \!!toksb{&\nextineqalign\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
+% \!!toksc{\hfil\tabskip\centering&\llap{\span\textineqalign{##}}\tabskip\zeropoint}%
+% \buildeqalign
+% \presetdisplaymath
+% \tabskip\centering}
+
+% \def\prepareleqalignno
+% {\!!toksa{\strut\firstineqalign\hfil\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
+% \!!toksb{&\nextineqalign\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
+% \!!toksc{\hfil\tabskip\centering&\kern-\displaywidth\rlap{\span\textineqalign{##}}\tabskip\displaywidth}%
+% \buildeqalign
+% \presetdisplaymath
+% \tabskip\centering}
+
+\def\preparereqalignno
+ {\!!toksa{\strut\firstineqalign\hfil\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
+ \!!toksb{&\nextineqalign\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
+ \ifnum\mathraggedstatus=\plusone
+ \!!toksc{\hfil&\span\textineqalign{##}\tabskip\zeropoint}%
+ \else\ifnum\mathraggedstatus=\plusthree
+ \!!toksc{\hfil\tabskip\zeropoint\!!plus 1\!!fill&\span\textineqalign{##}\tabskip\zeropoint}%
+ \else
+ \!!toksc{\hfil\tabskip\centering&\llap{\span\textineqalign{##}}\tabskip\zeropoint}%
+ \fi\fi
+ \global\chardef\mathnumberstatus\zerocount
+ \buildeqalign
+ \presetdisplaymath
+ \tabskip\centering}
+
+\def\prepareleqalignno
+ {\!!toksa{\strut\firstineqalign\hfil\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
+ \!!toksb{&\nextineqalign\leftofeqalign\span\mathineqalign{##}\rightofeqalign\tabskip\zeropoint}%
+ % problem: number is handled after rest and so ends up in the margin
+ \ifnum\mathraggedstatus=\plusone
+ \!!toksc{\hfil&\kern-\displaywidth\rlap{\span\textineqalign{##}}\tabskip\displaywidth}%
+ \else\ifnum\mathraggedstatus=\plusthree
+ \!!toksc{\hfil\tabskip\zeropoint\!!plus 1\!!fill&\kern-\displaywidth\span\mrlap{\span\textineqalign{##}}\tabskip\displaywidth}%
+ \else
+ \!!toksc{\hfil\tabskip\centering&\kern-\displaywidth\rlap{\span\textineqalign{##}}\tabskip\displaywidth}%
+ \fi\fi
+ \global\chardef\mathnumberstatus\zerocount
+ \buildeqalign
+ \presetdisplaymath
+ \tabskip\centering}
+
+\def\dobotheqalignno#1#2%
+ {\ifmmode
+ \displ@y % \let\doplaceformulanumber\relax % strange hack
+ \vcenter\bgroup
+ \let\finishalignno\egroup
+ \else
+ \let\finishalignno\relax
+ \fi
+ #1%
+ \halign \ifcase\eqalignmode \or to \displaywidth \fi \@EA {\the\scratchtoks\crcr#2\crcr}%
+ \finishalignno}
+
+% \def\dobothaligneqalignno#1%
+% {\ifmmode
+% \displ@y % \let\doplaceformulanumber\relax % strange hack
+% \vcenter\bgroup
+% \def\finishalignno{\crcr\egroup\egroup}%
+% \else
+% \def\finishalignno{\crcr\egroup}%
+% \fi
+% #1%
+% \halign \ifcase\eqalignmode \or to \displaywidth \fi \@EA \bgroup\the\scratchtoks\crcr}
+
+\def\mrlap#1%
+ {\setbox\scratchbox\hbox{#1}%
+ \ifdim\wd\scratchbox>\mathnumbercorrection
+ \xdef\mathnumbercorrection{\the\wd\scratchbox}%
+ \fi
+ \box\scratchbox
+ \global\chardef\mathnumberstatus\plustwo}
+
+\def\dobothaligneqalignno#1%
+ {\ifmmode
+ \displ@y
+ \global\chardef\mathnumberstatus\plusone
+ % we're in a mathbox
+ \vcenter\bgroup
+ \def\finishalignno{\crcr\egroup\egroup}%
+ \else
+ \def\finishalignno{\crcr\egroup}%
+ \fi
+ #1%
+ \halign \ifcase\eqalignmode \or to \displaywidth \fi \@EA \bgroup\the\scratchtoks\crcr}
+
+\def\reqalignno {\dobotheqalignno \preparereqalignno}
+\def\leqalignno {\dobotheqalignno \prepareleqalignno}
+\def\alignreqalignno{\dobothaligneqalignno\preparereqalignno}
+\def\alignleqalignno{\dobothaligneqalignno\prepareleqalignno}
+\def\finishalignno {\crcr\egroup}
+
+\let \equalignno \reqalignno
+\let\aligneqalignno\alignreqalignno
+
+%D Here we implement the user interface part.
+
+\def\setupmathalignment
+ {\dodoubleempty\dosetupmathalignment}
+
+\def\dosetupmathalignment[#1][#2]%
+ {\ifsecondargument
+ \getparameters[\??eq#1][#2]%
+ \else
+ \getparameters[\??eq][#1]%
+ \fi}
+
+\let\currentmathalignment\empty
+
+\def\mathalignmentparameter#1%
+ {\executeifdefined{\??eq\currentmathalignment#1}{\executeifdefined{\??eq#1}\empty}}
+
+\setupmathalignment
+ [\c!n=2,
+ \c!m=1,
+ \c!distance=1em]
+
+\def\numberedeqalign
+ {\doifelse\@@fmlocation\v!left\alignleqalignno\alignreqalignno}
+
+\def\doxxdoubleempty#1#2%
+ {\ifx#2[\expandafter\dodoxxdoubleempty\else\expandafter\noxxdoubleempty\fi#1#2}
+
+\def\dodoxxdoubleempty#1[#2]#3%
+ {\ifx#3[\else\expandafter\nonoxxdoubleempty\fi#1[#2]#3}
+
+\def\noxxdoubleempty #1{#1[][]}
+\def\nonoxxdoubleempty#1[#2]{#1[#2][]}
+
+\newcount\eqaligncolumn
+
+\def\firstineqalign{\global\eqaligncolumn\plusone}
+\def\nextineqalign {\global\advance\eqaligncolumn\plusone}
+\def\leftofeqalign {\getvalue{\??eq:\v!left :\number\eqaligncolumn}}
+\def\rightofeqalign{\getvalue{\??eq:\v!right:\number\eqaligncolumn}}
+
+\def\doseteqaligncolumn#1%
+ {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\empty
+ \letvalue{\??eq:\v!right:\number\eqaligncolumn}\empty
+ \doif{#1}\v!left {\letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfill}%
+ \doif{#1}\v!right {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfill}%
+ \doif{#1}\v!middle{\letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfill
+ \letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfill}}
+
+\def\dodoalignNC
+ {\gdef\doalignNC##1{&##1}}
+
+% \def\doalignNR[#1][#2]%
+% {\doifsomething{#1}
+% {\doifelse{#1}{+}
+% {\doformulanumber[][#2][]{}}
+% {\doformulanumber[#1][#2][]{}}}%
+% \crcr}
+
+\def\doalignNR[#1][#2]%
+ {\donestedformulanumber{#1}{#2}\crcr}
+
+%D \starttyping
+%D \placeformula[eqn0]\startformula \startalign[n=1] a\NR \stopalign \stopformula See \in[eqn0]
+%D \placeformula[eqn1]\startformula \startalign[n=1] a\NR \stopalign \stopformula See \in[eqn1]
+%D \placeformula \startformula \startalign[n=1] a\NR[eqn2] \stopalign \stopformula See \in[eqn2]
+%D \placeformula[eqn3]\startformula \startalign[n=1] a\NR[+] \stopalign \stopformula See \in[eqn3]
+%D \stoptyping
+
+% todo: pop in cell
+
+\def\dostartmathalignment[#1][#2]%
+ {% \begingroup not permitted ($$...assignments...\halign... )
+ \pushmacro\doalignNC
+ \edef\currentmathalignment{#1}%
+ \doifassignmentelse{#2}{\setupmathalignment[#1][#2]}\donothing
+ \def\NC{\doalignNC}%
+ \global\let\doalignNC\dodoalignNC
+ \def\EQ{&=}%
+ \def\NR{&\global\let\doalignNC\dodoalignNC\doxxdoubleempty\doalignNR}%
+ % amstex compatibility mode: (ugly, will disappear)
+ \def\notag{\def\\{&\crcr}}%
+ \doifelse{#2}{*}{\def\\{&\crcr}}{\def\\{&\doalignNR[+][]\crcr}}%
+ % end of compatibility mode
+ \eqaligncolumn\zerocount
+ \processcommacommand
+ [\mathalignmentparameter\c!align]
+ {\advance\eqaligncolumn\plusone\doseteqaligncolumn}% takes argument
+ % the real action
+ \global\eqaligncolumn\plusone
+ \numberedeqalign}
+
+\def\dostopmathalignment
+ {\finishalignno
+ \popmacro\doalignNC}
+
+\def\definemathalignment
+ {\dodoubleempty\dodefinemathalignment}
+
+\def\dodefinemathalignment[#1]% [#2]%
+ {\setvalue{\e!start#1}{\dodoubleempty\dostartmathalignment[#1]}%
+ \setvalue{\e!stop #1}{\dostopmathalignment}%
+ \setupmathalignment[#1]}% [#2]
+
+%D For the moment we only provide english commands.
+
+\definemathalignment[align] % default case (this is what amstex users expect)
+\definemathalignment[\v!mathalignment] % prefered case (this is cleaner, less clashing)
+
+% \def\startsplit
+% {\startalign[*]} % no number by default
+%
+% \def\stopsplit
+% {&\doalignNR[+][]\crcr % for a number on last line
+% \stopalign}
+
+%D \startbuffer
+%D \placeformula \startformula \eqalignno {
+%D a &= b & \formulanumber \cr
+%D c &= d \cr
+%D &= e \cr
+%D &= f & \formulanumber
+%D } \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign
+%D \NC a \EQ b \NR[+]
+%D \NC c \EQ d \NR
+%D \NC \EQ f \NR[for:demo-a-1]
+%D \NC \EQ g \NR[for:demo-a-2][a]
+%D \NC \EQ h \NR[for:demo-a-3][b]
+%D \NC \EQ i \NR
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign
+%D \NC a \EQ b \NR[+]
+%D \NC c \EQ d \NR
+%D \NC \EQ f \NR
+%D \NC \EQ g \NR
+%D \NC \EQ h \NR
+%D \NC \EQ i \NR[+]
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign
+%D a &= b \\
+%D c &= d \notag \\
+%D &= e \notag \\
+%D &= f \\
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign
+%D \NC a \NC \eq b \NR[+]
+%D \NC c \NC \neq d \NR
+%D \NC \NC \neq f \NR[for:demo-b-1]
+%D \NC \NC \geq g \NR[for:demo-b-2][a]
+%D \NC \NC \leq h \NR[for:demo-b-3][b]
+%D \NC \NC \neq i \NR
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign[*]
+%D a &= b \\
+%D c &= d \\
+%D &= e \\
+%D &= f \\
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign
+%D x &= y \\
+%D a &= b \\
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign[m=3]
+%D x &= y & x &= y & z &= t \\
+%D a &= b & p &= q & w &= s \\
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign[m=3,distance=0pt]
+%D x &= y &= x &= y &= z &= t \\
+%D a &= b &= p &= q &= w &= s \\
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign[n=5,distance=0pt]
+%D x &= yy &= xx &= yy &= zz \\
+%D a &= b &= p &= q &= w \\
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign[n=3,align={left,middle,right}]
+%D \NC l \NC = \NC r \NR
+%D \NC left \NC = \NC right \NR
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign[n=3,align={right,middle,left}]
+%D \NC l \NC = \NC r \NR
+%D \NC left \NC = \NC right \NR
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startalign[n=3,align={middle,middle,middle}]
+%D \NC l \NC = \NC r \NR
+%D \NC left \NC = \NC right \NR
+%D \stopalign \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula
+%D \startformula
+%D \startalign[n=3,align={middle,middle,middle}]
+%D \NC a \NC = \NC b \NR[+]
+%D \NC 2a \NC = \NC 2b \NR
+%D \stopalign
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula
+%D \startformulas
+%D \setupmathalignment[n=3,align={middle,middle,middle}]%
+%D \startformula
+%D \startalign
+%D \NC a \NC = \NC b \NR[+]
+%D \NC 2a \NC = \NC 2b \NR
+%D \stopalign
+%D \stopformula
+%D \startformula
+%D \startalign
+%D \NC a \NC = \NC b \NR[+]
+%D \NC 2a \NC = \NC 2b \NR
+%D \stopalign
+%D \stopformula
+%D \stopformulas
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula
+%D \startformulas
+%D \dorecurse{5}{\startformula
+%D \startalign[n=3,align={middle,middle,middle}]
+%D \NC a \NC = \NC b \NR[+]
+%D \NC 2a \NC = \NC 2b \NR
+%D \stopalign
+%D \stopformula}
+%D \stopformulas
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+%D \macros
+%D {definemathcases, setupmathcases, startmathcases}
+%D
+%D Another wish \unknown
+
+\def\setupmathcases
+ {\dodoubleempty\dosetupmathcases}
+
+\def\dosetupmathcases[#1][#2]%
+ {\ifsecondargument
+ \getparameters[\??ce#1][#2]%
+ \else
+ \getparameters[\??ce][#1]%
+ \fi}
+
+\let\currentmathcases\empty
+
+\def\mathcasesparameter#1%
+ {\executeifdefined{\??ce\currentmathcases#1}{\executeifdefined{\??ce#1}\empty}}
+
+\setupmathcases
+ [\c!distance=1em,
+ \c!numberdistance=2.5em,
+ \c!left={\left\{\,},
+ \c!right={\right.}]
+
+\def\dodocasesNC
+ {\gdef\docasesNC{\endmath&}}
+
+\let\docasesNR\doalignNR
+
+\def\dostartmathcases[#1][#2]%
+ {\begingroup
+ \edef\currentmathcases{#1}%
+ \doifassignmentelse{#2}{\setupmathcases[#1][#2]}\donothing
+ \mathcasesparameter\c!left
+ \vcenter\bgroup
+ \pushmacro\docasesNC
+ \let\endmath\relax
+ \def\NC{\docasesNC}%
+ \def\MC{\docasesNC\ifmmode\else$\def\endmath{$}\fi}%
+ \global\let\docasesNC\dodocasesNC
+ \def\NR{\unskip\endmath&\global\let\docasesNC\dodocasesNC\doxxdoubleempty\docasesNR}%
+ \normalbaselines
+ \mathsurround\zeropoint
+ \everycr\emptytoks
+ \tabskip\zeropoint
+ \global\eqaligncolumn\plusone
+ \halign\bgroup
+ $\mathcasesparameter\c!style##$\hfil
+ &\hskip\mathcasesparameter\c!distance\relax
+ \popmacro\docasesNC##\hfil
+ &\hskip\mathcasesparameter\c!numberdistance\relax
+ \let\formuladistance\!!zeropoint
+ \span\textineqalign{##}%
+ \crcr} % todo: number
+
+\def\dostopmathcases
+ {\crcr
+ \egroup
+ \popmacro\docasesNC
+ \egroup
+ \mathcasesparameter\c!right
+ \endgroup}
+
+\def\definemathcases
+ {\dodoubleempty\dodefinemathcases}
+
+\def\dodefinemathcases[#1]% [#2]%
+ {\setvalue{\e!start#1}{\dodoubleempty\dostartmathcases[#1]}%
+ \setvalue{\e!stop #1}{\dostopmathcases}%
+ \setupmathcases[#1]}% [#2]
+
+\definemathcases[cases]
+\definemathcases[\v!mathcases]
+
+%D \startbuffer
+%D \placeformula \startformula \startcases
+%D \NC 2 \NC $ y > 0 $ \NR
+%D \NC 7 \NC $ x = 7 $ \NR[+]
+%D \NC 4 \NC otherwise \NR
+%D \stopcases \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula x \startcases
+%D \NC 2 \NC $ y > 0 $ \NR[+]
+%D \NC 7 \NC $ x = 7 $ \NR
+%D \NC 4 \NC otherwise \NR
+%D \stopcases \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula \startcases
+%D \NC 2 \NC $ y > 0 $ \NR
+%D \NC 7 \NC $ x = 7 $ \NR
+%D \NC 4 \NC otherwise \NR
+%D \stopcases \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \placeformula \startformula x \startcases
+%D \NC 2 \NC $ y > 0 $ \NR
+%D \NC 7 \NC $ x = 7 $ \NR
+%D \NC 4 \NC otherwise \NR
+%D \stopcases \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+%D \macros
+%D {definemathmatrix, setupmathmatrix, startmathmatrix}
+%D
+%D Yet another one \unknown
+
+\def\setupmathmatrix
+ {\dodoubleempty\dosetupmathmatrix}
+
+\def\dosetupmathmatrix[#1][#2]%
+ {\ifsecondargument
+ \getparameters[\??mx#1][#2]%
+ \else
+ \getparameters[\??mx][#1]%
+ \fi}
+
+\let\currentmathmatrix\empty
+
+\def\mathmatrixparameter#1%
+ {\executeifdefined{\??mx\currentmathmatrix#1}{\executeifdefined{\??mx#1}\empty}}
+
+\setupmathmatrix
+ [\c!distance=1em,
+ \c!left=,
+ \c!right=,
+ \c!align=\v!middle]
+
+\def\dosetmatrixcolumn#1% hh: todo: \definematrixalign
+ {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfil
+ \letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfil
+ \doif{#1}\v!left {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\relax
+ \letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfil}%
+ \doif{#1}\v!right {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfil
+ \letvalue{\??eq:\v!right:\number\eqaligncolumn}\relax }%
+ \doif{#1}\v!middle{\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfil
+ \letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfil}}
+
+\def\buildmathmatrix % beware: etex only
+ {\scratchtoks\emptytoks
+ \expanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}%
+ \dorecurse{\numexpr\scratchcounter-\plusone\relax}
+ {\expanded{\scratchtoks{\the\scratchtoks\the\!!toksb}}}%
+ \expanded{\scratchtoks{\the\scratchtoks\the\!!toksc }}}
+
+\def\preparemathmatrix
+ {\!!toksa{\strut \firstineqalign\leftofeqalign \span
+ \textineqalign{\mathmatrixparameter\c!style ##}\rightofeqalign}%
+ \!!toksb{&\hskip\mathmatrixparameter\c!distance
+ \nextineqalign\leftofeqalign \span
+ \textineqalign{\mathmatrixparameter\c!style ##}\rightofeqalign}%
+ \!!toksc{&&\hskip\mathmatrixparameter\c!distance
+ \leftofeqalign \span
+ \textineqalign{\mathmatrixparameter\c!style ##}\rightofeqalign}%
+ \buildmathmatrix
+ \halign \@EA \bgroup\the\scratchtoks \crcr}
+
+\def\definemathmatrix
+ {\dodoubleempty\dodefinemathmatrix}
+
+\def\dodefinemathmatrix[#1]% [#2]%
+ {\setvalue{\e!start#1}{\dodoubleempty\dostartmathmatrix[#1]}%
+ \setvalue{\e!stop #1}{\dostopmathmatrix}%
+ \setupmathmatrix[#1]}% [#2]
+
+\definemathmatrix[matrix]
+\definemathmatrix[\v!mathmatrix]
+
+\def\dodomatrixNC
+ {\gdef\domatrixNC{\endmath&}}
+
+\def\dostartmathmatrix[#1][#2]%
+ {\begingroup
+ \edef\currentmathmatrix{#1}%
+ \doifassignmentelse{#2}{\setupmathmatrix[#1][#2]}\donothing
+ \null
+ \mathmatrixparameter\c!left
+ \processaction
+ [\mathmatrixparameter\c!location]
+ [ \v!high=>\let\vchbox\vtop,
+ \v!low=>\let\vchbox\vbox,
+ \v!lohi=>\let\vchbox\vcenter,
+ \v!top=>\let\vchbox\vtop,
+ \v!bottom=>\let\vchbox\vbox,
+ \s!default=>\let\vchbox\vcenter,
+ \s!unknown=>\let\vchbox\vcenter]%
+ \vchbox\bgroup
+ \pushmacro\domatrixNC
+ \let\endmath\relax
+ \def\NC{\domatrixNC}%
+ \def\MC{\domatrixNC\ifmmode\else$\def\endmath{$}\fi}%
+ \global\let\domatrixNC\dodomatrixNC
+ \def\NR{\endmath\global\let\domatrixNC\dodomatrixNC\crcr}%
+ \normalbaselines
+ \mathsurround\zeropoint
+ \everycr\emptytoks
+ \tabskip\zeropoint
+ \eqaligncolumn\zerocount % could be \scratchcounter
+ \processcommacommand[\mathmatrixparameter\c!align]{\advance\eqaligncolumn\plusone\dosetmatrixcolumn}%
+ \scratchcounter=\ifnum\eqaligncolumn>\scratchcounter \eqaligncolumn \else \plusone \fi
+ \global\eqaligncolumn\plusone
+ \preparemathmatrix } % uses scratchcounter
+
+\def\dostopmathmatrix
+ {\crcr
+ \mathstrut\crcr
+ \noalign{\kern-\baselineskip}%
+ \egroup
+ \popmacro\domatrixNC
+ \egroup
+ \mathmatrixparameter\c!right
+ \endgroup}
+
+%D \startbuffer
+%D \placeformula \startformula[-] \startmatrix
+%D \NC 1 \NC x \NC a \NR
+%D \NC 2 \NC y \NC b \NR
+%D \NC 3 \NC z \NC c \NR
+%D \stopmatrix \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \definemathmatrix[bmatrix][left={\left[\,},right={\,\right]}]
+%D
+%D \startbuffer
+%D \placeformula \startformula[-] \startbmatrix
+%D \NC 1 \NC x \NC a \NR
+%D \NC 2 \NC y \NC b \NR
+%D \NC 3 \NC z \NC c \NR
+%D \stopbmatrix \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D Taco added some code (dedicated to Aditya Mahajan) that gives more
+%D control over aligments:
+
+%D \startbuffer
+%D \startformula
+%D \startmatrix
+%D \NC a + x \NC = \NC a + d \NR
+%D \NC y \NC = \NC d \NR
+%D \stopmatrix
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+%D \startbuffer
+%D \startformula
+%D \startmatrix [distance=3pt,align={right,left}]
+%D \NC a + x \NC = a + d \NR
+%D \NC y \NC = d \NR
+%D \stopmatrix
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+%D \startbuffer
+%D \startformula
+%D \startmatrix [left=\left(,right=\right)]
+%D \NC a + x \NR
+%D \NC y \NR
+%D \stopmatrix
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D A bit more complex code:
+%D
+%D \startbuffer
+%D \startformula
+%D \startformula
+%D \text{Let }{\cal R} = \bigcup_{P_{X_1},P_{X_2}}
+%D \left\{ (R_1, R_2) :
+%D \startmatrix[distance=1em,align={left,left,right}]
+%D \NC R_1 \NC < I(X_1 ; Y \mid X_2) \NC R_1 \NR
+%D \NC \hfill Q_2 \NC < I(X_2 ; Y \mid X_1) \NC R_2 \NR
+%D \NC R_1 + R_2 \NC < I(X_1 ; Y) \NC R_1 + R_2 \NR
+%D \stopmatrix
+%D \right\}
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+%D \macros
+%D {startintertext}
+%D
+%D Preliminary feature:
+%D
+%D {\em example code}
+
+% \def\startintertext#1\stopintertext
+% {\noalign{\dointertext{#1}}\NR}
+
+% \unexpanded\def\dointertext#1%
+% {\penalty\postdisplaypenalty
+% \afterdisplayspace % the matching \before... is not needed
+% \vbox{\forgetall\noindent#1\par}%
+% \penalty\postdisplaypenalty}
+
+\def\startintertext#1\stopintertext
+ {\noalign{\dointertext{#1}}}
+
+\def\intertext#1%
+ {\noalign{\dointertext{#1}}}
+
+\unexpanded\def\dointertext#1%
+ {\penalty\postdisplaypenalty
+ \afterdisplayspace
+ \vbox{\forgetall\noindent#1\par}%
+ \penalty\predisplaypenalty
+ \beforedisplayspace}
+
+%D \macros
+%D {substack}
+%D
+%D Preliminary code:
+%D
+%D \starttyping
+%D \startformula
+%D \sum_{%
+%D \startsubstack
+%D i = 1 \NR
+%D i \neq n \NR
+%D i \neq m
+%D \stopsubstack
+%D }a_i
+%D \stopformula
+%D \stoptyping
+
+\def\startsubstack
+ {\begingroup
+ \null
+ \vcenter\bgroup
+ \pushmacro\domatrixNC
+ \let\stopmathmode\relax
+ \def\NC{\domatrixNC}%
+ \def\MC{\domatrixNC\startmathmode}%
+ \global\let\domatrixNC\dodomatrixNC
+ \def\NR
+ {\stopmathmode
+ \global\let\domatrixNC\dodomatrixNC
+ \crcr\noalign{\nointerlineskip}}%
+ \mathsurround\zeropoint
+ \everycr\emptytoks
+ \halign\bgroup\hfil$\scriptstyle\mathstrut##$\hfil\crcr}
+
+\def\stopsubstack
+ {\crcr
+ \egroup
+ \popmacro\domatrixNC
+ \egroup
+ \endgroup}
+
+%D \macros
%D {frac, xfrac, xxfrac}
%D
%D This is another one Tobias asked for. It replaces the
@@ -1595,6 +2646,21 @@
\def\positive {\doraisedmathord{positive}}
\def\zeroamount{\donumbermathord{zeroamount}}
+%D The following macros are used in the MathML interpreter, so
+%D there is a good change of them never being documented for
+%D other usage.
+
+\let\normalordelimiter\secondoftwoarguments
+\let\normalorfiller \firstoftwoarguments
+
+\def\enabledelimiter {\let\normalordelimiter\secondoftwoarguments}
+\def\disabledelimiter{\let\normalordelimiter\firstoftwoarguments}
+
+\def\enablefiller {\let\normalorfiller\secondoftwoarguments}
+\def\disablefiller {\let\normalorfiller\firstoftwoarguments}
+
+\def\mathopnolimits#1{\mathop{\rm#1}\nolimits}
+
%D How negative such a symbol looks is demonstrated in:
%D $\negative 10^{\negative 10^{\negative 10}}$.
diff --git a/Master/texmf-dist/tex/context/base/core-mis.tex b/Master/texmf-dist/tex/context/base/core-mis.tex
index acd84554e7f..0b103243656 100644
--- a/Master/texmf-dist/tex/context/base/core-mis.tex
+++ b/Master/texmf-dist/tex/context/base/core-mis.tex
@@ -52,6 +52,7 @@
% 3: incercati LaTeX
% \stopmessages
%
+
% %D You would not expect the next macro in \CONTEXT,
% %D wouldn't you? It's there to warn \LATEX\ users that
% %D something is wrong.
@@ -88,7 +89,8 @@
\appendtoks \def\MetaPost{MetaPost}\to\simplifiedcommands
\appendtoks \def\MetaFont{MetaFont}\to\simplifiedcommands
\appendtoks \def\MetaFun{MetaFun}\to\simplifiedcommands
-\appendtoks \def||{-}\to\simplifiedcommands
+%appendtoks \def||{-}\to\simplifiedcommands
+\appendtoks \def|#1|{\ifx#1\empty\empty-\else#1\fi}\to\simplifiedcommands
\appendtoks\let\buildtextaccent\secondoftwoarguments\to\simplifiedcommands
@@ -236,106 +238,328 @@
%
% Overigens kan een en ander mooier met \halign.
+% \def\dodefineparagraphs[#1][#2]%
+% {\setvalue{\s!do\s!next#1}%
+% {\def\\{\getvalue{#1}}}%
+% \setvalue{#1}%
+% {\getvalue{\s!do\s!next#1}%
+% \dostartparagraphs{#1}}%
+% \setvalue{\e!next#1}%
+% {\getvalue{#1}}%
+% \setvalue{\e!start#1}%
+% {\bgroup
+% \letvalue{\s!do\s!next#1}\empty
+% \setvalue{\e!stop#1}%
+% {\getvalue{#1}%
+% \egroup}%
+% \getvalue{#1}}%
+% \getparameters[\??al#1]%
+% [\c!n=3,
+% \c!before=\blank,
+% \c!after=\blank,
+% \c!distance=1em,
+% \c!height=\v!fit,
+% \c!rule=\v!off,
+% \c!command=,
+% \c!align=,
+% \c!tolerance=\v!tolerant,
+% \c!rulethickness=\linewidth,
+% \c!style=,
+% \c!color=,
+% \c!top=,
+% \c!top=\vss,
+% \c!bottom=\vfill,
+% #2]%
+% \setvalue{\e!setup#1\e!endsetup}%
+% {\setupparagraphs[#1]}%
+% \dorecurse
+% {\getvalue{\??al#1\c!n}}
+% {\setupparagraphs[#1][\recurselevel]
+% [\c!width=,
+% \c!bottom=\getvalue{\??al#1\c!bottom},
+% \c!top=\getvalue{\??al#1\c!top},
+% \c!height=\getvalue{\??al#1\c!height},
+% \c!style=\getvalue{\??al#1\c!style},
+% \c!color=\getvalue{\??al#1\c!color},
+% \c!rule=\getvalue{\??al#1\c!rule},
+% \c!rulethickness=\getvalue{\??al#1\c!rulethickness},
+% \c!align=\getvalue{\??al#1\c!align},
+% \c!tolerance=\getvalue{\??al#1\c!tolerance},
+% \c!distance=\getvalue{\??al#1\c!distance}]}%
+% \setupparagraphs[#1][1][\c!distance=0em]}
+%
+% \def\defineparagraphs
+% {\dodoubleargument\dodefineparagraphs}
+%
+% \def\dosetupparagraphs[#1][#2][#3]%
+% {\doifelse{#2}\v!each
+% {\dorecurse
+% {\getvalue{\??al#1\c!n}}
+% {\getparameters[\??al#1\recurselevel][#3]}}
+% {\ConvertToConstant\doifelse{#3}{}
+% {\getparameters[\??al#1][#2]}
+% {\def\docommando##1%
+% {\getparameters[\??al#1##1][#3]}%
+% \processcommalist[#2]\docommando}}}
+%
+% \def\setupparagraphs
+% {\dotripleempty\dosetupparagraphs}
+%
+% \newcount\alcounter
+% \newcount\alnsize
+% \newdimen\alhsize
+%
+% \def\doparagraphrule#1#2%
+% {\doifelsevalue{\??al#2\the\alcounter\c!rule}\v!on
+% {\linewidth\getvalue{\??al#2\the\alcounter\c!rulethickness}%
+% \scratchdimen#1%
+% \advance\scratchdimen-\linewidth
+% \divide\scratchdimen \plustwo
+% \hskip\scratchdimen
+% \vrule\!!width\linewidth
+% \hskip\scratchdimen}
+% {\hskip#1}}
+%
+% \def\dostartparagraph#1%
+% {\doifelsevaluenothing{\??al#1\the\alcounter\c!width}
+% {\!!widtha\alhsize
+% \divide\!!widtha \alnsize}
+% {\!!widtha\getvalue{\??al#1\the\alcounter\c!width}}%
+% \dostartattributes
+% {\??al#1\the\alcounter}\c!style\c!color
+% \empty
+% \doifelsevalue{\??al#1\the\alcounter\c!height}\v!fit
+% {\setbox0\vtop}
+% {\setbox0\vtop to \getvalue{\??al#1\the\alcounter\c!height}}%
+% \bgroup
+% \blank[\v!disable]%
+% \forgetall
+% \getvalue{\??al#1\the\alcounter\c!top}%
+% \getvalue{\??al#1\c!inner}%
+% \hsize\!!widtha % setting \wd afterwards removed
+% \getvalue{\??al#1\the\alcounter\c!inner}%
+% \edef\!!stringa{\getvalue{\??al#1\the\alcounter\c!align}}% nodig?
+% \expandafter\setupalign\expandafter[\!!stringa]%
+% \edef\!!stringa{\getvalue{\??al#1\the\alcounter\c!tolerance}}% nodig?
+% \expandafter\setuptolerance\expandafter[\!!stringa]%
+% \ignorespaces
+% \endgraf
+% \ignorespaces
+% %
+% % Nadeel van de onderstaande constructie is dat \everypar
+% % binnen een groep kan staan en zo steeds \begstruts
+% % worden geplaatst. Mooi is anders dus moet het anders!
+% %
+% % Hier is \Everypar niet nodig.
+% %
+% \everypar{\begstrut\everypar\emptytoks}%
+% %
+% \ignorespaces\geenspatie % dubbel: \ignorespaces
+% \getvalue{\??al#1\the\alcounter\c!command}}
+%
+% \def\dostopparagraph#1%
+% {\ifvmode
+% \removelastskip
+% \else
+% \unskip\endstrut\endgraf
+% \fi
+% \getvalue{\??al#1\the\alcounter\c!bottom}%
+% \egroup
+% \ifdim\wd0=\zeropoint % no data
+% \wd0\!!widtha
+% \fi
+% \box0
+% \dostopattributes
+% %\ifnum\alcounter<\getvalue{\??al#1\c!n}\relax
+% % \def\next{\doparagraphcell{#1}}%
+% %\else
+% % \def\next{\dostopparagraphs{#1}}%
+% %\fi
+% %\next}
+% \ifnum\alcounter<\getvalue{\??al#1\c!n}\relax
+% \@EA\doparagraphcell
+% \else
+% \@EA\dostopparagraphs
+% \fi{#1}}
+%
+% \def\doparagraphcell#1%
+% {\global\advance\alcounter \plusone
+% \doifelsevaluenothing{\??al#1\the\alcounter\c!distance}
+% {\doifnot{\the\alcounter}{1}
+% {\hskip\getvalue{\??al#1\c!distance}}}
+% {\doifelse{\the\alcounter}{1}%
+% {\hskip\getvalue{\??al#1\the\alcounter\c!distance}}
+% {\doparagraphrule{\getvalue{\??al#1\the\alcounter\c!distance}}{#1}}}%
+% \setvalue{#1}{\dostopparagraph{#1}}%
+% \dostartparagraph{#1}}
+%
+% \def\dostartparagraphs#1%
+% {\global\alcounter\zerocount
+% \parindent\zeropoint
+% \setlocalhsize
+% \alhsize\localhsize
+% \alnsize\getvalue{\??al#1\c!n}\relax
+% \dorecurse
+% {\getvalue{\??al#1\c!n}}
+% {\doifelsevaluenothing{\??al#1\recurselevel\c!distance}
+% {\ifnum\recurselevel=\plusone\else
+% \global\advance\alhsize -\getvalue{\??al#1\c!distance}\relax
+% \fi}
+% {\global\advance\alhsize -\getvalue{\??al#1\recurselevel\c!distance}\relax}%
+% \doifvaluesomething{\??al#1\recurselevel\c!width}
+% {\global\advance\alnsize \minusone
+% \global\advance\alhsize -\getvalue{\??al#1\recurselevel\c!width}\relax}}%
+% %\whitespace % gaat fout bij \framed
+% \getvalue{\??al#1\c!before}%
+% \leavevmode % gaat wel goed bij \framed, brrr
+% \setbox\scratchbox\vbox\bgroup\hbox\bgroup\doparagraphcell{#1}}
+%
+% \def\dostopparagraphs#1%
+% {\egroup
+% \egroup
+% \iftrue
+% \hbox{\raise\strutheight\box\scratchbox}% new
+% \else
+% \box\scratchbox % old
+% \fi
+% \par
+% \getvalue{\??al#1\c!after}}%
+
+% there is quite some historic balast in this mechanism, the next variant
+% is a first cleanup
+
+\let\currentparagraph\empty
+
+\newcount\alcounter \newcount\alnsize \newdimen\alhsize
+
+\def\paragraphparameter#1% \checkedparameter\??al\currentparagraph#1
+ {\executeifdefined{\??al\currentparagraph#1}{\executeifdefined{\??al#1}\empty}}
+
+\def\paragraphcellmeter#1#2% \checkedparameter\??al\currentparagraph#1
+ {\executeifdefined{\??al\currentparagraph\number#1#2}{\paragraphparameter{#2}}}
+
\def\dodefineparagraphs[#1][#2]%
- {\setvalue{\s!do\s!next#1}%
- {\def\\{\getvalue{#1}}}%
- \setvalue{#1}%
+ {\edef\currentparagraph{#1}%
+ \setvalue{\s!do\s!next\currentparagraph}%
+ {\def\\{\getvalue\currentparagraph}}%
+ \setvalue\currentparagraph
{\getvalue{\s!do\s!next#1}%
- \dostartalineas{#1}}%
- \setvalue{\e!next#1}%
+ \dostartparagraphs{#1}}%
+ \setvalue{\e!next\currentparagraph}%
{\getvalue{#1}}%
- \setvalue{\e!start#1}%
+ \setvalue{\e!start\currentparagraph}%
{\bgroup
- \letvalue{\s!do\s!next#1}\empty
- \setvalue{\e!stop#1}%
- {\getvalue{#1}%
- \egroup}%
- \getvalue{#1}}%
- \getparameters[\??al#1]%
- [\c!n=3,
- \c!before=\blank,
- \c!after=\blank,
- \c!distance=1em,
- \c!height=\v!fit,
- \c!rule=\v!off,
- \c!command=,
- \c!align=,
- \c!tolerance=\v!tolerant,
- \c!style=,
- \c!color=,
- \c!top=,
- \c!top=\vss,
- \c!bottom=\vfill,
+ \edef\currentparagraph{#1}%
+ \letvalue{\s!do\s!next\currentparagraph}\empty
+ \setvalue{\e!stop\currentparagraph}{\getvalue\currentparagraph\egroup}%
+ \getvalue\currentparagraph}%
+ \getparameters[\??al\currentparagraph]%
+ [%\c!n=3,
+ %\c!before=\blank,
+ %\c!after=\blank,
+ %\c!distance=1em,
+ %\c!height=\v!fit,
+ %\c!rule=\v!off,
+ %\c!command=,
+ %\c!align=,
+ %\c!tolerance=\v!tolerant,
+ %\c!rulethickness=\linewidth,
+ %\c!rulecolor=,
+ %\c!style=,
+ %\c!color=,
+ %\c!top=,
+ %\c!top=\vss,
+ %\c!bottom=\vfill,
#2]%
\setvalue{\e!setup#1\e!endsetup}%
{\setupparagraphs[#1]}%
\dorecurse
- {\getvalue{\??al#1\c!n}}
- {\setupparagraphs[#1][\recurselevel]
+ {\paragraphparameter\c!n}
+ {\setupparagraphs
+ [\currentparagraph]
+ [\recurselevel]
[\c!width=,
- \c!bottom=\getvalue{\??al#1\c!bottom},
- \c!top=\getvalue{\??al#1\c!top},
- \c!height=\getvalue{\??al#1\c!height},
- \c!style=\getvalue{\??al#1\c!style},
- \c!color=\getvalue{\??al#1\c!color},
- \c!rule=\getvalue{\??al#1\c!rule},
- \c!align=\getvalue{\??al#1\c!align},
- \c!tolerance=\getvalue{\??al#1\c!tolerance},
- \c!distance=\getvalue{\??al#1\c!distance}]}%
- \setupparagraphs[#1][1][\c!distance=0em]}
+ %\c!bottom=\paragraphparameter\c!bottom,
+ %\c!top=\paragraphparameter\c!top,
+ %\c!height=\paragraphparameter\c!height,
+ %\c!rule=\paragraphparameter\c!rule,
+ %\c!rulethickness=\paragraphparameter\c!rulethickness,
+ %\c!rulecolor=\paragraphparameter\c!rulecolor,
+ %\c!align=\paragraphparameter\c!align,
+ %\c!tolerance=\paragraphparameter\c!tolerance, % obsolete
+ %\c!distance=\paragraphparameter\c!distance,
+ \c!style=\paragraphparameter\c!style,
+ \c!color=\paragraphparameter\c!color]}%
+ \setupparagraphs[\currentparagraph][1][\c!distance=\zeropoint]}
\def\defineparagraphs
{\dodoubleargument\dodefineparagraphs}
\def\dosetupparagraphs[#1][#2][#3]%
- {\doifelse{#2}\v!each
- {\dorecurse
- {\getvalue{\??al#1\c!n}}
- {\getparameters[\??al#1\recurselevel][#3]}}
- {\ConvertToConstant\doifelse{#3}{}
- {\getparameters[\??al#1][#2]}
- {\def\docommando##1%
- {\getparameters[\??al#1##1][#3]}%
- \processcommalist[#2]\docommando}}}
+ {\edef\currentparagraph{#1}%
+ \ifsecondargument
+ \doifelse{#2}\v!each
+ {\dorecurse
+ {\paragraphparameter\c!n}
+ {\getparameters[\??al\currentparagraph\recurselevel][#3]}}
+ {\doifelsenothing{#3}
+ {\getparameters[\??al\currentparagraph][#2]}
+ {\def\docommand##1{\getparameters[\??al\currentparagraph##1][#3]}%
+ \processcommalist[#2]\docommand}}%
+ \else
+ \getparameters[\??al][#1]%
+ \fi}
\def\setupparagraphs
{\dotripleempty\dosetupparagraphs}
-\newcount\alteller
-\newcount\alnsize
-\newdimen\alhsize
-
-\def\doalinealijn#1#2%
- {\doifelsevalue{\??al#2\the\alteller\c!rule}\v!on
- {\dimen2=#1\relax
- \hskip.5\dimen2
- \hskip-\linewidth
- \vrule\!!width\linewidth
- \hskip.5\dimen2}
- {\hskip#1}}
-
-\def\dostartalinea#1%
- {\doifelsevaluenothing{\??al#1\the\alteller\c!width}
+\setupparagraphs
+ [\c!n=3,
+ \c!before=\blank,
+ \c!after=\blank,
+ \c!distance=1em,
+ \c!height=\v!fit,
+ \c!rule=\v!off,
+ \c!command=,
+ \c!align=,
+ \c!tolerance=\v!tolerant, % obsolete
+ \c!rulethickness=\linewidth,
+ \c!rulecolor=,
+ \c!style=,
+ \c!color=,
+ \c!top=,
+ \c!top=\vss,
+ \c!bottom=\vfill]
+
+\def\doparagraphrule
+ {\doifelse{\paragraphcellmeter\alcounter\c!rule}\v!on
+ {\linewidth\paragraphcellmeter\alcounter\c!rulethickness
+ \scratchdimen\paragraphcellmeter\alcounter\c!distance
+ \advance\scratchdimen-\linewidth
+ \divide\scratchdimen \plustwo
+ \hskip\scratchdimen
+ \color[\paragraphcellmeter\alcounter\c!rulecolor]{\vrule\!!width\linewidth}%
+ \hskip\scratchdimen}
+ {\hskip\paragraphcellmeter\alcounter\c!distance}}
+
+\def\dostartparagraph
+ {\doifelsenothing{\paragraphcellmeter\alcounter\c!width}
{\!!widtha\alhsize
\divide\!!widtha \alnsize}
- {\!!widtha\getvalue{\??al#1\the\alteller\c!width}}%
- \dostartattributes
- {\??al#1\the\alteller}\c!style\c!color
- \empty
- \doifelsevalue{\??al#1\the\alteller\c!height}\v!fit
- {\setbox0\vtop}
- {\setbox0\vtop to \getvalue{\??al#1\the\alteller\c!height}}%
+ {\!!widtha\paragraphcellmeter\alcounter\c!width}%
+ \dostartattributes{\??al\currentparagraph\number\alcounter}\c!style\c!color\empty
+ \doifelse{\paragraphcellmeter\alcounter\c!height}\v!fit
+ {\setbox\scratchbox\vtop}
+ {\setbox\scratchbox\vtop to \paragraphcellmeter\alcounter\c!height}%
\bgroup
\blank[\v!disable]%
\forgetall
- \getvalue{\??al#1\the\alteller\c!top}%
- \getvalue{\??al#1\c!inner}%
- \hsize\!!widtha % setting \wd afterwards removed
- \getvalue{\??al#1\the\alteller\c!inner}%
- \edef\!!stringa{\getvalue{\??al#1\the\alteller\c!align}}% nodig?
- \expandafter\setupalign\expandafter[\!!stringa]%
- \edef\!!stringa{\getvalue{\??al#1\the\alteller\c!tolerance}}% nodig?
- \expandafter\setuptolerance\expandafter[\!!stringa]%
+ \paragraphcellmeter\alcounter\c!top
+ \paragraphparameter\c!inner
+ \hsize\!!widtha % setting \wd afterwards removed
+ \paragraphcellmeter\alcounter\c!inner % twice
+ \expanded{\setupalign [\paragraphcellmeter\alcounter\c!align ]}% {normal,verytolerant,stretch}
+ \expanded{\setuptolerance[\paragraphcellmeter\alcounter\c!tolerance]}% obsolete
\ignorespaces
\endgraf
\ignorespaces
@@ -348,70 +572,75 @@
%
\everypar{\begstrut\everypar\emptytoks}%
%
- \ignorespaces\geenspatie % dubbel: \ignorespaces
- \getvalue{\??al#1\the\alteller\c!command}}
+ \nospace % remove + ignore
+ \paragraphcellmeter\alcounter\c!command}
-\def\dostopalinea#1%
+\def\dostopparagraph
{\ifvmode
\removelastskip
\else
\unskip\endstrut\endgraf
\fi
- \getvalue{\??al#1\the\alteller\c!bottom}%
+ \paragraphcellmeter\alcounter\c!bottom
\egroup
- \ifdim\wd0=\zeropoint % no data
- \wd0\!!widtha
+ \ifdim\wd\scratchbox=\zeropoint % no data
+ \wd\scratchbox\!!widtha
\fi
- \box0
+ \box\scratchbox
\dostopattributes
- %\ifnum\alteller<\getvalue{\??al#1\c!n}\relax
- % \def\next{\doalinea{#1}}%
- %\else
- % \def\next{\dostopalineas{#1}}%
- %\fi
- %\next}
- \ifnum\alteller<\getvalue{\??al#1\c!n}\relax
- \@EA\doalinea
+ \ifnum\alcounter<\paragraphparameter\c!n\relax
+ \@EA\doparagraphcell
\else
- \@EA\dostopalineas
- \fi{#1}}
+ \@EA\dostopparagraphs
+ \fi}
-\def\doalinea#1%
- {\global\advance\alteller \plusone
- \doifelsevaluenothing{\??al#1\the\alteller\c!distance}
- {\doifnot{\the\alteller}{1}
- {\hskip\getvalue{\??al#1\c!distance}}}
- {\doifelse{\the\alteller}{1}%
- {\hskip\getvalue{\??al#1\the\alteller\c!distance}}
- {\doalinealijn{\getvalue{\??al#1\the\alteller\c!distance}}{#1}}}%
- \setvalue{#1}{\dostopalinea{#1}}%
- \dostartalinea{#1}}
-
-\def\dostartalineas#1%
- {\global\alteller\zerocount
+\def\doparagraphcell
+ {\global\advance\alcounter \plusone
+ \doifelsenothing{\paragraphcellmeter\alcounter\c!distance}
+ {\ifnum\alcounter=\plusone\else
+ \hskip\paragraphparameter\c!distance
+ \fi}
+ {\ifnum\alcounter=\plusone
+ \hskip\paragraphcellmeter\alcounter\c!distance
+ \else
+ \doparagraphrule
+ \fi}%
+ \letvalue\currentparagraph\dostopparagraph
+ \dostartparagraph}
+
+\def\dostartparagraphs#1%
+ {\bgroup
+ \edef\currentparagraph{#1}%
+ \global\alcounter\zerocount
\parindent\zeropoint
\setlocalhsize
\alhsize\localhsize
- \alnsize\getvalue{\??al#1\c!n}\relax
- \dorecurse
- {\getvalue{\??al#1\c!n}}
- {\doifelsevaluenothing{\??al#1\recurselevel\c!distance}
- {\doifnot{\recurselevel}{1}
- {\global\advance\alhsize -\getvalue{\??al#1\c!distance}\relax}}
- {\global\advance\alhsize -\getvalue{\??al#1\recurselevel\c!distance}\relax}%
- \doifvaluesomething{\??al#1\recurselevel\c!width}
+ \alnsize\paragraphparameter\c!n\relax
+ \dorecurse \alnsize
+ {\doifelsenothing{\paragraphcellmeter\recurselevel\c!distance}
+ {\ifnum\recurselevel=\plusone\else
+ \global\advance\alhsize -\paragraphparameter\c!distance
+ \fi}
+ {\global\advance\alhsize -\paragraphcellmeter\recurselevel\c!distance}%
+ \doifsomething{\paragraphcellmeter\recurselevel\c!width}
{\global\advance\alnsize \minusone
- \global\advance\alhsize -\getvalue{\??al#1\recurselevel\c!width}\relax}}%
- %\whitespace % gaat fout bij \framed
- \getvalue{\??al#1\c!before}%
- \leavevmode % gaat wel goed bij \framed
- \vbox\bgroup\hbox\bgroup\doalinea{#1}}
+ \global\advance\alhsize -\paragraphcellmeter\recurselevel\c!width}}%
+ %whitespace % gaat fout bij \framed
+ \paragraphparameter\c!before
+ \leavevmode % gaat wel goed bij \framed, brrr
+ \setbox\scratchbox\vbox\bgroup\hbox\bgroup\doparagraphcell}
-\def\dostopalineas#1%
+\def\dostopparagraphs
{\egroup
\egroup
+ \iftrue
+ \hbox{\raise\strutheight\box\scratchbox}% new
+ \else
+ \box\scratchbox % old
+ \fi
\par
- \getvalue{\??al#1\c!after}}%
+ \paragraphparameter\c!after
+ \egroup}
\def\dosetuptab[#1]%
{\getparameters[\??ta]
@@ -500,10 +729,13 @@
\resetsubscripts
\egroup}
-\def\celsius#1{#1\mathematics{^\circ}C}
-\def\graden {\mathematics{^\circ}}
-\def\inch {\hbox{\rm\char125\relax}}
-\def\fraction#1#2{\mathematics{#1\over#2}}
+\unexpanded\def\celsius #1{#1\mathematics{^\circ}C}
+\unexpanded\def\inch {\mathematics{\prime\prime}} % was: \hbox{\rm\char125\relax}
+\unexpanded\def\fraction#1#2{\mathematics{#1\over#2}}
+
+% very dutch
+
+\unexpanded\def\graden {\mathematics{^\circ}}
\def\bedragprefix {\euro\normalfixedspace}
\def\bedragsuffix {}
@@ -560,27 +792,42 @@
\unexpanded\def\ongeveer
{\mathematics\pm}
+\chardef\boundarycharactermode\plusone
+
\def\midboundarycharacter#1#2%
- {%\nobreak
- \hskip\hspaceamount\currentlanguage{#2}%
- \languageparameter#1%
- %\nobreak
- \hskip\hspaceamount\currentlanguage{#2}}
+ {\ifcase\boundarycharactermode
+ \or
+ %\nobreak
+ \hskip\hspaceamount\currentlanguage{#2}%
+ \languageparameter#1%
+ %\nobreak
+ \hskip\hspaceamount\currentlanguage{#2}%
+ \or
+ \languageparameter#1%
+ \fi
+ \chardef\boundarycharactermode\plusone}
\def\leftboundarycharacter#1#2%
- {\languageparameter#1%
- \nobreak
- \hskip\hspaceamount\currentlanguage{#2}}
-
-% \def\rightboundarycharacter#1#2%
-% {\nobreak
-% \hskip\hspaceamount\currentlanguage{#2}%
-% \languageparameter#1}
+ {\ifcase\boundarycharactermode
+ \or
+ \languageparameter#1%
+ \nobreak
+ \hskip\hspaceamount\currentlanguage{#2}%
+ \or
+ \languageparameter#1%
+ \fi
+ \chardef\boundarycharactermode\plusone}
\def\rightboundarycharacter#1#2%
- {\prewordbreak %\nobreak
- \hskip\hspaceamount\currentlanguage{#2}%
- \languageparameter#1}
+ {\ifcase\boundarycharactermode
+ \or
+ \prewordbreak %\nobreak
+ \hskip\hspaceamount\currentlanguage{#2}%
+ \languageparameter#1%
+ \or
+ \languageparameter#1%
+ \fi
+ \chardef\boundarycharactermode\plusone}
% actually this is pretty old, but temporary moved here
%
@@ -634,44 +881,79 @@
\newsignal \subsentencesignal
\newcounter\subsentencelevel
+\let\beforesubsentence\donothing
+\let\aftersubsentence \donothing
+
+% todo: make this language option
+%
+% \def\beforesubsentence{\removeunwantedspaces}
+% \def\aftersubsentence {\ignorespaces}
+
\def\midsentence
{\symbol[\c!midsentence]}
\def\beginofsubsentence
- {\ifdim\lastkern=\subsentencesignal
+ {\beforesubsentence
+ \ifdim\lastkern=\subsentencesignal
\unskip
\kern\hspaceamount\currentlanguage{intersentence}%
\fi
\doglobal\increment\subsentencelevel
\ifnum\subsentencelevel=\plusone
- \leaveoutervmode
+ \dontleavehmode % was \leaveoutervmode
\fi
- \symbol[\ifodd\subsentencelevel\c!leftsentence \else
- \c!leftsubsentence\fi]%
- \ignorespaces}
+ \symbol[\ifodd\subsentencelevel\c!leftsentence\else\c!leftsubsentence\fi]%
+ }% \ignorespaces}
-\def\beginofsubsentencespacing
- {\kern\subsentencesignal\ignorespaces}
-
-\def\endofsubsentence
- {\symbol[\ifodd\subsentencelevel\c!rightsentence \else
- \c!rightsubsentence\fi]%
+\def\endofsubsentence % relax prevents space gobbling
+ {\symbol[\ifodd\subsentencelevel\c!rightsentence\else\c!rightsubsentence\fi]%
\doglobal\decrement\subsentencelevel
\unskip
- \kern\subsentencesignal}
+ \kern\subsentencesignal\relax
+ \aftersubsentence}
+
+\def\beginofsubsentencespacing % relax prevents space gobbling
+ {\kern\subsentencesignal\relax}% \ignorespaces}
\def\endofsubsentencespacing
{\ifdim\lastkern=\subsentencesignal
\unskip
\hskip\hspaceamount\currentlanguage{intersentence}%
- \ignorespaces
+ % no good, actually language dependent:
+% \ignorespaces
\else
\unskip
\fi}
-% test |<|test |<|test|>| test|>| test \par
-% test|<|test|<|test|>|test|>|test \par
-% test |<||<|test|>||>| test \par
+%D \startbuffer
+%D test |<|test |<|test|>| test|>| test \par
+%D test|<|test|<|test|>|test|>|test \par
+%D test |<||<|test|>||>| test \par
+%D test \directdiscretionary{<}test\directdiscretionary{>} test \par
+%D \stopbuffer
+%D
+%D \typebuffer
+%D \getbuffer
+
+\def\startsubsentence{\beginofsubsentence \prewordbreak\beginofsubsentencespacing}
+\def\stopsubsentence {\endofsubsentencespacing\prewordbreak\endofsubsentence}
+
+%D \defineXMLenvironment [subsentence]
+%D {|<|}
+%D {|>|}
+%D \defineXMLenvironment [subsentence]
+%D {\directdiscretionary{<}}
+%D {\directdiscretionary{>}}
+%D \defineXMLenvironment [subsentence]
+%D {\startsubsentence}
+%D {\stopsubsentence}
+%D
+%D \startbuffer
+%D test <subsentence>test</subsentence> test
+%D \stopbuffer
+%D
+%D \typebuffer
+%D \processXMLbuffer
\enableactivediscretionaries
@@ -712,100 +994,99 @@
[\c!middlespeech]
[\leftboundarycharacter\c!middlespeech{speech}]
-%%%%% will be replaced by delimitedtext %%%%%
-
-\def\leftquotationmark
- {\setbox\scratchbox\hbox{\symbol[\c!leftquotation]}%
- \doif\@@cilocation\v!margin{\hskip-\wd\scratchbox}%
- \box\scratchbox}
-
-\def\rightquotationmark
- {\hsmash{\symbol[\c!rightquotation]}}
-
-\newsignal\quotationsignal
-
-\def\setupquote
- {\dodoubleargument\getparameters[\??ci]}
-
-% \def\setuoquotation
-% {\setupquote}
-
-\def\startquotation
- {\bgroup\dosingleempty\dostartquotation}
-
-\def\dostartquotation[#1]%
- {\@@cibefore
- \doifelsenothing{#1}
- {\let\dostopquotation\relax}
- {\startnarrower[#1]%
- \let\dostopquotation\stopnarrower}%
- \dostartattributes\??ci\c!style\c!color\empty
- \leftquotationmark
- \ignorespaces}
-
-\def\stopquotation
- {\removeunwantedspaces
- \removelastskip
- \rightquotationmark
- \dostopattributes
- \dostopquotation
- \@@ciafter
- \egroup}
-
-\def\dohandlequotation#1#2%
- {\ifdim\lastskip=\quotationsignal
- \unskip\hskip\hspaceamount\currentlanguage{interquotation}%
- \else
- #2%
- \fi
- \ifhmode % else funny pagebeaks
- \penalty\!!tenthousand\hskip\zeropoint % == \prewordbreak
- \fi
- \strut % new, needed below
- \symbol[#1]%
- \penalty\!!tenthousand\hskip\quotationsignal} % +- \prewordbreak
-
-\def\handlequotation#1%
- {\dohandlequotation{#1}\relax}
-
-\unexpanded\def\quotation
- {\groupedcommand
- {\dohandlequotation\c!leftquotation \relax}
- {\dohandlequotation\c!rightquotation\removelastskip}}
-
-\unexpanded\def\quote
- {\doifelse\@@cistyle\v!normal\doquotedcite\doattributedcite}
-
-\def\doquotedcite
- {\groupedcommand
- {\dohandlequotation\c!leftquote \relax}
- {\dohandlequotation\c!rightquote\removelastskip}}
-
-\def\doattributedcite
- {\groupedcommand
- {\dostartattributes\??ci\c!style\c!color}
- {\dostopattributes}}
+% has been replaced by delimitedtext
+%
+% \def\leftquotationmark
+% {\setbox\scratchbox\hbox{\symbol[\c!leftquotation]}%
+% \doif\@@cilocation\v!margin{\hskip-\wd\scratchbox}%
+% \box\scratchbox}
+%
+% \def\rightquotationmark
+% {\hsmash{\symbol[\c!rightquotation]}}
+%
+% \newsignal\quotationsignal
+%
+% \def\setupquote
+% {\dodoubleargument\getparameters[\??ci]}
+%
+% \def\startquotation
+% {\bgroup\dosingleempty\dostartquotation}
+%
+% \def\dostartquotation[#1]%
+% {\@@cibefore
+% \doifelsenothing{#1}
+% {\let\dostopquotation\relax}
+% {\startnarrower[#1]%
+% \let\dostopquotation\stopnarrower}%
+% \dostartattributes\??ci\c!style\c!color\empty
+% \leftquotationmark
+% \ignorespaces}
+%
+% \def\stopquotation
+% {\removeunwantedspaces
+% \removelastskip
+% \rightquotationmark
+% \dostopattributes
+% \dostopquotation
+% \@@ciafter
+% \egroup}
+%
+% \def\dohandlequotation#1#2%
+% {\ifdim\lastskip=\quotationsignal
+% \unskip\hskip\hspaceamount\currentlanguage{interquotation}% hardcoded
+% \else
+% #2%
+% \fi
+% \ifhmode % else funny pagebeaks
+% \penalty\!!tenthousand\hskip\zeropoint % == \prewordbreak
+% \fi
+% \strut % new, needed below
+% \symbol[#1]%
+% \penalty\!!tenthousand\hskip\quotationsignal} % +- \prewordbreak
+%
+% \def\handlequotation#1%
+% {\dohandlequotation{#1}\relax}
+%
+% \unexpanded\def\quotation
+% {\groupedcommand
+% {\dohandlequotation\c!leftquotation \relax}
+% {\dohandlequotation\c!rightquotation\removelastskip}}
+%
+% \unexpanded\def\quote
+% {\doifelse\@@cistyle\v!normal\doquotedcite\doattributedcite}
+%
+% \def\doquotedcite
+% {\groupedcommand
+% {\dohandlequotation\c!leftquote \relax}
+% {\dohandlequotation\c!rightquote\removelastskip}}
+%
+% \def\doattributedcite
+% {\groupedcommand
+% {\dostartattributes\??ci\c!style\c!color}
+% {\dostopattributes}}
%D The previous one fails in \placefloat[left]{}{}, so instead
%D we use the next alternative, where the first one is handled
%D outside group. Watch the strut.
-\unexpanded\def\quotation
- {\dohandlequotation\c!leftquotation\relax
- \groupedcommand \donothing
- {\dohandlequotation\c!rightquotation\removelastskip}}
-
-\def\doquotedcite
- {\dohandlequotation\c!leftquote\relax
- \groupedcommand \donothing
- {\dohandlequotation\c!rightquote\removelastskip}}
-
-\setupquote
- [\c!location=\v!margin,
- \c!style=\v!normal,
- \c!color=,
- \c!before=\startnarrower,
- \c!after=\stopnarrower]
+% has been replaced by delimitedtext
+%
+% \unexpanded\def\quotation
+% {\dohandlequotation\c!leftquotation\relax
+% \groupedcommand \donothing
+% {\dohandlequotation\c!rightquotation\removelastskip}}
+%
+% \def\doquotedcite
+% {\dohandlequotation\c!leftquote\relax
+% \groupedcommand \donothing
+% {\dohandlequotation\c!rightquote\removelastskip}}
+%
+% \setupquote
+% [\c!location=\v!margin,
+% \c!style=\v!normal,
+% \c!color=,
+% \c!before=\startnarrower,
+% \c!after=\stopnarrower]
\appendtoks\def\quotation#1{"#1"}\to\simplifiedcommands
\appendtoks\def\quote #1{'#1'}\to\simplifiedcommands
@@ -818,38 +1099,38 @@
%D closing symbols are defined per language. Italian is an
%D example of a language that has them set.
-%%%%% will be replaced by delimitedtext %%%%%
-
-\newcounter\speechlevel \newconditional\insidespeech
-
-\def\startspeech
- {\doglobal\increment\speechlevel\relax
- \dohandlequotation\c!leftspeech\relax
- \global\settrue\insidespeech
- \ignorespaces}
-
-\def\stopspeech
- {\dohandlequotation\c!rightspeech\removelastskip
- \doglobal\decrement\speechlevel\relax
- \ifcase\speechlevel\relax \global\setfalse\insidespeech \fi}
-
-\def\dohandlespeech % indirect since called in everypar
- {\relax % still needed?
- \ifcase\speechlevel\or\dodohandlespeech\fi}
-
-\def\dodohandlespeech
- {\ifconditional\insidespeech
- \dohandlequotation\c!middlespeech\relax
- \else
- \global\settrue\insidespeech
- \fi}
-
-\unexpanded\def\speech
- {\doglobal\increment\speechlevel\relax
- \dohandlequotation\c!leftspeech\relax
- \groupedcommand \ignorespaces
- {\dohandlequotation\c!rightspeech\removelastskip
- \doglobal\decrement\speechlevel\relax}}
+% has been be replaced by delimitedtext
+%
+% \newcounter\speechlevel \newconditional\insidespeech
+%
+% \def\startspeech
+% {\doglobal\increment\speechlevel\relax
+% \dohandlequotation\c!leftspeech\relax
+% \global\settrue\insidespeech
+% \ignorespaces}
+%
+% \def\stopspeech
+% {\dohandlequotation\c!rightspeech\removelastskip
+% \doglobal\decrement\speechlevel\relax
+% \ifcase\speechlevel\relax \global\setfalse\insidespeech \fi}
+%
+% \def\dohandlespeech % indirect since called in everypar
+% {\relax % still needed?
+% \ifcase\speechlevel\or\dodohandlespeech\fi}
+%
+% \def\dodohandlespeech
+% {\ifconditional\insidespeech
+% \dohandlequotation\c!middlespeech\relax
+% \else
+% \global\settrue\insidespeech
+% \fi}
+%
+% \unexpanded\def\speech
+% {\doglobal\increment\speechlevel\relax
+% \dohandlequotation\c!leftspeech\relax
+% \groupedcommand \ignorespaces
+% {\dohandlequotation\c!rightspeech\removelastskip
+% \doglobal\decrement\speechlevel\relax}}
% \appendtoks \dohandlespeech \to \everypar
@@ -883,6 +1164,7 @@
\c!right=,
\c!level=0,
\c!repeat=\v!no,
+ \c!method=,
#2]}%
{\doifdefined{#2}
{\copyparameters[\??ci#1][\??ci#2]
@@ -909,13 +1191,20 @@
\dohandledelimitedtext\c!middle
\fi}
+\let\dohandlerepeatdelimitedtext\relax
+
\def\startdelimitedtext[#1]%
{\bgroup
\def\currentdelimitedtext{#1}%
- \doif{\delimitedtextparameter\c!repeat}\v!yes
- {\appendtoks \dorepeatdelimitedtext \to \everypar}%
- \doifinsetelse{\delimitedtextparameter\c!location}{\v!paragraph,\v!margin}%
- {\dosingleempty\dostartdelimitedtextpar}\dostartdelimitedtexttxt}
+ \doifelse{\delimitedtextparameter\c!method}\s!font
+ {\doglobal\decrementvalue{\??ci\currentdelimitedtext\c!level}%
+ \def\dostopdelimitedtext{\removeunwantedspaces\ignoredelimitedtext\c!right}%
+ \ignoredelimitedtext\c!left\ignorespaces}
+ {\doifelse{\delimitedtextparameter\c!repeat}\v!yes
+ {\let\dohandlerepeatdelimitedtext\dorepeatdelimitedtext}%
+ {\let\dohandlerepeatdelimitedtext\relax}%
+ \doifinsetelse{\delimitedtextparameter\c!location}{\v!paragraph,\v!margin}%
+ {\dosingleempty\dostartdelimitedtextpar}\dostartdelimitedtexttxt}}
\def\dostartdelimitedtextpar[#1]%
{\let\dostopdelimitedtext\dostopdelimitedtextpar
@@ -927,7 +1216,8 @@
% \doadaptrightskip{\delimitedtextparameter\c!rightmargin}%
% backward compatible:
\doifelsenothing{#1}
- {\doadaptleftskip {\delimitedtextparameter\c!leftmargin}%
+ {\endgraf
+ \doadaptleftskip {\delimitedtextparameter\c!leftmargin}%
\doadaptrightskip{\delimitedtextparameter\c!rightmargin}%
\let\dodostopdelimitedtextpar\endgraf}
{\startnarrower[#1]\let\dodostopdelimitedtextpar\stopnarrower}%
@@ -967,8 +1257,10 @@
\def\delimitedtext[#1]%
{\pushmacro\currentdelimitedtext
\def\currentdelimitedtext{#1}%
- \doifinsetelse{\delimitedtextparameter\c!location}{\v!paragraph,\v!margin}%
- \dodelimitedtextpar\dodelimitedtexttxt}
+ \doifelse{\delimitedtextparameter\c!method}\s!font
+ {\dofontdrivendelimited}
+ {\doifinsetelse{\delimitedtextparameter\c!location}{\v!paragraph,\v!margin}%
+ \dodelimitedtextpar\dodelimitedtexttxt}}
% shortcuts
@@ -986,8 +1278,8 @@
{\hsmash{\delimitedtextparameter\c!right}}
\def\dohandledelimitedtext#1#2%
- {\bgroup
- \setbox\scratchbox\hbox{#1}%
+ {\begingroup
+ \setbox\scratchbox\hbox{\delimitedtextparameter#1}%
\ifdim\wd\scratchbox>\zeropoint
\ifdim\lastskip=\delimitedtextsignal
\unskip\hskip\hspaceamount\currentlanguage{interquotation}%
@@ -998,10 +1290,13 @@
\penalty\!!tenthousand\hskip\zeropoint % == \prewordbreak
\fi
\strut % new, needed below
- \delimitedtextparameter#1%
+ \delimitedtextparameter#1% unhbox\scratchbox
\penalty\!!tenthousand\hskip\delimitedtextsignal % +- \prewordbreak
\fi
- \egroup}
+ \endgroup}
+
+\def\ignoredelimitedtext#1%
+ {\delimitedtextparameter#1}
\def\handledelimitedtext#1%
{\dohandledelimitedtext{#1}\relax}
@@ -1029,32 +1324,44 @@
{\dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color}
{\dostopattributes
\popmacro\currentdelimitedtext}}
+
+% \def\dofontdrivendelimited#1% thanks to Taco for sorting out the kerning interference
+% {\languageparameter{\c!left\currentdelimitedtext}%
+% #1% sorry, no verbatim support
+% \languageparameter{\c!right\currentdelimitedtext}%
+% \popmacro\currentdelimitedtext}
+
+\def\dofontdrivendelimited
+ {\simplegroupedcommand
+ {\languageparameter{\c!left\currentdelimitedtext}}
+ {\languageparameter{\c!right\currentdelimitedtext}%
+ \popmacro\currentdelimitedtext}}
-% \definedelimitedtext
-% [\v!quotation]
-% [\c!left={\symbol[\c!leftquotation]},
-% \c!right={\symbol[\c!rightquotation]},
-% \c!leftmargin=\v!standard]
-%
-% \definedelimitedtext
-% [\v!quote][\v!quotation]
-%
-% \setupdelimitedtext
-% [\v!quote]
-% [\c!location=\v!text,
-% \c!left={\symbol[\c!leftquote]},
-% \c!right={\symbol[\c!rightquote]}]
-%
-% \definedelimitedtext
-% [\v!speech][\v!quotation]
-%
-% \setupdelimitedtext
-% [\v!speech]
-% [\c!repeat=\v!yes,
-% \c!left={\symbol[\c!leftspeech]},
-% \c!middle={\symbol[\c!middlespeech]},
-% \c!right={\symbol[\c!rightspeech]}]
-%
+\definedelimitedtext
+ [\v!quotation]
+ [\c!left={\symbol[\c!leftquotation]},
+ \c!right={\symbol[\c!rightquotation]},
+ \c!leftmargin=\v!standard]
+
+\definedelimitedtext
+ [\v!quote][\v!quotation]
+
+\setupdelimitedtext
+ [\v!quote]
+ [\c!location=\v!text,
+ \c!left={\symbol[\c!leftquote]},
+ \c!right={\symbol[\c!rightquote]}]
+
+\definedelimitedtext
+ [\v!speech][\v!quotation]
+
+\setupdelimitedtext
+ [\v!speech]
+ [\c!repeat=\v!yes,
+ \c!left={\symbol[\c!leftspeech]},
+ \c!middle={\symbol[\c!middlespeech]},
+ \c!right={\symbol[\c!rightspeech]}]
+
% how do we call an tight quote
%
% \definedelimitedtext
@@ -1064,9 +1371,9 @@
% [\v!quotation]
% [\c!indentnext=\v!no,
% \c!spacebefore=\v!nowhite]
-%
-% \def\setupquotation{\setupdelimitedtext[\v!quotation]}
-% \def\setupquote {\setupdelimitedtext[\v!quote]}
+
+\def\setupquotation{\setupdelimitedtext[\v!quotation]}
+\def\setupquote {\setupdelimitedtext[\v!quote]}
% seldom used, move from kernel to run time module
@@ -1374,6 +1681,10 @@
\startmessages romanian library: systems
41: fisierul extern -- din grupul -- nu exista
\stopmessages
+
+\startmessages french library: systems
+ 41: le fichier externe -- du groupe -- n'existe pas
+\stopmessages
\definetabulate
[\v!legend]
@@ -1767,31 +2078,32 @@
\getparameters[\??co][#1]%
\fi}
-\def\startcombination
- {\dodoubleempty\dostartcombination}
-
\def\combinationparameter#1%
{\csname\??co\currentcombination#1\endcsname}%
+\def\startcombination
+ {\bgroup % so we can grab a group
+ \dodoubleempty\dostartcombination}
+
\def\dostartcombination[#1][#2]%
- {\bgroup
- \global\setsystemmode{combination}%
+ {\global\setsystemmode{combination}%
+ \doifnothing{#1}\firstargumentfalse % to be sure (when called in macros)
+ \doifnothing{#2}\secondargumentfalse % to be sure (when called in macros)
\ifsecondargument
\def\currentcombination{#1}%
+ \edef\currentcombinationspec{#2*1*}%
\else
- \let\currentcombination\empty
+ \doifinstringelse{*}{#1}
+ {\let\currentcombination\empty
+ \edef\currentcombinationspec{#1*1*}}
+ {\def\currentcombination{#1}%
+ \edef\currentcombinationspec{2*1*}}%
\fi
\forgetall
\doifelse{\combinationparameter\c!height}\v!fit
\vbox {\vbox to \combinationparameter\c!height}%
\bgroup
- %\doifelsenothing{#1}
- % {\dodostartcombination[2*1*]}
- % {\doifelsenothing{#2}
- % {\dodostartcombination[#1*1*]}
- % {\dodostartcombination[#2*1*]}}}
- \expanded{\dodostartcombination
- [\ifsecondargument#2\else\iffirstargument#1\else2\fi\fi*1*]}}
+ \expanded{\dodostartcombination[\currentcombinationspec]}}
\long\def\dodostartcombination[#1*#2*#3]%
{\setuphorizontaldivision
@@ -1936,7 +2248,7 @@
\let\next\vbox
\ExpandFirstAfter\processallactionsinset
[\combinationparameter\c!location]
- [ \v!top=>\let\next\depthonlybox, % \tbox,
+ [ \v!top=>\let\next\depthonlybox, % \tbox,
\v!middle=>\let\next\halfwaybox]%
\next{\copy0}%
% we need to save the caption for a next alignment line
@@ -1970,8 +2282,24 @@
\fi
\next}
+% formally ok:
+%
+% \def\stopcombination
+% {\egroup
+% \egroup}
+%
+% more robust:
+%
+% \def\stopcombination
+% {{}{}{}{}{}{}{}{}% catches (at most 4) missing entries
+% \egroup
+% \egroup}
+%
+% even better:
+
\def\stopcombination
- {\egroup
+ {{\scratchtoks{{}{}{}}\dorecurse\totcombination{\appendtoks{}{}{}{}\to\scratchtoks}\expandafter}\the\scratchtoks
+ \egroup
\egroup}
\newbox\combinationstack
@@ -2020,6 +2348,41 @@
\c!after=,
\c!align=\v!middle]
+%D \macros
+%D {startfloatcombination}
+%D
+%D \startbuffer
+%D \placefigure
+%D [left,none]
+%D {}
+%D {\startfloatcombination[2*2]
+%D \placefigure{alpha}{\externalfigure[cow.pdf][width=1cm]}
+%D \placefigure{beta} {\externalfigure[cow.pdf][width=2cm]}
+%D \placefigure{gamma}{\externalfigure[cow.pdf][width=3cm]}
+%D \placefigure{delta}{\externalfigure[cow.pdf][width=4cm]}
+%D \stopfloatcombination}
+%D
+%D \input tufte
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+\def\startfloatcombination
+ {\dodoubleempty\dostartfloatcombination}
+
+\def\dostartfloatcombination[#1][#2]%
+ {\vbox\bgroup
+ %\insidecolumnstrue % trick, forces no centering, todo: proper switch/feature
+ \chardef\postcenterfloatmethod\zerocount
+ \forcelocalfloats
+ \def\stopfloatcombination
+ {\scratchtoks\emptytoks
+ \dorecurse\noflocalfloats
+ {\appendetoks{\noexpand\getlocalfloat{\recurselevel}}{}\to\scratchtoks}%
+ \expanded{\startcombination[#1]\the\scratchtoks}\stopcombination
+ \resetlocalfloats
+ \egroup}}
+
% does not work
%
% \def\plaatsondernaastelkaar#1#2%
@@ -2408,15 +2771,18 @@
% scale
\def\doscalelikeafigure % quite dirty and potential interference possible
- {\doifsomething{\@@xyfactor\@@xyhfactor\@@xywfactor\@@xyscale
+ {\doifsomething{\@@xyscale\@@xyxscale\@@xyyscale
+ \@@xyfactor\@@xyhfactor\@@xywfactor
\@@xywidth\@@xyheight\@@xylines}
- {\let \@@efscale \@@xyscale
+ {\let \@@efscale \@@xyscale
+ \let \@@efxscale \@@xyxscale
+ \let \@@efyscale \@@xyyscale
\let \@@effactor \@@xyfactor
\let \@@efwfactor\@@xywfactor
\let \@@efhfactor\@@xyhfactor
- \let \@@efwidth\@@xywidth
+ \let \@@efwidth \@@xywidth
\let \@@efheight \@@xyheight
- \let \@@eflines \@@xylines
+ \let \@@eflines \@@xylines
\let \@@efgrid \@@xygrid
\let \@@epx \!!zeropoint
\let \@@epy \!!zeropoint
@@ -2435,12 +2801,12 @@
\scratchdimen\scay\points \divide\scratchdimen \plushundred
\edef\@@xysy{\withoutpt\the\scratchdimen}}}
-\def\doscale[#1]%
+\def\doscale[#1]% todo: xscale/yscale
{\bgroup
\forgetall
\getparameters
[\??xy]
- [\c!scale=,\c!width=,\c!height=,\c!lines=,
+ [\c!scale=,\c!xscale=,\c!yscale=,\c!width=,\c!height=,\c!lines=,
\c!factor=,\c!hfactor=,\c!wfactor=,\c!grid=,
\c!sx=1,\c!sy=1,#1]%
\dowithnextbox
diff --git a/Master/texmf-dist/tex/context/base/core-nav.tex b/Master/texmf-dist/tex/context/base/core-nav.tex
index 2f06b70a2e2..a55022d7766 100644
--- a/Master/texmf-dist/tex/context/base/core-nav.tex
+++ b/Master/texmf-dist/tex/context/base/core-nav.tex
@@ -52,43 +52,54 @@
\def\resetinteractionparameter#1% use with case, no checking done
{\letvalue{\??ia#1}\empty}
+% \def\interactionparameter#1%
+% {\csname\??ia#1\endcsname}
+
+\newtoks\everysetupinteraction
+
\def\setupinteraction
{\dosingleargument\dodosetupinteraction}
\def\dodosetupinteraction[#1]% % \dosetupinteraction == special
{\getparameters[\??ia][#1]%
- \doifelse\@@iastate\v!start
- {\iflocation\else
- \showmessage\m!interactions2{\ifusepagedestinations\space(PAGE)\fi}%
- \global\locationtrue
- \fi}
- {\iflocation
- \showmessage\m!interactions3{\ifusepagedestinations\space(PAGE)\fi}%
- \global\locationfalse
- \fi}%
- \iflocation
- \setsystemmode \v!interaction
- \else
- \resetsystemmode\v!interaction
- \fi
- \dosetuppageview\@@iafocus
- \doifsomething\@@iacalculate
- {\doregistercalculationset\@@iacalculate}%
- \doifelse\@@iastrut\v!yes
- \locationstruttrue
- \locationstrutfalse
- \doifelse\@@iaclick\v!yes
- \highlighthyperlinkstrue
- \highlighthyperlinksfalse
- \doifelse\@@iasplit\v!yes
- \locationsplittrue
- \locationsplitfalse
- \doifelse\@@iadisplay\v!new
- \gotonewwindowtrue
- \gotonewwindowfalse
- \doifelse\@@iapage\v!yes
- {\global\usepagedestinationstrue}
- {\global\usepagedestinationsfalse}}
+ \the\everysetupinteraction}
+
+% todo, move partial append to where the action happens
+
+\appendtoks
+ \doifelse\@@iastate\v!start
+ {\iflocation\else
+ \showmessage\m!interactions2{\ifusepagedestinations\space(PAGE)\fi}%
+ \global\locationtrue
+ \fi}
+ {\iflocation
+ \showmessage\m!interactions3{\ifusepagedestinations\space(PAGE)\fi}%
+ \global\locationfalse
+ \fi}%
+ \iflocation
+ \setsystemmode \v!interaction
+ \else
+ \resetsystemmode\v!interaction
+ \fi
+ \dosetuppageview\@@iafocus
+ \doifsomething\@@iacalculate
+ {\doregistercalculationset\@@iacalculate}%
+ \doifelse\@@iastrut\v!yes
+ \locationstruttrue
+ \locationstrutfalse
+ \doifelse\@@iaclick\v!yes
+ \highlighthyperlinkstrue
+ \highlighthyperlinksfalse
+ \doifelse\@@iasplit\v!yes
+ \locationsplittrue
+ \locationsplitfalse
+ \doifelse\@@iadisplay\v!new
+ \gotonewwindowtrue
+ \gotonewwindowfalse
+ \doifelse\@@iapage\v!yes
+ {\global\usepagedestinationstrue}
+ {\global\usepagedestinationsfalse}%
+\to \everysetupinteraction
%D We have to make sure of some settings:
diff --git a/Master/texmf-dist/tex/context/base/core-new.tex b/Master/texmf-dist/tex/context/base/core-new.tex
index 71be6466ae1..d5de7d91ae0 100644
--- a/Master/texmf-dist/tex/context/base/core-new.tex
+++ b/Master/texmf-dist/tex/context/base/core-new.tex
@@ -15,234 +15,6 @@
\unprotect
-% Some kind of new feature, for the moment a private one.
-%
-% \enablemode[screen,paper,bound]
-%
-% \doifmodeelse {paper} {this} {that}
-% \doifmode {paper,screen} {this}
-% \doifnotmode {paper,bound} {that}
-%
-% \startmode [list]
-% \stopmode
-%
-% \startnotmode [list]
-% \stopnotmode
-%
-% system modes have a * as prefix
-%
-% to be implemented: mode naar texutil/scherm + message
-% : geen #2 en nesting (\startregels)
-
-%D Sometimes, we want to prevent a mode for being set. Think
-%D of situations where a style enables a mode, but an outer
-%D level style does not want that. Preventing can be
-%D considered a permanent disabling on forehand.
-
-% \def\systemmodeprefix{*}
-%
-% \let\currentmode \empty
-% \let\preventedmodes\empty
-%
-% \def\preventmode[#1]%
-% {\expanded{\addtocommalist{#1}\noexpand\preventedmodes}}
-%
-% \def\enablemode[#1]%
-% {\expanded
-% {\doifnotinset{#1}{\preventedmodes}
-% {\noexpand\addtocommalist{#1}\noexpand\currentmode}}}
-%
-% \def\disablemode[#1]%
-% {\expanded{\removefromcommalist{#1}\noexpand\currentmode}}
-%
-% \def\doifmodeelse{\unprotect\dodoifmodeelse}
-% \def\doifmode {\unprotect\dodoifmode }
-% \def\doifnotmode {\unprotect\dodoifnotmode }
-% \def\startmode {\unprotect\dostartmode }
-% \def\startnotmode{\unprotect\dostartnotmode}
-%
-% \long\def\dodoifmodeelse#1%
-% {\protect\expanded{\doifcommonelse{#1}{\currentmode}}}
-%
-% \long\def\dodoifmode#1%
-% {\protect\expanded{\doifcommon {#1}{\currentmode}}}
-%
-% \long\def\dodoifnotmode#1%
-% {\protect\expanded{\doifnotcommon {#1}{\currentmode}}}
-%
-% \let\stopmode \relax
-% \let\stopnotmode\relax
-%
-% \long\def\dostartmode[#1]%
-% {\protect
-% \expanded{\doifnotcommon{#1}{\currentmode}}{\gobbleuntil\stopmode}}
-%
-% \long\def\dostartnotmode[#1]%
-% {\protect
-% \expanded{\doifcommon {#1}{\currentmode}}{\gobbleuntil\stopnotmode}}
-%
-% \def\doifallmodeselse{\unprotect\dodoifallmodeselse}
-% \def\doifallmodes {\unprotect\dodoifallmodes}
-% \def\doifnotallmodes {\unprotect\dodoifnotallmodes}
-% \def\startallmodes {\unprotect\dostartallmodes}
-% \def\startnotallmodes{\unprotect\dostartnotallmodes}
-%
-% \long\def\dodoifallmodeselse#1%
-% {\protect\expanded{\doifallcommonelse{#1}{\currentmode}}}
-%
-% \long\def\dodoifallmodes#1%
-% {\protect\expanded{\doifallcommon {#1}{\currentmode}}}
-%
-% \long\def\dodoifnotallmodes#1%
-% {\protect\expanded{\doifnotallcommon {#1}{\currentmode}}}
-%
-% \let\stopallmodes \relax
-% \let\stopnotallmodes\relax
-%
-% \long\def\dostartallmodes[#1]%
-% {\protect
-% \expanded{\doifnotallcommon{#1}{\currentmode}}{\gobbleuntil\stopallmodes}}
-%
-% \long\def\dostartnotallmodes[#1]%
-% {\protect
-% \expanded{\doifallcommon {#1}{\currentmode}}{\gobbleuntil\stopnotallmodes}}
-
-% faster
-
-\def\@mode@{@md@}
-
-\def\systemmodeprefix{*}
-
-\def\disabledmode {0}
-\def\enabledmode {1}
-\def\preventedmode {2}
-
-% fast internal ones
-
-\def\setmode #1{\@EA\let\csname\@mode@#1\endcsname\enabledmode }
-\def\resetmode#1{\@EA\let\csname\@mode@#1\endcsname\disabledmode}
-
-\def\setsystemmode #1{\@EA\let\csname\@mode@\systemmodeprefix#1\endcsname\enabledmode }
-\def\resetsystemmode#1{\@EA\let\csname\@mode@\systemmodeprefix#1\endcsname\disabledmode}
-
-% user ones
-
-\def\preventmode{\unprotect\dopreventmode}
-\def\enablemode {\unprotect\doenablemode }
-\def\disablemode{\unprotect\dodisablemode}
-
-% \def\dopreventmode[#1]{\protect\rawprocesscommalist[#1]\dodopreventmode}
-% \def\doenablemode [#1]{\protect\rawprocesscommalist[#1]\dodoenablemode }
-% \def\dodisablemode[#1]{\protect\rawprocesscommalist[#1]\dododisablemode}
-%
-% better:
-
-\def\dopreventmode[#1]{\protect\cleanuplabel{#1}\rawprocesscommalist[\cleanlabel]\dodopreventmode}
-\def\doenablemode [#1]{\protect\cleanuplabel{#1}\rawprocesscommalist[\cleanlabel]\dodoenablemode }
-\def\dodisablemode[#1]{\protect\cleanuplabel{#1}\rawprocesscommalist[\cleanlabel]\dododisablemode}
-
-\def\dodopreventmode#1%
- {\@EA\let\csname\@mode@#1\endcsname\preventedmode}
-
-\def\dodoenablemode#1%
- {\ifcase0\csname\@mode@#1\endcsname\relax
- \@EA\let\csname\@mode@#1\endcsname\enabledmode
- \fi}
-
-\def\dododisablemode#1%
- {\ifcase0\csname\@mode@#1\endcsname\or
- \@EA\let\csname\@mode@#1\endcsname\disabledmode
- \fi}
-
-% check macros
-
-\newif\ifcheckedmode
-
-\def\dodocheckformode#1%
- {\ifcase0\csname\@mode@#1\endcsname\or\checkedmodetrue\fi}
-
-% \def\docheckformode#1#2#3% will be sped up with a quit
-% {\protect\checkedmodefalse\rawprocesscommalist[#3]\dodocheckformode
-% \ifcheckedmode\@EA#1\else\@EA#2\fi}
-%
-% better:
-
-\def\docheckformode#1#2#3% will be sped up with a quit
- {\cleanuplabel{#3}%
- \protect\checkedmodefalse\rawprocesscommacommand[\cleanlabel]\dodocheckformode
- \ifcheckedmode\@EA#1\else\@EA#2\fi}
-
-\def\dodocheckforallmodes#1%
- {\ifcase0\csname\@mode@#1\endcsname\relax
- \checkedmodefalse\or\or\checkedmodefalse\fi}
-
-% \def\docheckforallmodes#1#2#3% will be sped up with a quit
-% {\protect\checkedmodetrue\rawprocesscommalist[#3]\dodocheckforallmodes
-% \ifcheckedmode\@EA#1\else\@EA#2\fi}
-%
-% better:
-
-\def\docheckforallmodes#1#2#3% will be sped up with a quit
- {\cleanuplabel{#3}%
- \protect\checkedmodetrue\rawprocesscommacommand[\cleanlabel]\dodocheckforallmodes
- \ifcheckedmode\@EA#1\else\@EA#2\fi}
-
-% simple ones
-
-\def\doifmodeelse{\unprotect\dodoifmodeelse}
-\def\doifmode {\unprotect\dodoifmode}
-\def\doifnotmode {\unprotect\dodoifnotmode}
-\def\startmode {\unprotect\dostartmode}
-\def\startnotmode{\unprotect\dostartnotmode}
-
-\def\dodoifmodeelse
- {\docheckformode\firstoftwoarguments\secondoftwoarguments}
-
-\def\dodoifmode
- {\docheckformode\firstofoneargument\gobbleoneargument}
-
-\def\dodoifnotmode
- {\docheckformode\gobbleoneargument\firstofoneargument}
-
-\long\def\dostartmode[#1]%
- {\docheckformode\donothing\dostopmode{#1}}
-
-\long\def\dostartnotmode[#1]%
- {\docheckformode\dostopnotmode\donothing{#1}}
-
-\let\stopmode \donothing
-\let\stopnotmode\donothing
-
-\long\def\dostopmode #1\stopmode {}
-\long\def\dostopnotmode#1\stopnotmode{}
-
-\def\doifallmodeselse{\unprotect\dodoifallmodeselse}
-\def\doifallmodes {\unprotect\dodoifallmodes}
-\def\doifnotallmodes {\unprotect\dodoifnotallmodes}
-\def\startallmodes {\unprotect\dostartallmodes}
-\def\startnotallmodes{\unprotect\dostartnotallmodes}
-
-\def\doifallmodeselse
- {\docheckforallmodes\firstoftwoarguments\secondoftwoarguments}
-
-\def\doifallmodes
- {\docheckforallmodes\firstofoneargument\gobbleoneargument}
-
-\def\doifnotallmodes
- {\docheckforallmodes\gobbleoneargument\firstofoneargument}
-
-\long\def\dostartallmodes[#1]%
- {\docheckforallmodes\donothing\dostopallmodes{#1}}
-
-\long\def\dostartnotallmodes[#1]%
- {\docheckforallmodes\dostopallmodes\donothing{#1}}
-
-\let\stopallmodes \donothing
-\let\stopnotallmodes\donothing
-
-\long\def\dostopallmodes #1\stopallmodes {}
-\long\def\dostopnotallmodes#1\stopnotallmodes{}
-
% \def\setups
% {\dosingleargument\dosetups}
%
@@ -270,14 +42,14 @@
%
% \expanded
% {\long\noexpand\def\noexpand\xdostartsetups##1##2\csname\e!stop\v!instellingen\endcsname
-% {\egroup
+% {\endgroup
% \long\noexpand\setvalue{\??su##1}{##2}}}
%
% \def\startsetups % for international purposes
-% {\bgroup\doifnextcharelse[{\startsetupsA\stopsetups}{\startsetupsB\stopsetups}}
+% {\begingroup\doifnextcharelse[{\startsetupsA\stopsetups}{\startsetupsB\stopsetups}}
%
% \def\startlocalsetups % for nested purposes
-% {\bgroup\doifnextcharelse[{\startsetupsA\stoplocalsetups}{\startsetupsB\stoplocalsetups}}
+% {\begingroup\doifnextcharelse[{\startsetupsA\stoplocalsetups}{\startsetupsB\stoplocalsetups}}
%
% \def\startsetupsA#1[#2]%
% {\catcode`\^^M=\@@ignore
@@ -287,7 +59,7 @@
% {\startsetupsA#1[#2]}%
%
% \long\def\dostartsetups#1#2% watch out: not \grabuntil
-% {\dograbuntil#1{\egroup\long\setvalue{\??su#2}}}
+% {\dograbuntil#1{\endgroup\long\setvalue{\??su#2}}}
% todo : \startsetups[name][XML] \setups[name][XML]
@@ -295,7 +67,7 @@
\expanded
{\long\def\@EA\noexpand\csname\e!start\v!setups\endcsname
- {\bgroup\noexpand\doifnextcharelse[%
+ {\begingroup\noexpand\doifnextcharelse[%
{\noexpand\startsetupsA\@EA\noexpand\csname\e!stop\v!setups\endcsname}
{\noexpand\startsetupsB\@EA\noexpand\csname\e!stop\v!setups\endcsname}}}
@@ -329,7 +101,7 @@
\def\startrawsetups {\xxstartsetups\zerocount\stoprawsetups } \let\stoprawsetups \relax
\def\xxstartsetups#1#2%
- {\bgroup\chardef\setupseolmode#1\doifnextcharelse[{\startsetupsA#2}{\startsetupsB#2}}
+ {\begingroup\chardef\setupseolmode#1\doifnextcharelse[{\startsetupsA#2}{\startsetupsB#2}}
\def\startsetupsA#1% [ ] delimited
{\ifcase\setupseolmode\or\catcode`\^^M\@@ignore\fi
@@ -346,12 +118,12 @@
{\ifthirdargument\@EA\startsetupsC\else\@EA\startsetupsD\fi}
% \long\def\dodostartsetups#1#2#3% watch out: not \grabuntil
-% {\dograbuntil#1{\egroup\dodoglobal\long\setvalue{\??su#2:#3}}} % \doglobal
+% {\dograbuntil#1{\endgroup\dodoglobal\long\setvalue{\??su#2:#3}}} % \doglobal
%
% better:
\long\def\dodostartsetups#1#2#3% watch out: not \grabuntil
- {\cleanuplabel{\??su#2:#3}\dograbuntil#1{\egroup\dodoglobal\long\setvalue\cleanlabel}} % \doglobal
+ {\cleanuplabel{\??su#2:#3}\dograbuntil#1{\endgroup\dodoglobal\long\setvalue\cleanlabel}} % \doglobal
\def\systemsetupsprefix{*}
@@ -553,45 +325,32 @@
\def\env {\getvariable \s!environment}
\def\envvar {\getvariabledefault\s!environment}
-%D \macros
-%D {jobsuffix}
-%D
-%D By default, \TEX\ produces \DVI\ files which can be
-%D converted to other filetypes. Sometimes it is handy to
-%D know what the target file will be. In other driver
-%D modules we wil set \type {\jobsuffix} to \type {pdf}.
+\bgroup % some day this will go away
-\def\jobsuffix{dvi}
-
-\def\setjobsuffix#1%
- {\resetsystemmode\jobsuffix
- \edef\jobsuffix{#1}%
- \setsystemmode\jobsuffix}
-
-\bgroup
+% actually we should handle all discretionaries here
\gdef\cleanedupcolon{:} \catcode`:=\@@active
\gdef\cleanuplabel#1%
- {\bgroup\let:\cleanedupcolon
+ {\begingroup\let:\cleanedupcolon
\xdef\cleanlabel{#1}%
- \egroup}
+ \endgroup}
\gdef\cleanupprefixedlabel#1#2%
- {\bgroup\let:\cleanedupcolon
+ {\begingroup\let:\cleanedupcolon
\xdef\cleanprefix{#1}%
\xdef\cleanlabel {#2}%
- \egroup}
+ \endgroup}
\gdef\protectlabels
{\let:\cleanedupcolon}
-\global\def\blabelgroup {\bgroup \let:\cleanedupcolon}
-\global\let\elabelgroup \egroup
+\global\def\blabelgroup {\begingroup \let:\cleanedupcolon}
+\global\let\elabelgroup \endgroup
\gdef\labelcsname
- {\bgroup\let:\cleanedupcolon
- \expandafter\egroup\csname}
+ {\begingroup\let:\cleanedupcolon
+ \expandafter\endgroup\csname}
\gdef\labelvalue#1%
{\labelcsname#1\endcsname}
diff --git a/Master/texmf-dist/tex/context/base/core-not.tex b/Master/texmf-dist/tex/context/base/core-not.tex
index 73c5c25550f..30f40012bb9 100644
--- a/Master/texmf-dist/tex/context/base/core-not.tex
+++ b/Master/texmf-dist/tex/context/base/core-not.tex
@@ -29,7 +29,7 @@
%D
%D \startitemize[packed]
%D \item a small number \footnote {a footnote number} or
-%D symbol {\setupfootnotes [conversionconversie=set 2]\footnote
+%D symbol {\setupfootnotes [conversion=set 2]\footnote
%D {a footnote}}
%D \item and a similar mark at the bottom of the page
%D \item followed by some additional text
@@ -82,8 +82,8 @@
\def\notedefparameter #1{\csname\??vn\??vn\currentnote#1\endcsname}
\def\footnoteparameter #1{\csname\??vn \v!footnote#1\endcsname}
-\def\startnotedef {\csname\e!start\??vn\??vn\currentnote\endcsname}
-\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname}
+\def\startnotedef {\resetdescriptions\csname\e!start\??vn\??vn\currentnote\endcsname}
+\def\stopnotedef {\csname\e!stop \??vn\??vn\currentnote\endcsname}
\def\noteinsertion #1{\csname\??vn:#1\endcsname}
\def\currentnoteins {\csname\??vn:\currentnote\endcsname}
@@ -118,7 +118,7 @@
%D and split new part ... todo ...
\def\doenablenotes % brrr
- {\global\count\currentnoteins1000
+ {\global\count\currentnoteins\plusthousand
\global\skip \currentnoteins1\baselineskip\relax}
\def\dodisablenotes
@@ -160,6 +160,9 @@
% maybe we should inherit (todo)
+\def\@@defaultnotedefloc{\v!inleft}
+\def\@@defaultnotedefdis{\!!zeropoint}
+
\def\dodefinenote[#1][#2]%
{\def\currentnote{#1}%
\ifundefined{\??vn:\currentnote}%
@@ -172,7 +175,8 @@
\fi
\definedescription
[\??vn\??vn\currentnote]
- [\c!location=\v!inleft,
+ [\c!location=\@@defaultnotedefloc,
+ \c!distance=\@@defaultnotedefdis,
\c!width=\v!fit,
\c!headstyle=\noteparameter\c!style,
\c!headcolor=\noteparameter\c!color,
@@ -234,8 +238,15 @@
\def\dosetupnote[#1][#2]%
{\edef\currentnote{#1}%
\ifsecondargument
- \getparameters
- [\??vn\currentnote][#2]%
+\ifcase\localnodemode\or
+ \edef\localnode@n{\noteparameter\c!n}%
+ \edef\localnode@l{\noteparameter\c!location}%
+\fi
+ \getparameters[\??vn\currentnote][#2]%
+\ifcase\localnodemode\or
+ \letvalue{\??vn\currentnote\c!n }\localnode@n
+ \letvalue{\??vn\currentnote\c!location}\localnode@l
+\fi
\processaction
[\noteparameter\c!rule]
[ \v!on=>\letvalue{\??vn\c!rule:\currentnote}\normalnoterule,
@@ -262,6 +273,10 @@
{\edef\noteinsertions{#1}}%
\fi\fi}
+% redefined:
+
+% so that it matches:
+
\def\dochecknote % only to be called locally, some bools will become class-ones
{% for the moment no mixed text/endnotes modes, so we use
% \footnoteparameter and not \noteparameter (**)
@@ -274,7 +289,7 @@
{\chardef\clevernotes\zerocount}}%
\ifcase\clevernotes\relax
% notes not in column areas
- \ifnum\noteparameter\c!n=\zerocount
+ \ifnum\noteparameter\c!n=\zerocount % no ifcase
\settextnotes
\scratchcounter\plusone
\else
@@ -291,7 +306,7 @@
\global\bottomnotestrue}% not: \postponenotes, else global
\else
% notes in column areas
- \ifnum\@@kln=\zerocount % brrr dependency on \??kl
+ \ifnum\@@kln=\zerocount % no ifcase / brrr dependency on \??kl
\scratchcounter\plusone
\else
\scratchcounter\footnoteparameter\c!n\relax % **
@@ -393,18 +408,58 @@
\ifvbox0\unvbox\else\box\fi0}%
\rigidcolumnbalance0\egroup}}
+% \def\settextnotes
+% {\def\startpushnote {\startvboxtohbox
+% \dostartattributes{\??vn\currentnote}\c!style\c!color\empty}%
+% \def\stoppushnote {\hskip\noteparameter\c!columndistance % plus.5em minus.5em
+% \dostopattributes
+% \stopvboxtohbox}%
+% \def\startpopnotes {\vbox\bgroup
+% \doifnotinset{\noteparameter\c!width}{\v!fit,\v!broad}\setnotehsize
+% \beginofshapebox}%
+% \def\stoppopnotes {\endofshapebox
+% \reshapebox{\ifhbox\shapebox\unhbox\else\box\fi\shapebox\endgraf}%
+% \flushshapebox
+% \egroup}}
+%
+% this was wrong (for ages)
+
+% \def\settextnotes
+% {\def\startpushnote {\startvboxtohbox
+% \dostartattributes{\??vn\currentnote}\c!style\c!color\empty}%
+% \def\stoppushnote {\hskip\noteparameter\c!columndistance % plus.5em minus.5em
+% \dostopattributes
+% \stopvboxtohbox}%
+% %\def\startpopnotes {\vbox\bgroup
+% % \doifnotinset{\noteparameter\c!width}{\v!fit,\v!broad}\setnotehsize}
+% %\def\stoppopnotes {\convertvboxtohbox
+% % \egroup}%
+% \def\startpopnotes {\vbox\bgroup
+% \doifnotinset{\noteparameter\c!width}{\v!fit,\v!broad}\setnotehsize
+% \beginofshapebox}%
+% \def\stoppopnotes {\endofshapebox
+% \doreshapebox{\box\shapebox}{}{}{}% get rid of penalties etc
+% \innerflushshapebox
+% \convertvboxtohbox
+% \egroup}%
+% }
+
\def\settextnotes
{\def\startpushnote {\startvboxtohbox
- \dostartattributes{\??vn\currentnote}\c!style\c!color\empty}%
- \def\stoppushnote {\hskip\noteparameter\c!columndistance % plus.5em minus.5em
- \dostopattributes
+ \edef\@@defaultnotedefloc{\ifnum\noteparameter\c!n=\zerocount\v!serried\else\v!inleft \fi}%
+ \edef\@@defaultnotedefdis{\ifnum\noteparameter\c!n=\zerocount .5em\else\!!zeropoint\fi}%
+ \startnotedef}%
+ \def\stoppushnote {\stopnotedef
+ \hskip\noteparameter\c!columndistance % plus.5em minus.5em
\stopvboxtohbox}%
\def\startpopnotes {\vbox\bgroup
+ % here, else problems in preroll
\doifnotinset{\noteparameter\c!width}{\v!fit,\v!broad}\setnotehsize
\beginofshapebox}%
\def\stoppopnotes {\endofshapebox
- \reshapebox{\ifhbox\shapebox\unhbox\else\box\fi\shapebox\endgraf}%
- \flushshapebox
+ \doreshapebox{\box\shapebox}{}{}{}% get rid of penalties etc
+ \innerflushshapebox
+ \convertvboxtohbox
\egroup}}
%D The formatting depends on the width of the table, so we
@@ -450,7 +505,7 @@
%D
%D \bgroup
%D \startnarrower
-%D \setupfootnotes[conversionconversie=set 1]
+%D \setupfootnotes[conversion=set 1]
%D \getbuffer
%D \stopnarrower
%D \egroup
@@ -473,12 +528,13 @@
\def\dosetnote[#1][#2][#3]%
{\unskip
\def\currentnote{#2}%
+ \dochecknote % sometimes needed for local notes
\ifcase#1\relax
\global\notesymbolfalse
\else
\global\notesymboltrue
\fi
- \ifvisible
+ \ifvisible % misty feature, make it obsolete
\ifreshapingbox
\@EAEAEA\gobbletwoarguments
\else
@@ -506,6 +562,8 @@
\newif\ifnotesenabled \notesenabledtrue
+\appendtoks \notesenabledfalse \to \everymarking
+
\newconditional\pagewisenotes % saves two hash entries
\def\lastnotepage{1}
@@ -532,9 +590,27 @@
\@EA\gobbletwoarguments
\fi}
-\def\nododonote#1%
- {\doifnot{#1}{-}{\kern.5em}% quick hack, approximation
- \gobbleoneargument}
+% \def\nododonote#1%
+% {\doifnot{#1}{-}{\kern.5em}% quick hack, approximation
+% \gobbleoneargument}
+%
+% more correct:
+
+\long\def\nododonote#1#2%
+ {\doifnot{#1}{-}
+ {\ifconditional\pagewisenotes
+ \doifreferencefoundelse{\s!fnt:t:\internalfootreference}
+ {\ifnum\currentrealreference>\lastnotepage\relax
+ \globallet\lastnotepage\currentrealreference
+ \resetnumber[\currentnote]%
+ \fi}
+ {}%
+ \fi
+ \incrementnumber[\currentnote]%
+ \makesectionnumber[\currentnote]%
+ \let\lastnotenumber\composedsectionnumber
+ \dolastnotesymbol
+ \decrementnumber[\currentnote]}}
\def\dododonote#1%
{\doglobal\increment\internalfootreference
@@ -553,8 +629,8 @@
\fi
\incrementnumber[\currentnote]%
\makesectionnumber[\currentnote]%
- \rawreference\s!fnt{#1}\hetnummer
- \let\lastnotenumber\hetnummer}%
+ \rawreference\s!fnt{#1}\composedsectionnumber
+ \let\lastnotenumber\composedsectionnumber}%
\dostartnote}
%D The main typesetting routine is more or less the same as the
@@ -620,12 +696,12 @@
\splitmaxdepth\strutdp % not actually needed here
\leftmargindistance\noteparameter\c!margindistance
\rightmargindistance\leftmargindistance
- \ifcase\noteparameter\c!n\relax % new 31-07-99 ; always ?
+ \ifnum\noteparameter\c!n=\zerocount % no ifcase new 31-07-99 ; always ?
\doifnotinset{\noteparameter\c!width}{\v!fit,\v!broad}\setnotehsize
\fi
\startpushnote
{\ifx\lastnotenumber\empty \else
- \preparethenumber{\??vn\currentnote}\lastnotenumber\preparednumber
+ \preparefullnumber{\??vn\currentnote}\lastnotenumber\preparednumber
\doifelse{\noteparameter\c!interaction}\v!no
{\noteparameter\c!numbercommand
{\preparednumber\domovednote\v!nextpage\v!previouspage}}%
@@ -759,11 +835,13 @@
\setnotebodyfont
% % this should be checked, smells like a mix-up
% % does not split: \ifcase\noteparameter\c!n\unvbox\else\box\fi\currentnoteins
-% \ifcase\noteparameter\c!n
+ \ifcase\noteparameter\c!n\relax
+ \unvbox\currentnoteins
+ \or
\box\currentnoteins
-% \else
-% \unvbox\currentnoteins
-% \fi
+ \else
+ \unvbox\currentnoteins
+ \fi
% this is too ugly actually
\stoppopnotes}%
\setbox2\hbox
@@ -907,10 +985,10 @@
\vbox{\flushshapebox}}}%
\localframed
[\??vn\currentnote]
- [\c!width=\v!fit,
- \c!height=\v!fit,
- \c!strut=\v!no,
- \c!offset=\v!overlay]
+ [ \c!width=\v!fit,
+ \c!height=\v!fit,
+ \c!strut=\v!no,
+ \c!offset=\v!overlay]
{\ifdim\dp0=\zeropoint % this hack is needed because \vadjust
\hbox{\lower\strutdp\box0}% % in margin number placement
\else % hides the (always) present depth
@@ -934,7 +1012,10 @@
\startpopnotes % make sure that fake height is killed
\unvbox#1\endgraf
\stoppopnotes
- \setbox0=\lastbox \ifvbox0 \unvbox0\else\box0\fi % enable columns
+ % weird
+ \ifhmode
+ \setbox0=\lastbox \ifvbox0 \unvbox0\else\box0\fi % enable columns
+ \fi
\noteparameter\c!after
\fi}
@@ -968,9 +1049,12 @@
{\bgroup % here because we support \vbox\startlocalnotes
\dosingleempty\dostartlocalnotes}
+\chardef\localnodemode\zerocount
+
\def\dostartlocalnotes[#1]%
{\let\autopostponenotes\postponenotes
\let\postponenotes\collectlocalnotes
+ \chardef\localnodemode\plusone % new
\def\defaultnotewidth{\ifdim\hsize<\makeupwidth\hsize\else\makeupwidth\fi}%
\processnotes
{\doifsomething{#1}{\setupnote[\currentnote][#1]}%
@@ -988,12 +1072,17 @@
\def\doplacelocalnotes[#1][#2]%
{\bgroup
+ \chardef\localnodemode\plusone % new
\dolocalsetupnotes{#1}{#2}%
- \processnotes
- {\ExpandBothAfter\doifinsetelse\v!none{\noteparameter\c!location}
- \placenotesasnone\placenotesintext\localpostponednotes}%
+ \processnotes\dodoplacelocalnotes
\egroup
- \checknotes}
+ \checknotes} % probably not needed
+
+\def\dodoplacelocalnotes
+ {\dochecknote
+ \expanded{\doifinsetelse{\v!none}{\noteparameter\c!location}}
+ \placenotesasnone\placenotesintext
+ \localpostponednotes}
%D These commands can be used like:
%D
@@ -1202,6 +1291,75 @@
\def\postponefootnotes {\postponenotes}
\def\autopostponefootnotes{\autopostponenotes}
+%D New trickery:
+
+\def\ownnotesymbol#1% #1 gets number passed
+ {\executeifdefined{\??vn::\currentnote}\empty}
+
+\def\setnotesymbol[#1]#2#3%
+ {\prewordbreak % prevent lookback
+ \gdef\lastnotenumber{#2}%
+ \setgvalue{\??vn::#1}{#3}
+ \dolastnotesymbol}
+
+\def\ownnote[#1]#2#3#4%
+ {\setnotesymbol[#1]{#2}{#3}%
+ \setnotetext [#1]{#4}}
+
+\defineconversion
+ [ownnote]
+ [\ownnotesymbol]
+
+%D Usage:
+
+% maybe we should predefine this one
+
+% \definenote
+% [glossary]
+% [way=bypage,
+% location={page,high},
+% factor=0,
+% width=\leftmarginwidth,
+% scope=page,
+% conversion=ownnote,
+% numbercommand=,
+% textcommand=,
+% textstyle=,
+% rule=,
+% before=,
+% after=]
+%
+% \setupnotedefinition
+% [glossary]
+% [location=left,
+% width=fit,
+% distance=.5em,
+% align={right,tolerant,stretch},
+% headstyle=bold,
+% hang=1]
+%
+% \setuplayout
+% [width=middle,
+% height=middle,
+% backspace=5cm,
+% margin=4cm,
+% margindistance=.25cm,
+% cutspace=2cm]
+%
+% \setuptexttexts
+% [margin]
+% [\setups{glossary}]
+% [\setups{glossary}]
+%
+% \startsetups glossary
+% \vbox to \textheight {\placenotes[glossary]\vfill}
+% \stopsetups
+%
+% \dorecurse{10}
+% {\dorecurse{5}
+% {\ownnote[glossary]{whow}{whatever needs to be glossed:~\recurselevel}%
+% \input tufte \relax}}
+
\protect \endinput
% \def\myfootnote[#1]#2% let's guess that #2 is without catcode problems
diff --git a/Master/texmf-dist/tex/context/base/core-ntb.tex b/Master/texmf-dist/tex/context/base/core-ntb.tex
index 080d5c31a65..4e7f0d8a4cd 100644
--- a/Master/texmf-dist/tex/context/base/core-ntb.tex
+++ b/Master/texmf-dist/tex/context/base/core-ntb.tex
@@ -61,13 +61,41 @@
%D However, the next alternative also takes care of preceding
%D and following white space.
+% \def\bTBLCELL % why not \doinhibitblank
+% {\inhibitblank\doconvertfont\tbltblstyle\empty\everypar{\delayedbegstrut}}
+
+% \def\eTBLCELL
+% {\ifhmode
+% \delayedendstrut
+% \par % added 13/4/2006
+% \else
+% \par
+% \ifdim\prevdepth<\zeropoint % =-1000pt ?
+% \vskip-\strutdp
+% \else
+% \removebottomthings
+% \fi
+% \fi}
+
+%D \startbuffer
+%D \bTABLE[left={(},right={)},top=\startnarrower,bottom=\stopnarrower]
+%D \bTR \bTD something \eTD \eTR
+%D \eTABLE
+%D
+%D \typebuffer \getbuffer
+
\def\bTBLCELL % why not \doinhibitblank
- {\inhibitblank\doconvertfont\tbltblstyle\empty\everypar{\begstrut}}
+ {\inhibitblank
+ \doconvertfont\tbltblstyle\empty
+ \everypar{\tbltblleft\delayedbegstrut}}
\def\eTBLCELL
{\ifhmode
- \endstrut
+ \delayedendstrut
+ \tbltblright
+ \par % added 13/4/2006
\else
+ % not sure yet:\tbltblright
\par
\ifdim\prevdepth<\zeropoint % =-1000pt ?
\vskip-\strutdp
@@ -100,10 +128,12 @@
\def\settblwid#1#2{\setxvalue{\@@tblprefix#1:w}{#2}} % global !
\def\settblhei#1#2{\setxvalue{\@@tblprefix#1:h}{#2}} % global !
+\def\settbldis#1#2{\setxvalue{\@@tblprefix#1:d}{#2}} % global !
\def\settblaut#1#2{\setxvalue{\@@tblprefix#1:a}{#2}} % global !
\def\gettblwid#1{\executeifdefined{\@@tblprefix#1:w}\zeropoint}
\def\gettblhei#1{\executeifdefined{\@@tblprefix#1:h}\zeropoint}
+\def\gettbldis#1{\executeifdefined{\@@tblprefix#1:d}\zeropoint}
\def\gettblaut#1{\csname\@@tblprefix#1:a\endcsname}
\def\doiftbltag #1#2{\doifdefined {\@@tblprefix#1:#2:s}}
@@ -136,6 +166,7 @@
\let\popTBLparameters \relax
\newif\ifsqueezeTBLspan \squeezeTBLspantrue % spans one column cell over multi column par cells
+\newif\ifautosqueezeTBLspan \autosqueezeTBLspantrue % unless explicit widths are given
\newif\ifautoTBLspread \autoTBLspreadfalse
\newif\ifautoTBLhsize \autoTBLhsizetrue
\newif\ifautoTBLrowspan \autoTBLrowspantrue
@@ -224,46 +255,68 @@
\def\setupTBLcell#1#2% cell over col over row
{\setupTBLsection % already forgotten
-\getvalue{\@@tblprefix\v!each\v!each}%
+ \edef\positiverow{\number#1}%
+ \edef\positivecol{\number#2}%
+ \scratchcounter-\maximumrow\advance\scratchcounter#1\advance\scratchcounter\minusone
+ \edef\negativerow{\number\scratchcounter}%
+ \scratchcounter-\maximumcol\advance\scratchcounter#2\advance\scratchcounter\minusone
+ \edef\negativecol{\number\scratchcounter}%
+ \getvalue{\@@tblprefix\v!each\v!each}%
\getvalue{\@@tblprefix\c!y\v!each}%
\getvalue{\@@tblprefix\c!x\v!each}%
- \getvalue{\@@tblprefix\c!y\v!oddeven{#1}}%
- \getvalue{\@@tblprefix\c!x\v!oddeven{#2}}%
- \getvalue{\@@tblprefix\c!x\v!oddeven{#2}\c!y\v!oddeven{#1}}%
- \ifnum#1=\plusone
+ \getvalue{\@@tblprefix\c!y\v!oddeven\positiverow}%
+ \getvalue{\@@tblprefix\c!x\v!oddeven\positivecol}%
+ \getvalue{\@@tblprefix\c!x\v!oddeven\positivecol\c!y\v!oddeven\positiverow}%
+ \ifnum\positiverow=\plusone
\getvalue{\@@tblprefix\c!y\v!first}%
- \executeifdefined{\@@tblprefix\c!x#2\c!y\v!first}\donothing
+ \executeifdefined{\@@tblprefix\c!x\positivecol\c!y\v!first}\donothing
\fi
- \ifnum#2=\plusone
+ \ifnum\positivecol=\plusone
\getvalue{\@@tblprefix\c!x\v!first}%
- \executeifdefined{\@@tblprefix\c!x\v!first\c!y#1}\donothing
+ \executeifdefined{\@@tblprefix\c!x\v!first\c!y\positiverow}\donothing
\fi
- \ifnum#1=\maximumrow\relax
+ \ifnum\positiverow=\maximumrow\relax
\getvalue{\@@tblprefix\c!y\v!last}%
- \executeifdefined{\@@tblprefix\c!x#2\c!y\v!last}\donothing
+ \executeifdefined{\@@tblprefix\c!x\positivecol\c!y\v!last}\donothing
\fi
- \ifnum#2=\maximumcol\relax
+ \ifnum\positivecol=\maximumcol\relax
\getvalue{\@@tblprefix\c!x\v!last}%
- \executeifdefined{\@@tblprefix\c!x\v!last\c!y#1}\donothing
+ \executeifdefined{\@@tblprefix\c!x\v!last\c!y\positiverow}\donothing
\fi
- \ifnum#1=\maximumrow\relax\ifnum#2=\maximumcol\relax
+ \ifnum\positiverow=\maximumrow\relax\ifnum\positivecol=\maximumcol\relax
\getvalue{\@@tblprefix\c!x\v!last\c!y\v!last}%
\fi\fi
- \ifnum#1=\plusone \ifnum#2=\plusone
+ \ifnum\positiverow=\plusone \ifnum\positivecol=\plusone
\getvalue{\@@tblprefix\c!x\v!first\c!y\v!first}%
\fi\fi
\ifnum#1>\noftblhdnxlines\else
\executeifdefined{\@@tblprefix\v!header\v!each}\donothing
- \executeifdefined{\@@tblprefix\v!header#2}\donothing
+ \executeifdefined{\@@tblprefix\v!header\positivecol}\donothing
\fi
- \executeifdefined{\@@tblprefix\c!y#1}\donothing
-\getvalue{\@@tbl\@@tbl\c!extras}\letvalue{\@@tbl\@@tbl\c!extras}\relax % new, see x-fo
- \executeifdefined{\@@tblprefix\c!x#2}\donothing
-\getvalue{\@@tbl\@@tbl\c!extras}\letvalue{\@@tbl\@@tbl\c!extras}\relax % new, see x-fo
- \executeifdefined{\@@tblprefix\c!x#2\c!y#1}\donothing
+ \executeifdefined{\@@tblprefix\c!y\positiverow}\donothing
+ \executeifdefined{\@@tblprefix\c!y\negativerow}\donothing
+ \getvalue{\@@tbl\@@tbl\c!extras}\letvalue{\@@tbl\@@tbl\c!extras}\relax % new, see x-fo
+ \executeifdefined{\@@tblprefix\c!x\positivecol}\donothing
+ \executeifdefined{\@@tblprefix\c!x\negativecol}\donothing
+ \getvalue{\@@tbl\@@tbl\c!extras}\letvalue{\@@tbl\@@tbl\c!extras}\relax % new, see x-fo
+ \executeifdefined{\@@tblprefix\c!x\positivecol\c!y\positiverow}\donothing
+ \executeifdefined{\@@tblprefix\c!x\negativecol\c!y\negativerow}\donothing
\global\letcscsname\@@tblsplitafter\csname\@@tbl\@@tbl\c!after\endcsname
\relax}
+% we cannot use +n (checking on number/last/first would slow down too much)
+%
+% \setupTABLE[r] [2][color=red]
+% \setupTABLE[r] [-2][color=red]
+% \setupTABLE[c] [2][color=green]
+% \setupTABLE[c] [-2][color=green]
+% \setupTABLE[4] [4][color=blue]
+% \setupTABLE[-4][-4][color=blue]
+%
+% \bTABLE
+% \dorecurse{10}{\bTR \dorecurse{6}{\bTD xxx \eTD} \eTR}
+% \eTABLE
+
\globallet\@@tblsplitafter\relax
% split + page:
@@ -283,50 +336,30 @@
\let\eTR\relax % handy in \expanded
\setupTABLE[\v!row][\maximumrow][#1]}
-% \long\def\parseTD[#1][#2]#3\eTD % [#2] is dummy that kills spaces
-% {\getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,#1]%
-% % goto first cell
-% \doloop
-% {\increment\currentcol
-% \doifnottbltag\maximumrow\currentcol\exitloop}%
-% % fill r*c cells and set span
-% \let\row\maximumrow
-% \let\col\currentcol
-% \dorecurse\tblny
-% {\let\col\currentcol
-% \settblcol\row\col\tblnx
-% \ifnum\tblnx>\maximumrowspan\relax
-% \let\maximumrowspan\tblnx
-% \fi
-% \dorecurse\tblnx
-% {\settbltag\row\col\tblnone
-% \increment\col}%
-% \increment\row}%
-% % check max column
-% \decrement\col
-% \ifnum\col>\maximumcol\relax
-% \let\maximumcol\col
-% \fi
-% % set values
-% \settbltag\maximumrow\currentcol\tblcell
-% \settblcol\maximumrow\currentcol\tblnx
-% \settblrow\maximumrow\currentcol\tblny
-% % save text
-% \edef\celltag{{\maximumrow}{\currentcol}}%
-% \@EA\settbltxt\@EA\maximumrow\@EA\currentcol\@EA
-% {\@EA\handleTBLcell\celltag[#1]{#3}}}
-
\long\def\parseTD[#1][#2]#3\eTD % [#2] is dummy that kills spaces
- {\getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,\c!n=\currentcol,#1]%
- % goto first cell % NEW, n=cellnumber
+ {\getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,\c!n=\currentcol,\c!m=,#1]%
+ % goto first cell % NEW, n/m=cellnumber
\increment\currentcolpos
- \doifvaluesomething{\@@tbl\c!n}
+ \doifelsevaluenothing{\@@tbl\c!n}
+ {\increment(\spnTBL,\tblnx)\relax}
{\ifnum\getvalue{\@@tbl\c!n}=\currentcol\else
\scratchcounter\getvalue{\@@tbl\c!n}%
\advance\scratchcounter-\currentcol
- \advance\scratchcounter\plusone
- \expanded{\parseTD[][\c!nx=\the\scratchcounter]}\eTD
- \getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,\c!n=\currentcol,#1]%
+ \advance\scratchcounter\minusone
+\advance\scratchcounter-\spnTBL
+ \ifnum\scratchcounter>\zerocount
+ \expanded{\parseTD[\c!nx=\the\scratchcounter,\c!n=,\c!m=,*sq=\v!no][]}\eTD
+ \fi
+ \getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,#1,\c!n=,\c!m=]%
+ \fi}%
+ \doifvaluesomething{\@@tbl\c!m}
+ {\ifnum\getvalue{\@@tbl\c!m}=\currentcol\else
+ \scratchcounter\getvalue{\@@tbl\c!m}%
+ \advance\scratchcounter-\currentcol
+ \advance\scratchcounter\minusone
+% \advance\scratchcounter-\spnTBL
+ \dorecurse\scratchcounter{\expanded{\parseTD[\c!n=,\c!m=][]}\eTD}%
+ \getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,#1,\c!n=,\c!m=]%
\fi}%
\doloop
{\increment\currentcol
@@ -345,7 +378,7 @@
\increment\col}%
\increment\row}%
% check max column
- \decrement\col
+ \decrement\col\relax
\ifnum\col>\maximumcol\relax
\let\maximumcol\col
\fi
@@ -357,6 +390,41 @@
\edef\celltag{{\maximumrow}{\currentcol}}%
\@EA\settbltxt\@EA\maximumrow\@EA\currentcol\@EA
{\@EA\handleTBLcell\celltag[#1]{#3}}}
+
+%D The usage of n and m:
+%D
+%D \startbuffer
+%D \bTABLE[width=3em]
+%D \bTR\bTD d1 \eTD\bTD[n=2] d2 \eTD\bTD[n=5] d5 \eTD\bTD[n=7] d7 \eTD\eTR
+%D \bTR\bTD f1 \eTD\bTD[n=4] f4 \eTD\bTD[n=5] f5 \eTD\bTD[n=7] f7 \eTD\eTR
+%D \eTABLE
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \bTABLE[width=3em]
+%D \bTR\bTD d1 \eTD\bTD[m=2] d2 \eTD\bTD[m=5] d5 \eTD\bTD[m=7] d7 \eTD\eTR
+%D \bTR\bTD f1 \eTD\bTD[m=4] f4 \eTD\bTD[m=5] f5 \eTD\bTD[m=7] f7 \eTD\eTR
+%D \eTABLE
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D \bTABLE[frame=on]
+%D \bTR \bTH[nc=3] One \eTH \bTH[m=4] Four \eTH\eTR
+%D \bTR \bTD a \eTD\bTD b \eTD\bTD c \eTD\bTD d \eTD\eTR
+%D \eTABLE
+%D
+%D \bTABLE[frame=on]
+%D \bTR \bTH[nr=2] One \eTH \bTH[m=3] Three \eTH\eTR
+%D \bTR \bTD[m=3] a \eTD\bTD b \eTD\bTD c \eTD\bTD d \eTD\eTR
+%D \bTR \bTD[m=3] a \eTD\bTD b \eTD\bTD c \eTD\bTD d \eTD\eTR
+%D \eTABLE
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
\long\def\parseTH[#1]#2\eTH
{\parseTD[#1,\c!color=\tbltblheadcolor,\c!style=\tbltblheadstyle,\c!aligncharacter=\v!no]#2\eTD}
@@ -366,6 +434,51 @@
\long\def\parseTN[#1]#2\eTN
{\parseTD[#1]\digits#2\relax\eTD}
+%D Vit Zyka needed the option to create a distance between columns, so I
+%D added support for individual column distances.
+%D
+%D \startbuffer
+%D % \setupTABLE[c][each][distance=2em]
+%D \setupTABLE[c][1][distance=2em]
+%D \setupTABLE[c][2][distance=3em]
+%D
+%D \bTABLE
+%D \bTR \bTD test \eTD \bTD test \eTD \bTD test \eTD \eTR
+%D \bTR \bTD[nx=2] test \eTD \bTD test \eTD \eTR
+%D \bTR \bTD test \eTD \bTD[nx=2] test \eTD \eTR
+%D \eTABLE
+%D
+%D \bTABLE[option=stretch]
+%D \bTR \bTD test \eTD \bTD test \eTD \bTD test \eTD \eTR
+%D \bTR \bTD[nx=2] test \eTD \bTD test \eTD \eTR
+%D \bTR \bTD test \eTD \bTD[nx=2] test \eTD \eTR
+%D \eTABLE
+%D \stopbuffer
+%D
+%D \typebuffer \startlinecorrection \getbuffer \stoplinecorrection
+%D
+%D and he provided patches for the global left and right margin distances
+%D as well as the columndistance (although i changed the names -). Here
+%D is his testcase:
+%D
+%D \startbuffer
+%D \framed[offset=overlay]\bgroup
+%D \setupTABLE[column][2][align=left]%
+%D \setupTABLE[column][3][align=right]%
+%D \bTABLE[columndistance=2cm,leftmargindistance=.3cm,rightmargindistance=.5cm]
+%D \bTR \bTH[nc=3] Table head\eTH \eTR
+%D \bTR \bTD[nc=2] AB\eTD \bTD C\eTD \eTR
+%D \bTR \bTD[nc=2,align=left] AB\eTD \bTD C\eTD \eTR
+%D \bTR \bTD[nc=2,align=middle] AB\eTD \bTD C\eTD \eTR
+%D \bTR \bTD A\eTD \bTD B\eTD \bTD C\eTD \eTR
+%D \bTR \bTD Aa\eTD \bTD Bb\eTD \bTD Cccc\eTD \eTR
+%D \bTR \bTD[nc=3,align=middle] ABC\eTD \eTR
+%D \eTABLE
+%D \egroup
+%D \stopbuffer
+%D
+%D \typebuffer \startlinecorrection \getbuffer \stoplinecorrection
+
\newtoks\TBLhead
\newtoks\TBLnext
\newtoks\TBLbody
@@ -414,7 +527,8 @@
\processaction
[\tbltblsplit]
[ \v!yes=>\enableTBLbreaktrue,
- \v!repeat=>\enableTBLbreaktrue\multipleTBLheadstrue]%
+ \v!repeat=>\enableTBLbreaktrue\multipleTBLheadstrue,
+ \v!auto=>\ifinsidesplitfloat\enableTBLbreaktrue\fi]
\processaction
[\tbltblheader]
[\v!repeat=>\multipleTBLheadstrue]%
@@ -520,22 +634,24 @@
\doifnottblcol\row\col{\settblcol\row\col\!!zerocount}%
\doifnottbltag\row\col{\settbltag\row\col\tblnone}}}%
% check and do
- \startTBLprocessing
- \begTBL
- \dorecurse\maximumrow
- {\bTBL
- \let\row\recurselevel
- \dorecurse\maximumcol
- {\let\col\recurselevel
- \expanded{\doTBL{\row}{\col}}}%
- \eTBL}%
- \removeunwantedspaces % only if hmode
- \endTBL
- \stopTBLprocessing
- % wrong ! ! ! better to have an auto-offset-overlay
- % \ifnum\TBLlevel>1
- % \vskip-\strutdp
- % \fi
+ \ifcase\maximumcol\else
+ \startTBLprocessing
+ \begTBL
+ \dorecurse\maximumrow
+ {\bTBL
+ \let\row\recurselevel
+ \dorecurse\maximumcol
+ {\let\col\recurselevel
+ \expanded{\doTBL{\row}{\col}}}%
+ \eTBL}%
+ \removeunwantedspaces % only if hmode
+ \endTBL
+ \stopTBLprocessing
+ % wrong ! ! ! better to have an auto-offset-overlay
+ % \ifnum\TBLlevel>1
+ % \vskip-\strutdp
+ % \fi
+ \fi
\egroup
\popTBL}
@@ -573,19 +689,30 @@
{\doglobal\increment\colTBL}
\def\nexttblcol
- {\doglobal\increment\colTBL&}
+ {\doglobal\increment\colTBL
+ \kern\tbltblcolumndistance
+ &}
\def\spantblcol
{\span}
+\newcounter\rowTBL
+\newcounter\colTBL
+\newcounter\spnTBL
+
\def\begintblrow
{\noalign
- {\doglobal\increment\rowTBL
+ {\doglobal\increment \rowTBL
+ \doglobal\newcounter\spnTBL
\doglobal\newcounter\colTBL}%
- \nexttblcol}
+ \nexttblcol
+ \kern\tbltblleftmargindistance
+ \kern-\tbltblcolumndistance}
\def\endtblrow
- {\crcr
+ {\kern-\tbltblcolumndistance
+ \kern\tbltblrightmargindistance
+ \crcr
\noalign
{\nointerlineskip
\allowbreak
@@ -611,6 +738,7 @@
\def\begintbl
{\doglobal\newcounter\colTBL
\doglobal\newcounter\rowTBL
+ \doglobal\newcounter\spnTBL
\doglobal\decrement\rowTBL
\tabskip\zeropoint
\halign\bgroup
@@ -635,6 +763,7 @@
\def\begTBL
{\doglobal\newcounter\rowTBL
\doglobal\newcounter\colTBL
+ \doglobal\newcounter\spnTBL
\chardef\TBLpass\zerocount
\tbltoks\emptytoks
\appendtoks
@@ -659,7 +788,8 @@
{\settblwd \recurselevel\xcol\!!zeropoint
\settblht \recurselevel\xcol\!!zeropoint}%
% till here
- \settblwid\recurselevel\!!zeropoint}%
+ \settblwid\recurselevel\!!zeropoint
+ \settbldis\recurselevel\!!zeropoint}%
\dorecurse\maximumrow
{\settblhei\recurselevel\maxdimen}%
\chardef\TBLpass\plusone
@@ -674,6 +804,7 @@
\settblaut\colTBL\localwidth
\fi}}%
\setbox0\vbox{\trialtypesettingtrue \the\tbltoks}%
+\settbldis\maximumcol{\zeropoint}%
\ifautoTBLspread
% experimental, stretch non fixed cells to \hsize
\checktblwidthsone % trial run
@@ -690,8 +821,11 @@
\fi
\else\ifautoTBLrowspan\ifnum\maximumrowspan>1 % max ?
% added jan 2002 because nx=* did no longer work
+\edef\savedhsize{\the\hsize}%
+\hsize\wd0\relax % new per 17/04/2006
\checktblwidthsone % trial run
\checktblwidthstwo % real run
+\hsize\savedhsize
%
\let\handleTBLcell\dohandleTBLcellC
\setbox\scratchbox\vbox{\trialtypesettingtrue \the\tbltoks}%
@@ -703,7 +837,10 @@
\globalpushmacro\colTBL
\dorecurse{\gettblcol{##1}{##2}}
{\advance\dimen2 \gettblwid\colTBL
+ \advance\dimen2 \tbltblcolumndistance
+\ifnum\recurselevel<\gettblcol{##1}{##2}\relax \advance\dimen2 \gettbldis\colTBL\fi
\increment\colTBL}%
+ \advance\dimen2 -\tbltblcolumndistance
\edef\widthTBL{\the\dimen2}%
\globalpopmacro\colTBL
\setbox\scratchbox\hbox{\gettbltxt{##1}{##2}}%
@@ -739,7 +876,10 @@
\scratchdimen\zeropoint
\dorecurse{\gettblcol{##1}{##2}}
{\advance\scratchdimen \gettblwid\colTBL
+ \advance\scratchdimen \tbltblcolumndistance
+\ifnum\recurselevel<\gettblcol{##1}{##2}\relax \advance\scratchdimen \gettbldis\colTBL\fi
\increment\colTBL}%
+ \advance\scratchdimen -\tbltblcolumndistance
\edef\widthTBL{\the\scratchdimen}%
\globalpopmacro\colTBL
% cell
@@ -764,18 +904,26 @@
\fi\fi{\the\tbltoks}}
\def\stretchtblwidths
- {\!!dimend\zeropoint
- \dorecurse\maximumcol
- {\advance\!!dimend\gettblwid\recurselevel}%
- % distribute width (stretch)
- \ifdim\!!dimend<\hsize
- \advance\!!dimend-\hsize
- \!!dimend-\!!dimend
- \divide\!!dimend\maximumcol
+ {\ifcase\maximumcol\else % else division by zero
+ \!!dimend\zeropoint
+ \!!dimene\hsize
\dorecurse\maximumcol
- {\scratchdimen\gettblwid\recurselevel
- \advance\scratchdimen\!!dimend
- \settblwid\recurselevel{\the\scratchdimen}}%
+ {\advance\!!dimend \gettblwid\recurselevel
+ \advance\!!dimend \tbltblcolumndistance
+ \advance\!!dimene-\gettbldis\recurselevel}%
+ \advance\!!dimend-\tbltblcolumndistance
+ \advance\!!dimend\tbltblleftmargindistance
+ \advance\!!dimend\tbltblrightmargindistance
+ % distribute width (stretch)
+ \ifdim\!!dimend<\!!dimene
+ \advance\!!dimend-\!!dimene
+ \!!dimend-\!!dimend
+ \divide\!!dimend\maximumcol
+ \dorecurse\maximumcol
+ {\scratchdimen\gettblwid\recurselevel
+ \advance\scratchdimen\!!dimend
+ \settblwid\recurselevel{\the\scratchdimen}}%
+ \fi
\fi}
\newbox\finaltblbox
@@ -787,99 +935,116 @@
\box\finaltblbox
\afterTABLEbox}
+% \def\splittblbox#1%
+% {\ifinsidefloat
+% \notsplittblbox{#1}%
+% \else
+% \executeifdefined{splittblbox\tbltblsplitmethod}\splittblboxa{#1}%
+% \fi}
+
\def\splittblbox#1%
- {\ifinsidefloat
- \notsplittblbox{#1}%
+ {\ifinsidesplitfloat
+ \donetrue
+ \else\ifinsidefloat
+ \donefalse
\else
- \executeifdefined{splittblbox\tbltblsplitmethod}\splittblboxa{#1}%
+ \donetrue
+ \fi\fi
+ \ifdone
+ \executeifdefined{dosplittblbox\tbltblsplitmethod}\dosplittblbox{#1}%
+ \else
+ \notsplittblbox{#1}%
\fi}
\newbox\TABLEsplitbox % public, don't change
-% todo: mode: first|next (of niets)
+\let\extratblsplitheight\zeropoint % additional space taken by before/afterTABLEsplitbox
-\def\splittblboxa#1% spacing between rows gets lost in split
- {\setbox\TABLEsplitbox\vbox{#1}%
- \setbox8\vbox{\doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}}%
- \ifmultipleTBLheads
- \setbox2\vbox{}%
- \setbox4\vbox{}%
- \dorecurse\noftblheadlines
- {\setbox0\vsplit\TABLEsplitbox to \lineheight
- \setbox2\vbox{\unvcopy2\unvcopy0}}%
- \dorecurse\noftblnextlines
- {\setbox0\vsplit\TABLEsplitbox to \lineheight
- \setbox4\vbox{\unvcopy4\unvcopy0}}%
- \ifcase\noftblheadlines\else
- \ifdim\pagegoal<\maxdimen
- \dimen0\ht2
- \advance\dimen0\ht8
- \advance\dimen0\pagetotal\relax
- \ifdim\dimen0>\pagegoal
- \bgroup\page\egroup % make sure that local vars are kept
- \fi
- \fi
- \unvcopy2
- \ifcase\noftblnextlines\else
- \setbox2\box4
- \fi
- \fi
- \fi
- \donefalse
- \!!doneafalse
- \doloop
- {\setbox0\vsplit\TABLEsplitbox to \lineheight
- \if!!donea
- \ifdim\pagegoal<\maxdimen
- \setbox0\vbox{\unvbox0}%
- \ifdim\ht0>\zeropoint
- \dimen0\ht0
- \advance\dimen0\ht8
- \advance\dimen0\pagetotal\relax
- \ifdim\dimen0>\pagegoal
- \bgroup\page\egroup % make sure that local vars are kept
- \ifmultipleTBLheads
- \ifcase\noftblheadlines\else\unvcopy2\fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \!!doneatrue
- \ifdone
- \doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}%
- \fi
- \unvbox0
- %\allowbreak
- \bgroup
- % todo: what if tblnextlines ?
- \scratchcounter\recurselevel
- \ifmultipleTBLheads
- \advance\scratchcounter\noftblheadlines
- \fi
- \setupTBLcell{\number\scratchcounter}1
- \ifx\@@tblsplitafter\relax
- \allowbreak
- \else
- \doifelsenothing\@@tblsplitafter
- \allowbreak
- {\scratchcounter\realpageno
- \@@tblsplitafter
- \ifmultipleTBLheads
- \ifnum\scratchcounter<\realpageno
- \ifcase\noftblheadlines\else\unvcopy2\fi
- \fi
- \fi}%
- \fi
- \egroup
- \ifvoid\TABLEsplitbox \exitloop \else \donetrue \fi}}
+% todo: mode: first|next (of niets)
-\let\extratblsplitheight\zeropoint % additional space taken by before/afterTABLEsplitbox
+% \def\dosplittblboxa#1% spacing between rows gets lost in split
+% {\setbox\TABLEsplitbox\vbox{#1}%
+% \setbox8\vbox{\doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}}%
+% \ifmultipleTBLheads
+% \setbox2\vbox{}%
+% \setbox4\vbox{}%
+% \dorecurse\noftblheadlines
+% {\setbox0\vsplit\TABLEsplitbox to \lineheight
+% \setbox2\vbox{\unvcopy2\unvcopy0}}%
+% \dorecurse\noftblnextlines
+% {\setbox0\vsplit\TABLEsplitbox to \lineheight
+% \setbox4\vbox{\unvcopy4\unvcopy0}}%
+% \ifcase\noftblheadlines\else
+% \ifdim\pagegoal<\maxdimen
+% \dimen0\ht2
+% \advance\dimen0\ht8
+% \advance\dimen0\pagetotal\relax
+% \ifdim\dimen0>\pagegoal
+% \bgroup\page\egroup % make sure that local vars are kept
+% \fi
+% \fi
+% \unvcopy2
+% \ifcase\noftblnextlines\else
+% \setbox2\box4
+% \fi
+% \fi
+% \fi
+% \donefalse
+% \!!doneafalse
+% \doloop
+% {\setbox0\vsplit\TABLEsplitbox to \lineheight
+% \if!!donea
+% \ifdim\pagegoal<\maxdimen
+% \setbox0\vbox{\unvbox0}%
+% \ifdim\ht0>\zeropoint
+% \dimen0\ht0
+% \advance\dimen0\ht8
+% \advance\dimen0\pagetotal\relax
+% \ifdim\dimen0>\pagegoal
+% \bgroup\page\egroup % make sure that local vars are kept
+% \ifmultipleTBLheads
+% \ifcase\noftblheadlines\else\unvcopy2\fi
+% \fi
+% \fi
+% \fi
+% \fi
+% \fi
+% \!!doneatrue
+% \ifdone
+% \doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}%
+% \fi
+% \unvbox0
+% %\allowbreak
+% \bgroup
+% % todo: what if tblnextlines ?
+% \scratchcounter\recurselevel
+% \ifmultipleTBLheads
+% \advance\scratchcounter\noftblheadlines
+% \fi
+% \setupTBLcell{\number\scratchcounter}1
+% \ifx\@@tblsplitafter\relax
+% \allowbreak
+% \else
+% \doifelsenothing\@@tblsplitafter
+% \allowbreak
+% {\scratchcounter\realpageno
+% \@@tblsplitafter
+% \ifmultipleTBLheads
+% \ifnum\scratchcounter<\realpageno
+% \ifcase\noftblheadlines\else\unvcopy2\fi
+% \fi
+% \fi}%
+% \fi
+% \egroup
+% \ifvoid\TABLEsplitbox \exitloop \else \donetrue \fi}}
-% \def\splittblboxb#1%
-% {\testpage[2]% quite save since a row is > 1 lineheight and we don't want one-liners
+% \def\dosplittblboxb#1%
+% {\scratchdimen-\extratblsplitheight
+% \advance\scratchdimen-\tbltblsplitoffset
+% \expanded{\testpage[2][\the\scratchdimen]}% quite save since a row is > 1 lineheight and we don't want one-liners
% \setbox\TABLEsplitbox\vbox{#1}%
% \setbox8\vbox{\doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}}%
+% \dimen8\ht8\advance\dimen8\dp8
% \ifmultipleTBLheads
% \setbox2\vbox{}%
% \setbox4\vbox{}%
@@ -895,33 +1060,57 @@
% {\ifdim\pagegoal<\maxdimen
% \scratchdimen\pagegoal
% \advance\scratchdimen-\pagetotal
+% \!!donecfalse
% \else
% \scratchdimen\textheight
+% \!!donectrue
% \fi
-% \ifmultipleTBLheads
-% \ifcase\noftblheadlines\else
-% \advance\scratchdimen-\ht2
-% \fi
-% \fi
-% \advance\scratchdimen-\ht8
-% \getnoflines\scratchdimen
-% \ifdim\noflines\lineheight>\scratchdimen
-% \advance\scratchdimen-\lineheight
-% \fi
+% \advance\scratchdimen-\dimen8
% \advance\scratchdimen-\extratblsplitheight
+% \advance\scratchdimen-\tbltblsplitoffset
% \setbox\finaltblbox\vbox
% {\ifmultipleTBLheads
% \ifcase\noftblheadlines\else
-% \unvcopy2
-% \doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}%
+% \unvcopy2 \doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}%
% \fi
-% \fi
-% \setbox0\vsplit\TABLEsplitbox to\scratchdimen
-% \unvbox0}%
+% \fi}%
% \if!!donea\else\ifcase\noftblnextlines\else
% \setbox2\box4
% \fi\fi
% \!!doneatrue
+% % alternatively we could use a kind of balancing like splitter
+% % first to scratchdimen and then smaller etc; more code and copy -)
+% \!!counta\zerocount
+% \doloop
+% {\setbox\scratchbox\vsplit\TABLEsplitbox to \onepoint
+% \setbox\scratchbox\vbox{\unvbox\scratchbox}%
+% \bgroup
+% \advance\scratchdimen-\ht\scratchbox
+% \advance\scratchdimen-\dp\scratchbox
+% \advance\scratchdimen-\ht\finaltblbox
+% \advance\scratchdimen-\dp\finaltblbox\relax
+% \ifdim\scratchdimen>\zeropoint
+% \egroup
+% \setbox\finaltblbox\vbox
+% {\unvbox\finaltblbox
+% \unvbox\scratchbox}%
+% \ifvoid\TABLEsplitbox \exitloop \fi
+% \else\if!!donec
+% % we have text height available, but the (one) cell is too
+% % large to fit, so, in order to avoid loops/deadcycles we do:
+% \egroup
+% \setbox\finaltblbox\vbox
+% {\unvbox\finaltblbox
+% \unvbox\scratchbox}%
+% \exitloop
+% \else
+% \egroup
+% \setbox\TABLEsplitbox\vbox
+% {\unvbox\scratchbox
+% \ifvoid\TABLEsplitbox\else\unvbox\TABLEsplitbox\allowbreak\fi}%
+% \exitloop
+% \fi\fi}%
+% %
% \postprocessTABLEsplitbox\finaltblbox
% \ifvoid\TABLEsplitbox
% \beforeTABLEsplitbox
@@ -930,116 +1119,42 @@
% \@@tblsplitafter
% \exitloop
% \else
-% % hack
-% \scratchdimen\pagegoal
-% \ifdim\scratchdimen<\maxdimen
+% % hack
+% \ifdim\pagegoal<\maxdimen
+% \scratchdimen\pagegoal
% \advance\scratchdimen \lineheight
% \global\pagegoal\scratchdimen
% \fi
% % brrr
-% \beforeTABLEsplitbox
-% \box\finaltblbox
-% \afterTABLEsplitbox
-% \@@tblsplitafter
+% \ifdim\ht\finaltblbox>\zeropoint
+% \beforeTABLEsplitbox
+% \box\finaltblbox
+% \afterTABLEsplitbox
+% \@@tblsplitafter
+% \fi
% \page
% \fi}}
-\def\splittblboxb#1%
- {\scratchdimen-\extratblsplitheight
- \advance\scratchdimen-\tbltblsplitoffset
- \expanded{\testpage[2][\the\scratchdimen]}% quite save since a row is > 1 lineheight and we don't want one-liners
- \setbox\TABLEsplitbox\vbox{#1}%
- \setbox8\vbox{\doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}}%
- \dimen8\ht8\advance\dimen8\dp8
+\def\dosplittblbox#1%
+ {\resettsplit
+ \def\tsplitminimumfreelines{2}%
+ \def\tsplitminimumfreespace{\dimexpr\extratblsplitheight+\tbltblsplitoffset\relax}%
+ \def\tsplitbeforeresult {\beforeTABLEsplitbox}%
+ \def\tsplitafterresult {\afterTABLEsplitbox}%
+ \def\tsplitafter {\@@tblsplitafter}%
+ \setbox\tsplitcontent\vbox{#1}% \the\tbltoks
\ifmultipleTBLheads
- \setbox2\vbox{}%
- \setbox4\vbox{}%
\dorecurse\noftblheadlines
- {\setbox0\vsplit\TABLEsplitbox to \lineheight
- \setbox2\vbox{\unvcopy2\unvcopy0}}%
+ {\setbox\scratchbox\vsplit\tsplitcontent to \lineheight
+ \setbox\tsplithead\vbox{\unvcopy\tsplithead\unvcopy\scratchbox}}%
\dorecurse\noftblnextlines
- {\setbox0\vsplit\TABLEsplitbox to \lineheight
- \setbox4\vbox{\unvcopy4\unvcopy0}}%
+ {\setbox\scratchbox\vsplit\tsplitcontent to \lineheight
+ \setbox\tsplitnext\vbox{\unvcopy\tsplitnext\unvcopy\scratchbox}}%
\fi
- \!!doneafalse
- \doloop
- {\ifdim\pagegoal<\maxdimen
- \scratchdimen\pagegoal
- \advance\scratchdimen-\pagetotal
- \!!donecfalse
- \else
- \scratchdimen\textheight
- \!!donectrue
- \fi
- \advance\scratchdimen-\dimen8
- \advance\scratchdimen-\extratblsplitheight
- \advance\scratchdimen-\tbltblsplitoffset
- \setbox\finaltblbox\vbox
- {\ifmultipleTBLheads
- \ifcase\noftblheadlines\else
- \unvcopy2 \doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}%
- \fi
- \fi}%
- \if!!donea\else\ifcase\noftblnextlines\else
- \setbox2\box4
- \fi\fi
- \!!doneatrue
- % alternatively we could use a kind of balancing like splitter
- % first to scratchdimen and then smaller etc; more code and copy -)
- \!!counta\zerocount
- \doloop
- {\setbox\scratchbox\vsplit\TABLEsplitbox to \onepoint
- \setbox\scratchbox\vbox{\unvbox\scratchbox}%
- \bgroup
- \advance\scratchdimen-\ht\scratchbox
- \advance\scratchdimen-\dp\scratchbox
- \advance\scratchdimen-\ht\finaltblbox
- \advance\scratchdimen-\dp\finaltblbox\relax
- \ifdim\scratchdimen>\zeropoint
- \egroup
- \setbox\finaltblbox\vbox
- {\unvbox\finaltblbox
- \unvbox\scratchbox}%
- \ifvoid\TABLEsplitbox \exitloop \fi
- \else\if!!donec
- % we have text height available, but the (one) cell is too
- % large to fit, so, in order to avoid loops/deadcycles we do:
- \egroup
- \setbox\finaltblbox\vbox
- {\unvbox\finaltblbox
- \unvbox\scratchbox}%
- \exitloop
- \else
- \egroup
- \setbox\TABLEsplitbox\vbox
- {\unvbox\scratchbox
- \ifvoid\TABLEsplitbox\else\unvbox\TABLEsplitbox\allowbreak\fi}%
- \exitloop
- \fi\fi}%
- %
- \postprocessTABLEsplitbox\finaltblbox
- \ifvoid\TABLEsplitbox
- \beforeTABLEsplitbox
- \box\finaltblbox
- \afterTABLEsplitbox
- \@@tblsplitafter
- \exitloop
- \else
- % hack
- \ifdim\pagegoal<\maxdimen
- \scratchdimen\pagegoal
- \advance\scratchdimen \lineheight
- \global\pagegoal\scratchdimen
- \fi
- % brrr
- \ifdim\ht\finaltblbox>\zeropoint
- \beforeTABLEsplitbox
- \box\finaltblbox
- \afterTABLEsplitbox
- \@@tblsplitafter
- \fi
- \pagina
- \fi}}
+ \doifsomething\tbltblspaceinbetween
+ {\def\tsplitinbetween{\blank[\tbltblspaceinbetween]}}%
+ \def\postprocesstsplit{\postprocessTABLEsplitbox{\box\tsplitresult}}%
+ \handletsplit}
% ! ! ! ! TODO: naast \postprocessTABLEsplitbox ook evt \postprocessTABLEbox voor niet split
@@ -1058,8 +1173,14 @@
{\iftraceTABLE\showtblwids{B#1}\fi
\!!dimena\hsize
\!!counta\zerocount
+% test, dunno yet
+\advance\!!dimena-\tbltblleftmargindistance
+\advance\!!dimena-\tbltblrightmargindistance
+\advance\!!dimena-\tbltblcolumndistance
\dorecurse\maximumcol
{\scratchdimen\gettblaut\recurselevel\relax
+% test, seems to work ok
+\advance\!!dimena-\gettbldis\recurselevel\relax
\ifdim\scratchdimen>\zeropoint\relax
\advance\!!dimena -\scratchdimen
\else
@@ -1176,9 +1297,14 @@
% new, needed for icare first col of 'doeltabel', experimental
-\long\def\dohandleTBLcellA#1#2[#3]#4%
- {\setbox\scratchbox\hbox
- {\setupTBLcell{#1}{#2}%
+\long\def\dohandleTBLcellA#1#2[#3]#4% grouping added ! ! !
+ {\bgroup
+ \setupTBLcell{#1}{#2}%
+ \setbox\scratchbox\hbox
+ {\scratchdimen\tbltbldistance\relax
+ \ifdim\scratchdimen>\gettbldis{#2}\relax
+ \settbldis{#2}{\the\scratchdimen}%
+ \fi
\localframed
[\@@tbl\@@tbl]
[#3,\c!background=,\c!frame=\v!off]% 25% faster
@@ -1186,10 +1312,21 @@
\scratchdimen\gettblwid\colTBL\relax
\ifdim\wd\scratchbox>\scratchdimen
\ifsqueezeTBLspan
- \ifnum0\number\gettblcol{#1}{#2}>1\relax \settblspn\colTBL \fi
+ \ifautosqueezeTBLspan
+ \doifinsetelse\tbltblwidth{\v!fit,\v!fixed,\v!broad,\v!local}
+ \donetrue \donefalse
+ \else
+ \donetrue
+ \fi
+ \ifdone
+ \ifnum0\number\gettblcol{#1}{#2}>1\relax \settblspn\colTBL \fi
+ \fi
\fi
\doifelsetblspn\colTBL
- \donothing{\settblwid\colTBL{\the\wd\scratchbox}}% auto set
+ \donothing
+ {\ifdim\gettblwid\colTBL<\wd\scratchbox
+ \settblwid\colTBL{\the\wd\scratchbox}%
+ \fi}% auto set
\fi
\let\rowTBLx\rowTBL\increment\rowTBLx
\scratchdimen\gettblhei\rowTBLx\relax
@@ -1200,8 +1337,8 @@
\settblwd{#1}{#2}{\the\wd\scratchbox}%
\ifautoTBLcheckwidth
\ifdim\wd\scratchbox<.75\hsize
- \ifdim\ht\scratchbox>2\openlineheight % honor width since this can be a
- \scratchdimen\gettblaut\colTBL\relax % figure or so
+ \ifdim\ht\scratchbox>2\openlineheight % honor width since this
+ \scratchdimen\gettblaut\colTBL\relax % can be a figure or so
\ifdim\scratchdimen=\zeropoint
% side effect: when width is set to 0pt,
% we can force a span that fits the sum of spans widths
@@ -1210,14 +1347,16 @@
% unless span
\settblaut\colTBL{\the\wd\scratchbox}%
% to be translated
- \writestatus\m!TABLE{no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}%
+ \writestatus\m!TABLE
+ {no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}%
\fi\fi
\fi
\fi
\fi
\setbox2\null
\wd2\wd\scratchbox \ht2\ht\scratchbox \dp2\dp\scratchbox
- \box2}
+ \box2
+ \egroup}
\long\def\dohandleTBLcellBC#1#2#3[#4]#5%
{\setbox\scratchbox\hbox
@@ -1282,7 +1421,8 @@
[\@@tbl\@@tbl]
[\c!color=,\c!width=\widthTBL,\c!height=\heightTBL]
{\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL}%
- \fi}}
+ \fi}%
+ \hskip\gettbldis{#2}}
\setupTABLE
[\c!frameoffset=.5\linewidth,
@@ -1292,7 +1432,8 @@
\c!style=,
\c!headstyle=\v!bold,
\c!headcolor=,
- \c!strut=\v!no,
+ \c!strut=\v!yes,
+ \c!autostrut=\v!no,
\c!aligncharacter=\v!no,
\c!alignmentcharacter={,},
\c!option=, % \v!stretch
@@ -1300,8 +1441,14 @@
\c!spaceinbetween=,
\c!maxwidth=8em,
\c!textwidth=\hsize,
- \c!split=\v!no,
+ \c!split=\v!auto,
\c!splitoffset=0pt,
+ \c!distance=\zeropoint, % individual column
+ \c!columndistance=\zeropoint, % each column (whole table)
+ \c!leftmargindistance=\zeropoint, % whole table
+ \c!rightmargindistance=\zeropoint,% whole table
+ \c!left=,
+ \c!right=,
\c!splitmethod=a]
%D We have already prepared the previous macros for nesting,
@@ -1358,6 +1505,20 @@
\fi
\doglobal\decrement\TBLlevel\relax}
+% \bgroup
+% \setupTABLE[column][1][aligncharacter=yes, alignmentcharacter={,}]
+% \bTABLE
+% \bTR \bTD 1,2 \eTD \bTD 2 \eTD \eTR
+% \bTR \bTD 11,2 \eTD \bTD
+% {\setupTABLE[column][1][aligncharacter=yes, alignmentcharacter={,}]
+% \bTABLE
+% \bTR \bTD 1,2 \eTD \bTD 2 \eTD \eTR
+% \bTR \bTD 11,22 \eTD \bTD 2 \eTD \eTR
+% \bTR \bTD 11,2 \eTD \bTD 2 \eTD \eTR \eTABLE} \eTD \eTR
+% \bTR \bTD 11,22 \eTD \bTD 2 \eTD \eTR
+% \eTABLE
+% \egroup
+
\newconditional\resetTABLEmode \settrue\resetTABLEmode
\def\resetallTABLEparameters% moet genest wel werken
@@ -1426,6 +1587,34 @@
\def\TableTB{\doTableinterline{TB}}
\appendtoks\let\TB\TableTB \to\everytable
-\appendtoks\let\TB\TabulateTB\to\everytabulate
+\appendtoks\let\TB\TabulateTB\to\everytabulate % strange place
+
+\appendtoks \chardef\recodeverbatimmode\plustwo \to \everytable
+
+% new (for Olivier Turlier)
+%
+% \defineTABLEsetup [xx] [foregroundcolor=red]
+%
+% \bTABLE
+% \bTR \bTD oeps \eTD \bTD oeps \eTD \eTR
+% \bTR \bTDs[xx] oeps \eTDs \bTD oeps \eTD \eTR
+% \bTRs[xx] \bTD oeps \eTD \bTD oeps \eTD \eTRs
+% \eTABLE
+
+\def\defineTABLEsetup
+ {\dodoubleargument\dodefineTABLEsetup}
+
+\def\dodefineTABLEsetup[#1][#2]%
+ {\setvalue{\@@tbl:set:#1}{#2}}
+
+\long\def\bTDs[#1]#2\eTDs
+ {\doifdefinedelse{\@@tbl:set:#1}
+ {\@EA\@EA\@EA\bTD\@EA\@EA\@EA[\csname\@@tbl:set:#1\endcsname]#2\eTD}
+ {\bTD[]#2\eTD}}
+
+\long\def\bTRs[#1]#2\eTRs
+ {\doifdefinedelse{\@@tbl:set:#1}
+ {\@EA\@EA\@EA\bTR\@EA\@EA\@EA[\csname\@@tbl:set:#1\endcsname]#2\eTR}
+ {\bTR[]#2\eTR}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/core-num.tex b/Master/texmf-dist/tex/context/base/core-num.tex
index 1054c4e1907..2747ea5e74e 100644
--- a/Master/texmf-dist/tex/context/base/core-num.tex
+++ b/Master/texmf-dist/tex/context/base/core-num.tex
@@ -72,8 +72,10 @@
\c!location=, % no longer used here, will go away (was ooit \c!zetwijze)
\c!conversion=\v!numbers,
\c!start=0,
+ \c!state=\v!start,
#2]%
\makecounter{\@@thenumber{#1}}%
+ \setxvalue{\@@thenumber{#1}\c!n}{\countervalue{\@@thenumber{#1}}}%
\setcounter{\@@thenumber{#1}}{\numberparameter{#1}\c!start}}
\def\setnumber[#1]#2%
@@ -82,9 +84,6 @@
\def\resetnumber[#1]%
{\setcounter{\@@thenumber{#1}}{0\numberparameter{#1}\c!start}}
-\def\dodoreset#1%
- {\getvalue{\s!reset#1}}%
-
\def\savenumber[#1]%
{\savecounter{\@@thenumber{#1}}}
@@ -97,24 +96,36 @@
\def\doreset[#1]%
{\processcommalist[#1]\dodoreset}
+\def\dodoreset#1%
+ {\getvalue{\s!reset#1}}%
+
\def\reset
{\dosingleargument\doreset}
% nieuw, maar kan dit (i.v.m. (sub)page?)
% \def\incrementnumber[#1]%
-% {\checknummer{#1}%
+% {\checknumber[#1]%
% \doifelse\@@nrstatus\v!start
% {\pluscounter{\@@thenumber{#1}}}
% {\setcounter{\@@thenumber{#1}}{0\csname\@@thenumber{#1}\c!start\endcsname}}}
+% \def\incrementnumber[#1]% bypage tricky: needs a
+% {\doifelse{\numberparameter{#1}\c!way}{\v!by\v!page}
+% {\checkpagechange{#1}%
+% \ifpagechanged\resetcounter{\@@thenumber{#1}}\fi}
+% {\checknumber[#1]}%
+% \doifelse\@@nrstate\v!start % only here
+% {\pluscounter{\@@thenumber{#1}}}
+% {\setcounter{\@@thenumber{#1}}{0\numberparameter{#1}\c!start}}}
+
\def\incrementnumber[#1]% bypage tricky: needs a
{\doifelse{\numberparameter{#1}\c!way}{\v!by\v!page}
{\checkpagechange{#1}%
\ifpagechanged\resetcounter{\@@thenumber{#1}}\fi}
- {\checknummer{#1}}%
+ {\checknumber[#1]}%
\doifelse\@@nrstate\v!start % only here
- {\pluscounter{\@@thenumber{#1}}}
+ {\doif{\numberparameter{#1}\c!state}\v!start{\pluscounter{\@@thenumber{#1}}}}
{\setcounter{\@@thenumber{#1}}{0\numberparameter{#1}\c!start}}}
% \defineenumeration [test] [way=bypage,text=\lastchangedpage]
@@ -132,9 +143,12 @@
\def\rawnumber[#1]%
{\countervalue{\@@thenumber{#1}}}
+\def\accumulatednumber[#1]%
+ {\getvalue{\@@thenumber{#1}\c!n}}
+
\let\getnumber\convertednumber
-\ifx\checknummer\undefined \let\checknummer\gobbleoneargument \fi
+\ifx\checknumber\undefined \def\checknumber[#1]{} \fi
% ook de pag nummers hierheen halen ivm \@@nrwijze
diff --git a/Master/texmf-dist/tex/context/base/core-obj.tex b/Master/texmf-dist/tex/context/base/core-obj.tex
index 1e6720540ba..d9e51911c4a 100644
--- a/Master/texmf-dist/tex/context/base/core-obj.tex
+++ b/Master/texmf-dist/tex/context/base/core-obj.tex
@@ -50,6 +50,11 @@
31: obiect duplicat --
\stopmessages
+\startmessages french library: references
+ 30: objet -- inconnu
+ 31: objet -- dupliqué
+\stopmessages
+
%D \macros
%D {setobject,getobject,ifinobject}
%D
diff --git a/Master/texmf-dist/tex/context/base/core-pgr.tex b/Master/texmf-dist/tex/context/base/core-pgr.tex
new file mode 100644
index 00000000000..ea47363a744
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-pgr.tex
@@ -0,0 +1,1675 @@
+%D \module
+%D [ file=core-pgr, % split off core-pos
+%D version=1999.08.01,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Positioning Support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context Positioning Grapics}
+
+%D Before we come to graphics support, we have to make sure of
+%D the reference point on the page. The next macro does so and
+%D is hooked into the page building routine.
+
+\unprotect
+
+% in the future, the depth of tail will reflect page depth
+
+\def\textanchor{text:\realfolio}
+
+\ifx\textheight\undefined \def\textheight{\vsize} \fi
+
+\def\placepositionanchors % todo : depth pagebox
+ {\ifpositioning
+ \setbox\scratchbox\vbox to \textheight
+ {\simpletopskipcorrection
+ \hbox{\strut\dopositionaction\headanchor}%
+ \vfill
+ \hbox{\strut\dopositionaction\tailanchor}}%
+ \dp\scratchbox\zeropoint
+ \wd\scratchbox\makeupwidth % not \zeropoint, else wrong text backgrounds
+ \hpos\textanchor{\box\scratchbox}%
+ \else
+ \vskip\textheight
+ \fi}
+
+%D The first version of this module implemented head and tail
+%D anchors. Currently we stick to just one anchor and derive
+%D the head and tail anchors from this one.
+
+\def\headanchor{head:\realfolio} % virtual position
+\def\tailanchor{tail:\realfolio} % virtual position
+
+\def\presetpositionanchors% compatibility hack (still needed?)
+ {\ifpositioning
+ \dopresetpositionanchors
+ \fi}
+
+\def\dopresetpositionanchors
+ {\bgroup
+ \!!dimena\ifdim\topskip>\strutht\topskip\else\strutht\fi
+ \!!dimenb\MPy\textanchor
+ \!!dimenc\!!dimenb
+ \advance\!!dimenb \MPh\textanchor % space is essential
+ \advance\!!dimenb -\!!dimena
+ \advance\!!dimenc \strutdp
+ \!!dimend\MPx\textanchor
+ \!!dimene\MPw\textanchor
+ \setxvalue{\POSprefix\headanchor}%
+ {\realfolio,\withoutpt\the\!!dimend,\withoutpt\the\!!dimenb,%
+ \withoutpt\the\!!dimene,\withoutpt\the\!!dimena,\withoutpt\the\strutdp}%
+ \setxvalue{\POSprefix\tailanchor}%
+ {\realfolio,\withoutpt\the\!!dimend,\withoutpt\the\!!dimenc,%
+ \withoutpt\the\!!dimene,\withoutpt\the\strutht,\withoutpt\the\strutdp}%
+ %\showanchor\textanchor\showanchor\headanchor\showanchor\tailanchor\wait
+ \egroup}
+
+\def\showanchor#1%
+ {\expanded{\writestatus{#1}
+ {\MPp{#1}\string|\MPx{#1}\string|\MPy{#1}\string|%
+ \MPw{#1}\string|\MPh{#1}\string|\MPd{#1}}}}
+
+%D We set these anchors before and after each page.
+
+\appendtoks \presetpositionanchors \to \beforeeverypage
+\appendtoks \presetpositionanchors \to \aftereverypage
+
+%D \macros
+%D {positionoverlay,startpositionoverlay}
+%D
+%D As long as we're dealing with graphics it makes much sense
+%D to use the available overlay mechanism. For this purpose, we
+%D define some dedicated overlay extensions.
+%D
+%D \startbuffer[sample]
+%D \defineoverlay [sample] [\positionoverlay{sample}]
+%D
+%D \startpositionoverlay{sample}
+%D \setMPpositiongraphic{A-1}{connectcenter}{from=A-1,to=A-2}
+%D \stoppositionoverlay
+%D \stopbuffer
+%D
+%D \typebuffer[sample]
+%D
+%D \startbuffer[graphic]
+%D \startMPpositiongraphic{connectcenter}
+%D path pa, pb ; pair ca, cb ;
+%D initialize_box(\MPpos{\MPvar{from}}) ; pa := pxy ; ca := cxy ;
+%D initialize_box(\MPpos{\MPvar{to}}) ; pb := pxy ; cb := cxy ;
+%D draw pa withcolor red ;
+%D draw pb withcolor red ;
+%D draw ca -- cb withcolor blue ;
+%D anchor_box(\MPanchor{\MPvar{from}}) ;
+%D \stopMPpositiongraphic
+%D \stopbuffer
+%D
+%D We can best demonstrate this in an example, say:
+%D
+%D \startbuffer[text]
+%D \framed
+%D [backgroundachtergrond=sample,align=middle,width=7cm]
+%D {We want to connect \hpos {A-1} {this} word with its
+%D grammatical cousin \hpos {A-2} {that}.}
+%D \stopbuffer
+%D
+%D \typebuffer[text]
+%D
+%D \startlinecorrection
+%D %\getbuffer[graphic,sample,text]
+%D \stoplinecorrection
+%D
+%D The graphic is defined in the following way, using some
+%D macros defined in an auxiliary \METAPOST\ module that is
+%D preloaded.
+%D
+%D \typebuffer[graphic]
+
+\def\MPanchoridentifier{mpa} % {mp-anchor}
+\def\MPoverlayposprefix{MO::}
+
+% obsolete and wrong anyway
+%
+% \long\def\defineMPpositiongraphic#1%
+% {\long\setvalue{\MPoverlayposprefix#1}}
+
+%D The rest of the definitions concerning such overlays may
+%D look complicated,
+
+\let\currentpositionoverlay\empty
+
+%D Position actions are automatically executed when a position
+%D is set.
+
+\let\MPanchornumber\realfolio
+
+\def\positionoverlay#1% the test prevents too many redundant positions
+ {\ifpositioning % in (not used) text* position layers
+ \vbox to \overlayheight
+ {\doifpositionactionelse{#1::\MPanchoridentifier}%
+ {\edef\MPanchorid{#1::\MPanchoridentifier:\MPanchornumber}%
+ \edef\MPanchor##1{\MPpos{\MPanchorid}}%
+ \the\everyinsertpositionaction
+ \copyposition{#1::\MPanchoridentifier}{#1::\MPanchoridentifier:\MPanchornumber}%
+ \hpos
+ {#1::\MPanchoridentifier:\MPanchornumber}%
+ % this is ok
+ %{\hbox to \overlaywidth{\dopositionaction{#1::\MPanchoridentifier}\hss}}}%
+ % but this one prevents cyclic runs due to
+ % rounding errors
+ {\setbox\scratchbox\hbox to \overlaywidth
+ {\dopositionaction{#1::\MPanchoridentifier}\hss}%
+ \ht\scratchbox\overlayheight
+ \dp\scratchbox\zeropoint
+ \box\scratchbox}}%
+ {\hbox to \overlaywidth{\hss}}%
+ \vfill}%
+ \fi}
+
+\def\startpositionoverlay#1%
+ {\iftrialtypesetting % we don't want redundant entries in the list
+ \@EA\gobbleuntil\@EA\stoppositionoverlay
+ \else
+ \def\currentpositionoverlay{#1}%
+ \fi}
+
+\def\stoppositionoverlay
+ {\let\currentpositionoverlay\empty}
+
+\def\resetpositionoverlay#1%
+ {\dosetpositionaction{#1::\MPanchoridentifier::}{}}
+
+%D Here the complication has to do with collecting actions
+%D for later execution. This collection is especially handy
+%D when we want to move actions to a specific layer.
+%D Such series of actions are stored in a macro (the one
+%D with the funny \type {++}) which is cleaned up after each
+%D invocation.
+
+\newtoks\everycleanpositionaction
+\newtoks\everyinsertpositionaction
+
+\def\cleanuppositionaction#1% not in trialtypesetting
+ {\ifundefined{\POSactionprefix#1++}\else
+ \the\everycleanpositionaction
+ \iflocalpositioning
+ \letgvalue{\POSactionprefix#1++}\empty
+ \else
+ \setxvalue{\POSactionprefix#1++}{\getvalue{\POSactionprefix#1++}}%
+ \fi
+ \fi}
+
+\def\handlepositionaction#1\with#2\on#3%
+ {\bgroup
+ \ifx\currentpositionoverlay\empty
+ \edef\!!stringa{#3}% no layer, just pos itself as anchor
+ \else
+ \edef\!!stringa{\currentpositionoverlay::\MPanchoridentifier}%
+ \fi
+ \edef\!!stringc{\POSactionprefix\!!stringa++}%
+ \expanded{\dosetpositionaction{\!!stringa}{\noexpand\getvalue{\!!stringc}}}%
+ \global\let#1\relax
+ \edef\!!stringb{\executeifdefined\!!stringc\empty}%
+ \setxvalue\!!stringc{\!!stringb#1#2}%
+ \egroup}
+
+%D The indirectness enables us redefine macros for special
+%D purposes, like a cleanup.
+
+\def\handlepositionboxes#1#2#3%
+ {\handlepositionaction\dohandlepositionboxes\with{#1}{#2}{#3}\on{#2}}
+
+\def\doinsertpositionboxes#1#2#3% pos tag setups
+ {\ifnum\MPp{#1}=\realpageno\relax
+ % \doifdefined{\MPoverlayposprefix#1}
+ % {\getvalue{\MPoverlayposprefix#1}{#1}{#2}{#3}}%
+ \executeifdefined{\MPoverlayposprefix#1}%
+ \gobblethreearguments{#1}{#2}{#3}%
+ \fi}
+
+\appendtoks
+ \let\dohandlepositionboxes\doinsertpositionboxes % was handle ?
+\to \everyinsertpositionaction
+
+\def\docleanpositionboxes#1#2#3% pos tag setups
+ {\ifnum\MPp{#1}<\realpageno \else
+ \noexpand \dohandlepositionboxes{#1}{#2}{#3}% reinsert
+ \fi}
+
+\appendtoks
+ \let\dohandlepositionboxes\docleanpositionboxes
+\to \everycleanpositionaction
+
+%D A position graphic is a normal (non||reused) \METAPOST\
+%D graphic, used immediately, with zero dimensions, so that a
+%D sequence of them does not harm.
+
+\newbox\positiongraphicbox
+
+\def\startMPpositiongraphic % id setups
+ {\dodoublegroupempty\dostartMPpositiongraphic}
+
+\long\def\dostartMPpositiongraphic#1#2#3\stopMPpositiongraphic
+ {\long\setgvalue{MPG:#1}% tag list mpcode
+ {\useMPpositiongraphic{#1}{#2}{#3}}}
+
+\def\prepareMPpositionvariables
+ {\ifundefined{\@@meta self}\setvalue{\@@meta self}{\currentposition}\fi
+ \ifundefined{\@@meta from}\setvalue{\@@meta from}{\currentposition}\fi}
+
+\newif\ifcollectMPpositiongraphics \collectMPpositiongraphicstrue
+
+\long\def\useMPpositiongraphic#1#2#3%
+ {\bgroup
+ \prepareMPvariables{#2}%
+ \prepareMPpositionvariables
+ \enableincludeMPgraphics
+ \ifcollectMPpositiongraphics
+ \expanded{\startMPdrawing#3\noexpand\stopMPdrawing}%
+ \global\MPdrawingdonetrue
+ \else
+ \startMPgraphic#3\stopMPgraphic
+ \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
+ \deallocateMPslot\currentMPgraphic
+ \placeMPgraphic
+ \fi
+ \egroup}
+
+% Now we need a adapted action handler:
+
+\def\dopositionaction#1% test saves hash entry in etex
+ {\ifundefined{\POSactionprefix#1::}\else
+ \ifnum\MPp{#1}>\zerocount % new
+ \bgroup
+ \setbox\scratchbox\hbox
+ \bgroup
+ \traceposstring\clap\red{<#1>}%
+ \the\everyinsertpositionaction
+ \the\everypositionaction
+ \ifcollectMPpositiongraphics
+ % can save a lot of run time
+ \pushMPdrawing
+ \MPshiftdrawingtrue
+ \resetMPdrawing
+ \getvalue{\POSactionprefix#1::}%
+ \ifMPdrawingdone
+ \getMPdrawing
+ \fi
+ \resetMPdrawing
+ \popMPdrawing
+ \else
+ \getvalue{\POSactionprefix#1::}%
+ \fi
+ \cleanuppositionaction{#1}%
+ \egroup % smashed is really needed else
+ \smashedbox\scratchbox % we get problems with too big
+ \egroup % overlays (s-pre-0x.tex)
+ \else
+ % shouldn't happen too often
+ \traceposstring\clap\cyan{<#1>}%
+ \fi
+ \fi}
+
+\def\MPpositiongraphic
+ {\dodoublegroupempty\doMPpositiongraphic}
+
+\def\doMPpositiongraphic#1#2% tag setups
+ {\bgroup
+ \def\@@meta{#1:}%
+ \setupMPvariables[#2]%
+ \prepareMPpositionvariables
+ \MPshiftdrawingtrue
+ \def\doMPpositiongraphic##1##2%
+ {{% new, see (techniek)
+ \def\@@meta{##1:}%
+ \setupMPvariables[#2,##2]%
+ \prepareMPpositionvariables
+ % and needed
+ \getvalue{MPG:##1}}}% temp hack
+ \setbox\positiongraphicbox\hbox
+ {\ignorespaces
+ \executeifdefined{MPM:#1}{\executeifdefined{MPG:#1}\donothing}%
+ \removelastspace}%
+ \smashbox\positiongraphicbox
+ \box\positiongraphicbox
+ \egroup}
+
+\long\def\startMPpositionmethod#1#2\stopMPpositionmethod
+ {\long\setgvalue{MPM:#1}{#2}} % todo: var list here
+
+%D Simple one position graphics.
+
+\def\setMPpositiongraphic
+ {\dotriplegroupempty\dosetMPpositiongraphic}
+
+\def\dosetMPpositiongraphic#1#2#3% pos tag vars
+ {\ifx\currentpositionoverlay\empty
+ \dosetpositionaction{#1}{\MPpositiongraphic{#2}{#3}}%
+ \else % silly can be one
+ \handlepositiongraphics{#1}{#2}{#3}%
+ \fi}
+
+\def\handlepositiongraphics#1#2#3% combine with boxes
+ {\handlepositionaction\dohandleMPpositiongraphic\with{#1}{#2}{#3}\on{#2}}
+
+\def\doinsertMPpositiongraphic#1#2#3% pos tag setups
+ {\ifnum\MPp{#1}=\realpageno\relax % extra saveguard
+ \def\currentposition{#1}\MPpositiongraphic{#2}{#3}%
+ \fi}
+
+\appendtoks
+ \let\dohandleMPpositiongraphic\doinsertMPpositiongraphic
+\to \everyinsertpositionaction
+
+\def\docleanMPpositiongraphic#1#2#3% pos tag setups
+ {\ifnum\MPp{#1}<\realpageno \else
+ \noexpand \dohandleMPpositiongraphic{#1}{#2}{#3}%
+ \fi}
+
+\appendtoks
+ \let\dohandleMPpositiongraphic\docleanMPpositiongraphic
+\to \everycleanpositionaction
+
+%D Graphics that span two positions.
+
+\def\setMPpositiongraphicrange
+ {\doquadruplegroupempty\dosetMPpositiongraphicrange}
+
+\def\dosetMPpositiongraphicrange#1#2#3#4% bpos epos tag vars
+ {\ifx\currentpositionoverlay\empty
+ \dosetpositionaction{#1}{\MPpositiongraphic{#3}{#4}}%
+ \else
+ \handlepositiongraphicsrange{#1}{#2}{#3}{#4}%
+ \fi}
+
+\def\handlepositiongraphicsrange#1#2#3#4%
+ {\handlepositionaction\dohandleMPpositiongraphicrange\with{#1}{#2}{#3}{#4}\on{#2}}
+
+\def\doinsertMPpositiongraphicrange#1#2#3#4% pos pos tag setups
+ {\ifnum\MPp{#1}\MPp{#2}>\zerocount
+ \iflocalpositioning
+ \donetrue
+ \else
+ \donefalse
+ \ifnum\MPp{#1}=\realpageno
+ \donetrue
+ \else\ifnum\MPp{#2}=\realpageno
+ \donetrue
+ \else\ifnum\MPp{#1}<\realpageno\relax\ifnum\MPp{#2}>\realpageno
+ \donetrue
+ \fi\fi\fi\fi
+ \fi
+ \ifdone
+ \def\currentposition{#1}\MPpositiongraphic{#3}{#4}%
+ \fi
+ \fi}
+
+\appendtoks
+ \let\dohandleMPpositiongraphicrange\doinsertMPpositiongraphicrange
+\to \everyinsertpositionaction
+
+\def\docleanMPpositiongraphicrange#1#2#3#4% pos tag setups
+ {\ifnum\MPp{#2}<\realpageno \else
+ \noexpand \dohandleMPpositiongraphicrange{#1}{#2}{#3}{#4}%
+ \fi}
+
+\appendtoks
+ \let\dohandleMPpositiongraphicrange\docleanMPpositiongraphicrange
+\to \everycleanpositionaction
+
+% will be overloaded, and/or code below moved to core-box
+
+\defineoverlay[\v!text-2][\positionoverlay{\v!text-2}]
+\defineoverlay[\v!text-1][\positionoverlay{\v!text-1}]
+\defineoverlay[\v!text+1][\positionoverlay{\v!text+1}]
+\defineoverlay[\v!text+2][\positionoverlay{\v!text+2}]
+
+%D The auxiliary \METAPOST\ macros are defined by default,
+%D by saying:
+
+\startMPextensions
+ if unknown context_core : input mp-core.mp ; fi ;
+\stopMPextensions
+
+%D Some of these macros are pretty clever but too complicated
+%D to be nice. When things are kind of stable I'll clean up
+%D this mess.
+
+%D THIS NEEDS A CLEANUP
+
+\setupMPvariables
+ [mpos:box]
+ [linecolor=blue,
+ linewidth=\linewidth,
+ fillcolor=lightgray,
+ filloffset=\!!zeropoint]
+
+\startMPpositiongraphic{mpos:box}{fillcolor,linecolor,linewidth}
+ initialize_box(\MPpos{\MPvar{self}}) ;
+ boxfillcolor := \MPvar{fillcolor} ;
+ boxlinecolor := \MPvar{linecolor} ;
+ boxlinewidth := \MPvar{linewidth} ;
+ boxfilloffset := \MPvar{filloffset} ;
+ draw_box ;
+ anchor_box(\MPanchor{\MPvar{self}}) ;
+\stopMPpositiongraphic
+
+\setupMPvariables
+ [mpos:area]
+ [linecolor=blue,
+ linewidth=\linewidth,
+ fillcolor=lightgray,
+ filloffset=\!!zeropoint]
+
+\startMPpositiongraphic{mpos:area}{fillcolor,linecolor,linewidth}
+ initialize_area(\MPpos{b:\MPvar{self}},\MPpos{e:\MPvar{self}}) ;
+ boxfillcolor := \MPvar{fillcolor} ;
+ boxlinecolor := \MPvar{linecolor} ;
+ boxlinewidth := \MPvar{linewidth} ;
+ boxfilloffset := \MPvar{filloffset} ;
+ draw_area ;
+ anchor_area(\MPanchor{b:\MPvar{self}}) ;
+\stopMPpositiongraphic
+
+%D This is already cleaned up.
+
+% gridtype = 1 => baseline
+% gridtype = 2 => betweenline
+
+\setupMPvariables
+ [mpos:par]
+ [mp=mpos:par:shape,
+ gridtype=0,
+ linetype=1,
+ filltype=1,
+ %snaptops=true, % not that nice: true/false
+ gridcolor=red,
+ linecolor=blue,
+ fillcolor=lightgray,
+ filloffset=\!!zeropoint,
+ linewidth=\linewidth,
+ gridwidth=\linewidth,
+ lineradius=.5\bodyfontsize]
+
+\startuseMPgraphic{mpos:par:shape}
+ \iftracepositions show_par \else draw_par \fi ;
+\stopuseMPgraphic
+
+\startuseMPgraphic{mpos:par:setup}
+ boxgridtype := \MPvar{gridtype} ;
+ boxlinetype := \MPvar{linetype} ;
+ boxfilltype := \MPvar{filltype} ;
+ boxgridcolor := \MPvar{gridcolor} ;
+ boxlinecolor := \MPvar{linecolor} ;
+ boxfillcolor := \MPvar{fillcolor} ;
+ boxfilloffset := \MPvar{filloffset} ;
+ boxlinewidth := \MPvar{linewidth} ;
+ boxgridwidth := \MPvar{gridwidth} ;
+ boxlineradius := \MPvar{lineradius} ;
+ %snap_multi_par_tops := \MPvar{snaptops} ;
+\stopuseMPgraphic
+
+\startuseMPgraphic{mpos:par:extra}
+ % user stuff, like:
+ % snap_multi_par_tops := false ;
+\stopuseMPgraphic
+
+% \startMPpositionmethod{mpos:par}
+% \doifpositionelse{w:\MPvar{self}}
+% {\startMPpositiongraphic{mpos:par}%
+% {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
+% initialize_area_par(\MPpos{b:\MPvar{self}},
+% \MPpos{e:\MPvar{self}},
+% \MPpos{w:\MPvar{self}}) ;
+% \includeMPgraphic{mpos:par:setup} ;
+% \includeMPgraphic{mpos:par:extra} ;
+% \includeMPgraphic{\MPvar{mp}} ; % \includeMPgraphic{mpos:par:shape} ;
+% anchor_par(\MPanchor{b:\MPvar{self}}) ;
+% \stopMPpositiongraphic}
+% {\startMPpositiongraphic{mpos:par}%
+% {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
+% initialize_par(\MPpos{b:\MPvar{self}},
+% \MPpos{e:\MPvar{self}},
+% \MPpos{text:\realfolio},
+% \MPpos{p:\MPparcounter},
+% \MPvv {p:\MPparcounter}{0,0,0,0,0,0}) ;
+% \includeMPgraphic{mpos:par:setup} ;
+% \includeMPgraphic{mpos:par:extra} ;
+% \includeMPgraphic{\MPvar{mp}} ; % \includeMPgraphic{mpos:par:shape} ;
+% anchor_par(\MPanchor{b:\MPvar{self}}) ;
+% \stopMPpositiongraphic}%
+% \MPpositiongraphic{mpos:par}{}%
+% \stopMPpositionmethod
+
+%D Less readable but shorter.
+
+\ifx\MPparcounter\undefined \newcounter\MPparcounter \fi
+
+\def\MPself {\MPvar{self}}
+\def\MPbself {b:\MPself}
+\def\MPeself {e:\MPself}
+\def\MPwself {w:\MPself}
+\def\MPparanchor{p:\MPparcounter}
+
+\def\MPl#1{\MPplus{#1}20}
+\def\MPr#1{\MPplus{#1}30}
+
+\startMPpositionmethod{mpos:par} %%%%%%%%%%% will become obsolete
+ \edef\MPparcounter{\MPv\MPbself{1}{0}}%
+ \doifpositionelse\MPwself
+ {\startMPpositiongraphic{mpos:par}%
+ {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
+ initialize_area_par(\MPpos\MPbself,
+ \MPpos\MPeself,
+ \MPpos\MPwself) ;
+ \includeMPgraphic{mpos:par:setup} ;
+ \includeMPgraphic{mpos:par:extra} ;
+ \includeMPgraphic{\MPvar{mp}} ;
+ anchor_par(\MPanchor\MPbself) ;
+ \stopMPpositiongraphic}
+ {\startMPpositiongraphic{mpos:par}%
+ {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
+ initialize_par(\MPpos\MPbself,
+ \MPpos\MPeself,
+ \MPpos\textanchor,
+ \MPpos\MPparanchor,
+ \MPvv \MPparanchor{0,0,0,0,0,0}) ;
+ \includeMPgraphic{mpos:par:setup} ;
+ \includeMPgraphic{mpos:par:extra} ;
+ \includeMPgraphic{\MPvar{mp}} ;
+ anchor_par(\MPanchor\MPbself) ;
+ \stopMPpositiongraphic}%
+ \MPpositiongraphic{mpos:par}{}%
+\stopMPpositionmethod
+
+%D The next alternative works in columnsets :
+
+% \iftracepositions show\else draw\fi_multi_pars ;
+
+\startuseMPgraphic{mpos:par:columnset}
+ \iftracepositions show_multi_pars \else draw_multi_pars \fi ;
+\stopuseMPgraphic
+
+\startMPpositionmethod{mpos:par:columnset}
+ \edef\MPparcounter{\MPv\MPbself{1}{0}}%
+ \startMPpositiongraphic{mpos:par}%
+ {fillcolor,filloffset,linecolor,gridcolor,%
+ linewidth,gridwidth,lineradius}
+ \includeMPgraphic{mpos:par:setup} ;
+ \includeMPgraphic{mpos:par:extra} ;
+ prepare_multi_pars(\MPpos\MPbself,\MPpos\MPeself,\MPpos\MPwself,
+ \MPpos\MPparanchor,\MPvv\MPparanchor{0,0,0,0,0,0}) ;
+ relocate_multipars(-\MPxy\MPanchorid) ; % inside layerpos
+ \includeMPgraphic{\MPvar{mp}} ;
+ \stopMPpositiongraphic
+ \MPpositiongraphic{mpos:par}{}%
+\stopMPpositionmethod
+
+%D \starttyping
+%D \setupbackground
+%D [test]
+%D [mp=mpos:par:columnset,
+%D methodmethode=mpos:par:columnset]
+%D \stoptyping
+
+%D We need to treat floats in a special way.
+
+\startMPinitializations
+ local_multi_par_area:=\iflocalpositioning true\else false\fi;
+\stopMPinitializations
+
+\def\textbackgroundoverlay#1%
+ {\iflocalpositioning\v!local\else\v!text\fi#1}
+
+\newcounter\localpositionnumber
+
+\def\MPanchornumber
+ {\iflocalpositioning\localpositionnumber\else\realfolio\fi}
+
+%D So far for the trickery.
+
+\newcounter\textbackgrounddepth
+
+\appendtoks
+ \savecurrentvalue\totalnofparbackgrounds\nofparbackgrounds
+\to \everybye
+
+\appendtoks
+ \initializeparbackgrounds
+\to \everystarttext
+
+\ifx\totalnofparbackgrounds\undefined \newcounter\totalnofparbackgrounds \fi
+\ifx\nofparbackgrounds \undefined \newcounter\nofparbackgrounds \fi
+
+\def\initializeparbackgrounds
+ {\ifcase\totalnofparbackgrounds\else
+ \global\positioningtrue
+ \global\positioningpartrue
+ \fi}
+
+\unexpanded\def\starttextbackground
+ {\bgroup
+ \increment\textbackgrounddepth
+ \dodoubleempty\dostarttextbackground}
+
+\let\dodostarttextbackground\relax
+\let\dodostoptextbackground \relax
+
+\def\currentparbackground{pbg:0}
+\def\nextparbackground {pbg:1}
+
+\def\btbanchor{b:\currentparbackground}
+\def\etbanchor{e:\currentparbackground}
+
+\def\nextbtbanchor{b:\nextparbackground}
+\def\nextetbanchor{e:\nextparbackground}
+
+\def\backgroundvariable#1%
+ {\csname\??td\currenttextbackground#1\endcsname}
+
+% \definetextbackground[more][state=start,backgroundcolor=red] % location=paragraph
+% \definetextbackground[test][state=start,backgroundcolor=green]
+%
+% \page \placefigure[left]{}{}
+%
+% \starttextbackground[test]
+% \readfile{ward}{}{}
+% \starttextbackground[more]
+% \readfile{ward}{}{}
+% \stoptextbackground
+% \readfile{ward}{}{}
+% \stoptextbackground
+%
+% \page \placefigure[right]{}{}
+%
+% \starttextbackground[test]
+% \readfile{ward}{}{}
+% \starttextbackground[more]
+% \readfile{ward}{}{}
+% \stoptextbackground
+% \readfile{ward}{}{}
+% \stoptextbackground
+
+\def\dostarttextbackground[#1][#2]%
+ {\checktextbackgrounds
+ \def\currenttextbackground{#1}%
+ \doglobal\increment\nofparbackgrounds
+ %\edef\currentparbackground{background:\nofparbackgrounds}%
+ \edef\currentparbackground{pbg:\nofparbackgrounds}%
+ \bgroup
+ \increment\nofparbackgrounds
+ %\xdef\nextparbackground{background:\nofparbackgrounds}%
+ \xdef\nextparbackground{pbg:\nofparbackgrounds}%
+ \egroup
+ % todo : \synchonizepositionpage{b:\currentparbackground}{s:\currentparbackground}%
+ \setuptextbackground[#1][#2]%
+ \let\dodostarttextbackground\relax
+ \let\dodostoptextbackground \relax
+ \doifvalue{\??td#1\c!state}\v!start
+ {\dopresettextbackground{#1}}%
+ \dodostarttextbackground}
+
+% todo \backgroundvariable\c!variant
+
+\def\dopresettextbackground#1% todo: \backgroundparameter
+ {\ExpandFirstAfter\processaction % \EFA niet echt nodig
+ [\getvalue{\??td#1\c!location}]
+ [ \v!text=>\let\dodostarttextbackground\dostarttextbackgroundtxt
+ \let\dodostoptextbackground \dostoptextbackgroundtxt,
+ \v!paragraph=>\let\dodostarttextbackground\dostarttextbackgroundpar
+ \let\dodostoptextbackground \dostoptextbackgroundpar,
+ \v!none=>\let\dodostarttextbackground\relax
+ \let\dodostoptextbackground \relax]%
+ \ifx\dodostarttextbackground\dostarttextbackgroundpar % untested
+ \ifnum\textbackgrounddepth>\plusone % new
+ \let\dodostarttextbackground\dostarttextbackgroundtxt
+ \let\dodostoptextbackground \dostoptextbackgroundtxt
+ \fi
+ \fi
+ \doifelsevalue{\??td#1\c!frame}\v!on
+ {\doifelsevalue{\??td#1\c!corner}\v!round
+ {\setvalue{\??td#1\c!frame}{2}}
+ {\setvalue{\??td#1\c!frame}{1}}}
+ {\setvalue{\??td#1\c!frame}{0}}%
+ \doifelsevalue{\??td#1\c!background}\v!color
+ {\setvalue{\??td#1\c!background}{1}}
+ {\setvalue{\??td#1\c!background}{0}}%
+ %\startpositionoverlay{\v!text\getvalue{\??td#1\c!level}}%
+ \startpositionoverlay{\textbackgroundoverlay{\getvalue{\??td#1\c!level}}}%
+ \expanded
+ {\setMPpositiongraphicrange % moet veel efficienter
+ {\btbanchor}% {b:\currentparbackground}%
+ {\etbanchor}% {e:\currentparbackground}%
+ {\getvalue{\??td#1\c!method}}%
+ {self=\currentparbackground,
+ mp=\getvalue{\??td#1\c!mp},
+ gridtype=\getvalue{\??td#1\c!alternative},
+ filltype=\getvalue{\??td#1\c!background},
+ linetype=\getvalue{\??td#1\c!frame},
+ gridcolor=\getvalue{\??td#1\c!framecolor},
+ linecolor=\getvalue{\??td#1\c!framecolor},
+ fillcolor=\getvalue{\??td#1\c!backgroundcolor},
+ filloffset=\getvalue{\??td#1\c!backgroundoffset},
+ gridwidth=\getvalue{\??td#1\c!rulethickness},
+ linewidth=\getvalue{\??td#1\c!rulethickness},
+ lineradius=\getvalue{\??td#1\c!radius}}}%
+ \stoppositionoverlay}
+
+\def\stoptextbackground
+ {\dodostoptextbackground
+ \carryoverpar\egroup}
+
+\def\starttextbackgroundmanual
+ {\dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
+ \fpos\currentparbackground\ignorespaces}
+
+\def\stoptextbackgroundmanual
+ {\tpos\currentparbackground
+ \dostopattributes}
+
+\def\dostarttextbackgroundtxt
+ {\ifvmode \leavevmode \fi
+ \dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
+ \fpos\currentparbackground\ignorespaces}
+
+\def\dostoptextbackgroundtxt
+ {\tpos\currentparbackground
+ \dostopattributes}
+
+% keep this simple one, it's used in prikkels and alike
+%
+% \def\dostarttextbackgroundpar
+% {\endgraf % new
+% \getvalue{\??td\currenttextbackground\c!before}%
+% \noindent\fpos\currentparbackground\ignorespaces
+% \bgroup
+% \nobreak \vskip-\lineheight \nobreak
+% \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip
+% \kern\scratchskip\nobreak
+% \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!leftoffset}}%
+% \advance\leftskip\leftskipadaption
+% \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!rightoffset}}%
+% \advance\rightskip\leftskipadaption
+% \dostartattributes{\??td\currenttextbackground}\c!style\c!color{}%
+% \nowhitespace
+% \seteffectivehsize
+% \par}
+%
+% \def\dostoptextbackgroundpar
+% {\par
+% \dostopattributes
+% \doassignsomeskip\getvalue{\??td\currenttextbackground\c!bottomoffset}\to\scratchskip
+% \kern\scratchskip\nobreak
+% \nobreak \vskip-\lineheight \nobreak
+% \nowhitespace
+% \egroup
+% \nobreak \noindent \strut \hfill \kern\zeropoint \tpos\currentparbackground
+% \endgraf % new
+% \getvalue{\??td\currenttextbackground\c!after}}
+
+\def\dostarttextbackgroundpar
+ {\endgraf % new
+ \getvalue{\??td\currenttextbackground\c!before}%
+ \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip
+ \xdef\textbackgroundskip{\the\scratchskip}%
+ \noindent
+ \ifgridsnapping
+ \ifdim\textbackgroundskip>\zeropoint
+ \struttedbox{\hbox{\raise\textbackgroundskip\hbox{\fpos\currentparbackground}}}%
+ \else
+ \fpos\currentparbackground
+ \fi
+ \else
+ \fpos\currentparbackground
+ \fi
+ \bgroup
+ \endgraf % we need a vertical nobreak - 29/06/2004
+ \nobreak \vskip-\lineheight \nobreak
+ \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip
+ \ifgridsnapping \else \ifdim\textbackgroundskip>\zeropoint
+ \kern\textbackgroundskip\nobreak
+ \fi \fi
+ \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!leftoffset}}%
+ \advance\leftskip\leftskipadaption
+ \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!rightoffset}}%
+ \advance\rightskip\leftskipadaption
+ % new
+ \dosetraggedcommand{\getvalue{\??td\currenttextbackground\c!align}}%
+ \raggedcommand
+ %
+ \dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
+ \nowhitespace
+\nobreak % new per 23/04/2006 (else potential break when whitespace)
+ \seteffectivehsize
+ \doinhibitblank % \blank[\v!disable]% new
+ \par}
+
+\def\dostoptextbackgroundpar
+ {\par
+ \removelastskip % new
+ \dostopattributes
+ \doassignsomeskip\getvalue{\??td\currenttextbackground\c!bottomoffset}\to\scratchskip
+ \ifdim\lastskip>\zeropoint
+ \advance\scratchskip-\lastskip
+ \fi
+ \xdef\textbackgroundskip{\the\scratchskip}%
+ \ifgridsnapping \else \ifdim\textbackgroundskip>\zeropoint
+ \kern\scratchskip\nobreak
+ \fi \fi
+ \nobreak \vskip-\lineheight \nobreak
+ \nowhitespace
+ \egroup
+\bgroup \forgeteverypar % NOT REALLY NEEDED, SAVES HASH/MEM
+ \nobreak \noindent \strut \hfill \kern\zeropoint
+ \ifgridsnapping % experimental, pascal (todo: topoffset in same way)
+ \ifdim\textbackgroundskip>\zeropoint
+ \struttedbox{\hbox{\lower\textbackgroundskip\hbox{\tpos\currentparbackground}}}%
+ \else
+ \tpos\currentparbackground
+ \fi
+ \else
+ \tpos\currentparbackground
+ \fi
+\egroup
+ \endgraf % new
+ \getvalue{\??td\currenttextbackground\c!after}}
+
+\let\textparpages \!!zeropoint
+\let\textparheight\!!zeropoint
+\let\textparwidth \!!zeropoint
+
+\def\calculatetextpardimensions
+ {\docalculatetextpardimensions\btbanchor \etbanchor \MPparanchor}
+
+\def\calculatenexttextpardimensions
+ {\docalculatetextpardimensions\nextbtbanchor\nextetbanchor\relax}
+
+\def\docalculatetextpardimensions#1#2#3%
+ {\scratchcounter\MPp#2%\etbanchor
+ \advance\scratchcounter-\MPp#1%\btanchor
+ \edef\textparpages{\the\scratchcounter}%
+ \ifcase\scratchcounter
+ % one page
+ \scratchdimen \MPy#1%\btanchor
+ \advance\scratchdimen-\MPy#2%\etbanchor
+ \else
+ % two or more pages
+ \scratchdimen \MPy#1%\btanchor
+ \advance\scratchdimen-\MPy#2%\etbanchor
+ \advance\scratchdimen-\MPy\textanchor
+ \advance\scratchdimen \MPy\textanchor
+ \advance\scratchdimen \MPh\textanchor\relax
+ \ifcase\scratchcounter>2 \ifnum\scratchcounter<5
+ % more pages
+ \scratchdimen\textheight
+ \advance\scratchcounter \minusone
+ \multiply\scratchdimen \scratchcounter
+ \else
+ % keep'm small
+ \scratchdimen5\textheight
+ \fi \fi
+ \fi
+ \edef\textparheight{\the\scratchdimen}%
+ \ifcase\scratchcounter
+ % one page
+ \scratchdimen \MPx#2%\etbanchor
+ \advance\scratchdimen-\MPx#1%\btanchor
+ \else
+ % two or more pages / maybe also hang
+ \ifx#3\relax
+ \scratchdimen\makeupwidth % \textwidth
+ \else
+ \scratchdimen\MPw\MPparanchor
+ \advance\scratchdimen-\MPl\MPparanchor
+ \advance\scratchdimen-\MPr\MPparanchor
+ \fi
+ \fi
+ \edef\textparwidth{\the\scratchdimen}}
+
+\def\mintextparheight{4\lineheight}
+
+\def\dontsplitnexttextbackground % dangerous but useful
+ {\ifdim\pagetotal>\textheight \else
+ \ifdim\pagegoal=\maxdimen \else
+ \calculatenexttextpardimensions
+ % too tricky
+ % \scratchdimen=\textparheight
+ % \advance\scratchdimen\pagetotal\relax
+ % \ifdim\scratchdimen>\pagegoal
+ % \page
+ % \fi
+ \ifdim\textparheight>\zeropoint
+ \ifdim\textparheight>\mintextparheight\else
+ \page % option
+ \fi
+ \fi
+ \fi
+ \fi}
+
+\def\definetextbackground
+ {\dodoubleempty\dodefinetextbackground}
+
+\def\dodefinetextbackground[#1][#2]%
+ {\ifsecondargument % why ?
+ \copyparameters[\??td#1][\??td]
+ [\c!state,\c!location,\c!alternative,\c!mp,\c!method,
+ \c!background,\c!backgroundcolor,\c!corner,\c!level,
+ \c!backgroundoffset,\c!before,\c!after,\c!align,
+ \c!radius,\c!frame,\c!framecolor,\c!rulethickness,
+ \c!leftoffset,\c!rightoffset,\c!topoffset,\c!bottomoffset]%
+ \getparameters[\??td#1][#2]%
+ \doifvalue{\??td#1\c!state}\v!start\checktextbackgrounds
+ \unexpanded\setvalue{#1}%
+ {\groupedcommand{\starttextbackground[#1]}{\stoptextbackground}}%
+ \setvalue{\e!start#1}{\starttextbackground[#1]}%
+ \setvalue{\e!stop #1}{\stoptextbackground}%
+ \fi}
+
+\def\setuptextbackground
+ {\dodoubleargument\dosetuptextbackground}
+
+\def\dosetuptextbackground[#1][#2]%
+ {\ifsecondargument
+ \doifelsenothing{#1}
+ {\dodosetuptextbackground{#2}\empty}
+ {\processcommalist[#1]{\dodosetuptextbackground{#2}}}%
+ \else
+ \dodosetuptextbackground{#1}\empty
+ \fi}
+
+\def\dodosetuptextbackground#1#2%
+ {\getparameters[\??td#2][#1]%
+ \def\currenttextbackground{#2}%
+ \doifvalue{\??td#2\c!state}\v!start\checktextbackgrounds}
+
+\let\currenttextbackground\empty
+
+\def\checktextbackgrounds
+ {\ifproductionrun
+ \enabletextarearegistration
+ \enablehiddenbackground
+ \fi}
+
+\setuptextbackground
+ [\c!mp=mpos:par:columnset, % buggy: mpos:par:shape
+ \c!method=mpos:par:columnset, %
+ \c!state=\v!start,
+ \c!location=\v!text,
+ \c!leftoffset=\!!zeropoint, % 1em,
+ \c!rightoffset=\getvalue{\??td\currenttextbackground\c!leftoffset},
+ \c!topoffset=\!!zeropoint, % \v!medium,
+ \c!bottomoffset=\getvalue{\??td\currenttextbackground\c!topoffset},
+ \c!level=-1,
+ \c!alternative=0,
+ \c!align=,
+ \c!background=\v!color,
+ \c!backgroundcolor=lightgray,
+ \c!backgroundoffset=\!!zeropoint,
+ \c!corner=\v!rectangular,
+ \c!radius=.5\bodyfontsize,
+ \c!frame=\v!on,
+ \c!framecolor=blue,
+ \c!rulethickness=\linewidth]
+
+%D As an example we define a grid background:
+
+\definetextbackground
+ [\v!grid]
+ [\c!state=\v!stop,
+ \c!location=\v!paragraph,
+ \c!frame=\v!off,
+ \c!framecolor=red,
+ \c!background=,
+ \c!alternative=1]
+
+\ifx\basegrid\undefined \else \letvalue\v!grid=\basegrid \fi
+
+% lelijk, aanpassen, opties
+
+\setupMPvariables
+ [mpos:connect]
+ [linecolor=red,
+ linewidth=1pt]
+
+\setupMPvariables
+ [mpos:encircle]
+ [fillcolor=lightgray,
+ filloffset=\!!zeropoint,
+ linecolor=blue,
+ linewidth=1pt]
+
+\startuseMPgraphic{mpos:common:ec}
+ path pa ; pair ca ; color lc ; numeric lw ;
+ lw := \MPvar{linewidth} ;
+ lc := \MPvar{linecolor} ;
+ initialize_box(\MPpos{\MPvar{self}}) ;
+ pa := pxy ; ca := cxy ; pa := boundingbox pa enlarged 2lw ;
+ pa := llcorner pa...lrcorner pa...urcorner pa...ulcorner pa...cycle ;
+ drawoptions (withpen pencircle scaled lw withcolor lc) ;
+\stopuseMPgraphic
+
+\startMPpositiongraphic{mpos:encircle}{linecolor,fillcolor,linewidth}
+ \includeMPgraphic{mpos:common:ec}
+ fill pa withcolor \MPvar{fillcolor} ; draw pa ;
+ anchor_box(\MPanchor{\MPvar{self}}) ;
+\stopMPpositiongraphic
+
+\startMPpositiongraphic{mpos:connect}{linecolor,linewidth}
+ path pb, pc ; pair cb, cc ;
+ \includeMPgraphic{mpos:common:ec}
+ initialize_box(\MPpos{\MPvar{to}}) ;
+ pb := pxy ; cb := cxy ; pb := boundingbox pb enlarged 2lw ;
+ pb := llcorner pb...lrcorner pb...urcorner pb...ulcorner pb...cycle ;
+ pc := ca {up} .. {down} cb ;
+ cc := (pc intersection_point pa) ;
+ if intersection_found :
+ pc := pc cutbefore cc ;
+ cc := (pc intersection_point pb) ;
+ if intersection_found :
+ pc := pc cutafter cc ;
+ drawarrow pc ; drawarrow reverse pc ;
+ fi ;
+ fi ;
+ anchor_box(\MPanchor{\MPvar{self}}) ;
+\stopMPpositiongraphic
+
+%D \macros
+%D {stackposdown, stackposup, stackposleft,stackposright}
+%D
+%D A non graphic example of the use of positioning, is to stack
+%D text in for instance the margin.
+%D
+%D \stackposdown \inleft {some text}The text \type {some text}
+%D goes into the left margin, and \stackposdown \inleft {some
+%D more}\type {some more} as well. When they overlap, they
+%D will not touch.
+%D
+%D Here we said \type {\stackposdown \inleft{some text}}. Instead
+%D of \stackposleft \inleft {one}stacking \stackposleft \inleft
+%D {two}vertically, one can stack horizontally by \stackposleft
+%D \inleft {three}using \type {\stackposleft}.
+%D
+%D We can go in all four directions, using \type {\stackposdown},
+%D \type {\stackposup}, \type {\stackposleft} and \type
+%D {\stackposright}.
+
+\def\stackposdistance{.5em}
+
+\newcounter\currentautopos
+
+\def\POSstackprefix{stack:}
+
+\def\dostackposbox#1#2%
+ {\dowithnextbox
+ {#2{\let\previousautopos\currentautopos
+ \doglobal\increment\currentautopos
+ \hpos{\POSstackprefix\currentautopos}
+ {\doifoverlappingelse{\POSstackprefix\currentautopos}{\POSstackprefix\previousautopos}
+ {#1}
+ {\flushnextbox}}}}%
+ \hbox}
+
+\def\stackposup {\dostackposbox{\raise\lineheight\flushnextbox}}
+\def\stackposdown {\dostackposbox{\lower\lineheight\flushnextbox}}
+\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\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi
+% {\lower\scratchdimen\flushnextbox}%
+% \next
+% % \fi
+% \flushnextbox}}}
+
+% Because there can be many stacked items in a line and successive lines, we
+% play dirty and adapt the position and height of the current node so that
+% this becomes visible to a next pass.
+%
+% \startbuffer
+% \inleft {test 1} test 1 \inleft {test 2} test 2 \endgraf
+% \inleft {test 3} test 3
+% \stopbuffer
+% \getbuffer \typebuffer \flushstatus \page
+%
+% \startbuffer
+% \inleft {test 1} test 1 \inleft {test 2} test 2 \inleft {test 3} test 3 \endgraf
+% \inleft {test 4} test 4
+% \stopbuffer
+% \getbuffer \typebuffer \flushstatus \page
+%
+% \startbuffer
+% \inleft {test 1} test 1 \endgraf
+% \inleft {test 2} test 2 \endgraf
+% \inleft {test 3} test 3
+% \stopbuffer
+% \getbuffer \typebuffer \flushstatus \page
+%
+% \startbuffer
+% \inleft {test 1\\test 1} test 1 \inleft {test 2} test 2 \endgraf
+% \inleft {test 3} test 3
+% \stopbuffer
+% \getbuffer \typebuffer \flushstatus \page
+%
+% \startbuffer
+% \inleft {test 1\\test 1\\test 1\\test 1\\test 1} test 1 \endgraf
+% test 2 \endgraf
+% \inleft {test 3} test 3
+% \stopbuffer
+% \getbuffer \typebuffer \flushstatus \page
+%
+% \startbuffer
+% \inleft{test 1} test \inleft{test 2} test \inleft{test 3\\test 3} test
+% \stopbuffer
+% \getbuffer \typebuffer \flushstatus \page
+%
+% \startbuffer
+% \inleft{test 1\\test 1\\test 1} test \inleft{test 2\\test 2} test \inleft{test 3\\test 3\\test 3} test \endgraf
+% \inleft{test 1\\test 1\\test 1} test \inleft{test 2\\test 2} test \inleft{test 3\\test 3\\test 3} test
+% \stopbuffer
+% \getbuffer \typebuffer \flushstatus \page
+
+\newdimen\laststackvmove
+
+\def\stackeddown
+ {\bgroup
+ % this macro assumes a few things and is meant to work for margin notes
+ \dowithnextbox
+ {\doglobal\increment\currentautopos
+ \global\laststackvmove\zeropoint
+ \hpos{\POSstackprefix\currentautopos}
+ {\edef\next
+ {\nextboxht\the\nextboxht
+ \nextboxdp\the\nextboxdp
+ \nextboxwd\the\nextboxwd}%
+ \let\previousautopos\currentautopos
+ \scratchdimen\zeropoint
+ \scratchcounter\zerocount
+ \doloop
+ {\decrement\previousautopos\relax
+ \edef\currentposition {\POSstackprefix\currentautopos}%
+ \edef\previousposition{\POSstackprefix\previousautopos}%
+ \ifnum\MPp\currentposition=\MPp\previousposition\relax
+ %\registerstatus{doing \currentautopos/\previousautopos}%
+ \doifoverlappingelse\currentposition\previousposition
+ {\scratchskip \MPy\currentposition
+ \advance\scratchskip-\MPy\previousposition
+ \advance\scratchskip-\MPd\currentposition % untested
+ \advance\scratchskip \MPd\previousposition % untested
+ \advance\scratchskip \MPh\currentposition
+ % todo: also take depth into account
+ \relax
+ \ifdim\scratchskip<\scratchdimen
+ %\registerstatus{no \the\scratchskip}%
+ \else
+ %\registerstatus{yes \the\scratchskip}%
+ \scratchdimen\scratchskip
+ \fi}%
+ \donothing % {\registerstatus{next}}%
+ \ifnum\previousautopos<\zerocount\exitloop\fi
+ \else
+ \exitloop
+ \fi}%
+ \ifdim\scratchdimen=\zeropoint \else
+ \bgroup
+ \edef\currentposition{\POSstackprefix\currentautopos}%
+ \scratchskip\scratchdimen
+ \advance\scratchskip\MPh\currentposition
+ \scratchdimen-\scratchdimen
+ \advance\scratchdimen\MPy\currentposition
+ %\registerstatus{old \currentautopos: \MPy\currentposition/\MPh\currentposition}%
+ \expanded{\replacepospxywhd
+ {\currentposition}{\MPp\currentposition}{\MPx\currentposition}{\the\scratchdimen}%
+ {\MPw\currentposition}{\the\scratchskip}{\MPd\currentposition}}%
+ %\registerstatus{new \currentautopos: \MPy\currentposition/\MPh\currentposition}%
+ \egroup
+ \global\laststackvmove\scratchdimen % new
+ \setbox\nextbox\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi
+ {\lower\scratchdimen\flushnextbox}%
+ \next
+ %\registerstatus{\strut}%
+ \fi
+ \flushnextbox}%
+ \egroup}}
+
+%D The next hack make sure that margin texts near faulty
+%D strutted lines are handled ok.
+
+\newif\ifrepositionmarginbox % \repositionmarginboxtrue
+
+\newcounter\currentmarginpos
+
+% \def\dopositionmarginbox#1%
+% {\bgroup
+% \ifrepositionmarginbox
+% \doglobal\increment\currentmarginpos
+% \setposition{\s!margin:\currentmarginpos}%
+% \scratchdimen=\MPy{\s!margin:\currentmarginpos}%
+% \doglobal\increment\currentmarginpos
+% \advance\scratchdimen by -\MPy{\s!margin:\currentmarginpos}%
+% \advance\scratchdimen by -\strutdp
+% \setbox#1=\hbox
+% {\setposition{\s!margin:\currentmarginpos}\raise\scratchdimen\box#1}%
+% \dp#1=\!!zeropoint
+% \ht#1=\!!zeropoint
+% \fi
+% \vadjust{\box#1}%
+% \egroup}
+
+\def\dopositionmarginbox#1% how about page boundaries !
+ {\bgroup
+ \ifrepositionmarginbox
+ \doglobal\increment\currentmarginpos
+ \setposition{\s!margin:\currentmarginpos}%
+ \scratchdimen\MPy{\s!margin:\currentmarginpos}%
+ \doglobal\increment\currentmarginpos
+ \advance\scratchdimen -\MPy{\s!margin:\currentmarginpos}%
+ \advance\scratchdimen -\strutdp
+ % new
+ \setbox#1\hbox
+ {\hskip-\MPx{\s!margin:\currentmarginpos}%
+ \hskip\MPx{head:\realfolio}%
+ \box#1}%
+ % so far
+ \setbox#1\hbox
+ {\setposition{\s!margin:\currentmarginpos}%
+ \raise\scratchdimen\box#1}%
+ \dp#1\zeropoint
+ \ht#1\zeropoint
+ \fi
+ \graphicvadjust{\box#1}%
+ \egroup}
+
+%D For a right menu, a sequence of calls to \type
+%D {right_menu_button} is generated.
+%D
+%D \starttyping
+%D right_menu_button (n, p, s=0/1/2, x, y, w, h, d) ;
+%D \stoptyping
+%D
+%D Here, n is the number of the button, s a status variable,
+%D while the rest is positional info. The status variable is
+%D 0, 1 or~2: not found, found and found but current page.
+
+% 0=not found 1=found 2=current page
+
+% geen leeg
+
+\newtoks\MPmenutoks
+
+\def\MPmenubuttons#1{\the\MPmenutoks}
+
+\appendtoks \global\MPmenutoks\emptytoks \to \everyshipout
+
+% 0=notfound 1=found 2=currentpage
+
+\def\do@@amposition#1#2#3%
+ {\doifelsevalue{\??am#1\c!position}\v!yes
+ {\doglobal\increment\currentamposition
+ \doifnumberelse{#2}
+ {\docheckrealreferencepage{#2}%
+ \global\chardef\currentamrealpage\ifrealreferencepage2\else1\fi}
+ {\doifreferencefoundelse{#2}
+ {\global\chardef\currentamrealpage\ifrealreferencepage2\else1\fi}
+ {\global\chardef\currentamrealpage0}}% % not found
+ \expanded
+ {\doglobal\noexpand\appendtoks
+% #1_menu_button(\currentamposition,\the\currentamrealpage,\noexpand\MPpos{#1:\currentamposition}) ;
+ #1_menu_button(\currentamposition,\the\currentamrealpage,\MPpos{#1:\currentamposition}) ;
+ \to \MPmenutoks}%
+ \hpos{#1:\currentamposition}{#3}}
+ {#3}}
+
+\def\do@@ammenuposition#1%
+ {\ifnum\currentamposition>0
+ \dowithnextbox{\hpos{menu:#1:\realfolio}{\flushnextbox}}\hbox
+ \fi}
+
+%D \macros
+%D {GFC, GTC, GSC}
+%D
+%D The next macros extend tables and tabulation with
+%D backgrounds and position related features. Areas are
+%D specified with symbolic names, and symbolic references to
+%D the graphics involved. Each table has its own namespace.
+
+\newcounter\noftabpositions
+\newtoks \posXCtoks
+
+\def\tbPOSprefix
+ {tbp:\noftabpositions:}
+
+\def\tablepos
+ {\scratchtoks\posXCtoks
+ \global\posXCtoks\emptytoks
+ \the\scratchtoks}
+
+\let\tabulatepos\tablepos
+
+\def\dodododoGSC[#1:#2]%
+ {\remappositionframed{#2}{\tbPOSprefix#1}%
+ \bpos{\tbPOSprefix#1}%
+ \doglobal\appendtoks\@EA\epos\@EA{\tbPOSprefix#1}\to\posXCtoks}
+
+\def\dododoGSC[#1:#2:#3]%
+ {\doglobal\appendtoks\dodododoGSC[#1:#2]\to\posXCtoks\NC}
+
+\def\dodoGSC[#1]%
+ {\def\docommando##1{\dododoGSC[##1:##1]}%
+ \processcommalist[#1]\docommando}
+
+\def\dodododoGFC[#1:#2:#3]%
+ {\remappositionframed{#2}{\tbPOSprefix#1}%
+ \bpos{\tbPOSprefix#1}}
+
+\def\dododoGFC[#1]%
+ {\def\docommando##1{\dodododoGFC[##1:##1]}%
+ \processcommalist[#1]\docommando}
+
+\def\dodoGFC[#1]%
+ {\doglobal\appendtoks\dododoGFC[#1]\to\posXCtoks\NC}
+
+\def\dododododoGTC[#1:#2]%
+ {\epos{\tbPOSprefix#1}}
+
+\def\dodododoGTC[#1]%
+ {\def\docommando##1{\dododododoGTC[##1:##1]}%
+ \processcommalist[#1]\docommando}
+
+\def\dododoGTC[#1]%
+ {\doglobal\appendtoks\dodododoGTC[#1]\to\posXCtoks}
+
+\def\dodoGTC[#1]%
+ {\doglobal\appendtoks\dododoGTC[#1]\to\posXCtoks\NC}
+
+\def\dodododoXC[#1#2]%
+ {\if#1>\dodoGFC [#2:#2]\else
+ \if#1+\dodoGFC [#2:#2]\else
+ \if#1<\dodoGTC [#2:#2]\else
+ \if#1-\dodoGTC [#2:#2]\else
+ \if#1=\dodoGSC [#2:#2]\else
+ \dodoGSC[#1#2:#1#2]\fi\fi\fi\fi\fi}
+
+\def\dododoXC#1%
+ {\dodododoXC[#1]}
+
+\def\dodoXC[#1]%
+ {{\let\NC\relax\processcommalist[#1]\dododoXC}}
+
+\def\doGSC[#1]{\iffirstargument\dodoGSC[#1]\else\expandafter\NC\fi}
+\def\doGFC[#1]{\iffirstargument\dodoGFC[#1]\else\expandafter\NC\fi}
+\def\doGTC[#1]{\iffirstargument\dodoGTC[#1]\else\expandafter\NC\fi}
+\def\doXC [#1]{\iffirstargument\dodoXC [#1]\else\expandafter\fi\NC}
+
+\def\tbGSC{\dosingleempty\doGSC}
+\def\tbGFC{\dosingleempty\doGFC}
+\def\tbGTC{\dosingleempty\doGTC}
+\def\tbXC {\dosingleempty\doXC }
+
+%D The amount of code to support tables and tabulation is
+%D rather minimalistic.
+
+\let\tabulatepos\tablepos
+
+\def\tabulatenormalpos
+ {\hss\tabulatepos\hss}
+
+\def\tabulateequalpos
+ {\setbox\scratchbox\hbox{\tabulateEQ}%
+ \hbox to \wd\scratchbox{\hss\kern\zeropoint\tabulatepos\hss}%
+ \hskip-\wd\scratchbox
+ \box\scratchbox}
+
+\def\tabulatenormalcolumn#1% overloaded
+ {&\iftabulateequal\tabulateequalpos\else\tabulatenormalpos\fi
+ &\global\chardef\tabulatetype#1&}
+
+\def\tabulateequalcolumn#1% overloaded
+ {&\tabulateequalpos
+ &\global\chardef\tabulatetype#1&}
+
+\appendtoks
+ \doglobal\increment\noftabpositions
+\to \everytabulate
+
+%D In order to prevent potential clashes with abbreviations,
+%D postpone the mapping.
+
+\appendtoks
+ \let\GSC\tbGSC \let\GFC\tbGFC \let\GTC\tbGTC \let\XC\tbXC
+\to \everytabulate
+
+%D \macros
+%D {definepositionframed}
+%D
+%D The next example show how to provide backgrounds to table
+%D cells. First we define some framed backgrounds.
+%D
+%D \startbuffer
+%D \definepositionframed[x][background=color,backgroundcolor=red]
+%D \definepositionframed[y][background=color,backgroundcolor=green]
+%D \definepositionframed[z][background=color,backgroundcolor=blue]
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D % \getbuffer
+%D
+%D \startbuffer
+%D \starttabulate[|c|c|c|]
+%D \GFC[f:x] this is a small \NC table \NC in which we \NC \FR
+%D \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR
+%D \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR
+%D \stoptabulate
+%D \stopbuffer
+%D
+%D The table itself defines three areas (a, b and~c) using
+%D these frames.
+%D
+%D \typebuffer
+%D % \getbuffer
+%D
+%D Tables (based on \TABLE) are supported by:
+
+\def\normalTABLEsimplebar {\unskip\!ttRightGlue&\tablepos&} % |
+\def\normalTABLEcomplexbar{\unskip\!ttRightGlue&\omit\tablepos\!ttAlternateVrule} % \|
+\def\normalTABLEquote {\unskip\!ttRightGlue&\omit\tablepos&} % "
+
+\appendtoks
+ \doglobal\increment\noftabpositions
+\to \everytable
+
+%D Since we don't want nameclashes:
+
+\appendtoks
+ \let\GSC\tbGSC \let\GFC\tbGFC \let\GTC\tbGTC \let\XC\tbXC
+\to \everytable
+
+%D In the previous example, we could have provided an overlay to
+%D the framed definition. A more direct approach is demonstrated
+%D below:
+%D
+%D \startbuffer
+%D \def\cw#1{\color[white]{#1}}
+%D
+%D \startMPpositiongraphic{tableshade}
+%D initialize_area(\MPpos{\MPvar{from}},\MPpos{\MPvar{to}}) ;
+%D color c ; c := \MPvar{color} ;
+%D linear_shade(pxy,0,.4c,.9c) ;
+%D anchor_area(\MPanchor{\MPvar{from}}) ;
+%D \stopMPpositiongraphic
+%D
+%D \setMPpositiongraphic{b:x}{tableshade}{from=b:x,to=e:x,color=red}
+%D \setMPpositiongraphic{b:y}{tableshade}{from=b:y,to=e:y,color=green}
+%D \setMPpositiongraphic{b:z}{tableshade}{from=b:z,to=e:z,color=blue}
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D The definition of the table looks about the same as the
+%D previous one:
+%D
+%D \startbuffer
+%D \starttable[|c|c|c|]
+%D \GFC[b:z] \cw{this is a small} \NC \cw{table} \NC in which we \NC \FR
+%D \NC \cw{will demonstrate} \GFC[c:y] \cw{that this} \GTC[c] \cw{positioning} \NC \MR
+%D \GSC[a:x] \cw{mechanism also} \GTC[b] \cw{works quite well} \NC in tables \NC \LR
+%D \stoptable
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D \getbuffer
+
+% \definepositionframed[w][background=color,backgroundcolor=yellow]
+% \definepositionframed[x][background=color,backgroundcolor=red]
+% \definepositionframed[y][background=color,backgroundcolor=green]
+% \definepositionframed[z][background=color,backgroundcolor=blue]
+%
+% \starttabulate[|c|c|c|]
+% \NC this is a small \NC table \NC in which we \NC \FR
+% \NC will demonstrate \NC that this \NC positioning \NC \MR
+% \NC mechanism also \NC works quite well \NC in tables \NC \LR
+% \stoptabulate
+%
+% \starttabulate[|c|c|c|]
+% \GFC[f:x] this is a small \GTC table \NC in which we \NC \FR
+% \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR
+% \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR
+% \stoptabulate
+%
+% \starttabulate[|c|c|c|]
+% \GFC[f:x,d:w] this is a small \GTC[d] table \NC in which we \NC \FR
+% \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR
+% \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR
+% \stoptabulate
+%
+% \starttabulate[|c|c|c|]
+% \XC[+f:x] this is a small \XC table \NC in which we \NC \FR
+% \NC will demonstrate \XC[+g:z] that this \XC[-g] positioning \NC \MR
+% \XC[=e:y] mechanism also \XC[-f] works quite well \NC in tables \NC \LR
+% \stoptabulate
+%
+% \starttabulate[|c|c|c|]
+% \XC[+f:x,+d:w] this is a small \XC[-d] table \NC in which we \NC \FR
+% \NC will demonstrate \XC[+g:z] that this \XC[-g] positioning \NC \MR
+% \XC[=e:y] mechanism also \XC[-f] works quite well \NC in tables \NC \LR
+% \stoptabulate
+
+% evt [b:x]
+%
+% \definepositionframed[x][background=color,fillcolor=red]
+% \definepositionframed[y][background=color,fillcolor=green]
+% \definepositionframed[z][background=color,fillcolor=blue]
+
+\def\remappositionframed#1#2% from to
+ {\copyposition{b:#1}{b:#2}%
+ \copyposition{e:#1}{e:#2}%
+ \dosetpositionaction{b:#2}{\dopositionaction{b:#1}}}
+
+\def\definepositionframed
+ {\dodoubleargument\dodefinepositionframed}
+
+\def\dodefinepositionframed[#1][#2]%
+ {\dosetpositionaction{b:#1}{\dopositionframed[#1][#2]}}
+
+\def\positionframed
+ {\dodoubleempty\dopositionframed}
+
+\def\dopositionframed[#1][#2]%
+ {\bgroup
+ \setbox\scratchbox\hbox
+ {\dimen0=\MPx{e:#1}%
+ \advance\dimen0 -\MPx{b:#1}%
+ \dimen2=\MPy{b:#1}%
+ \advance\dimen2 -\MPy{e:#1}%
+ \advance\dimen2 \MPd{e:#1}%
+ \lower\dimen2\hbox
+ {\advance\dimen2 \MPh{b:#1}%
+ \framed
+ [\c!width=\dimen0,\c!height=\dimen2,
+ \c!offset=\v!overlay,#2]{}}}%
+ \smashedbox\scratchbox
+ \egroup}
+
+% \def\sethdistances#1%
+% {\hbox{\lpos{ml:#1}\hpos{mh:#1}{\strut}\rpos{mr:#1}}}
+%
+% \def\gethdistances#1%
+% {\scratchdimen\MPx{mh:#1}%
+% \advance\scratchdimen -\MPx{ml#1}%
+% \edef\lefthdistance{\the\scratchdimen}%
+% \scratchdimen\MPx{mr:#1}%
+% \advance\scratchdimen -\MPx{mh:#1}%
+% \edef\righthdistance{\the\scratchdimen}}
+
+\protect \endinput
+
+% todo 1: shift down option
+
+% \startuseMPgraphic{mpos:par:columnset}
+% \iftracepositions show_multi_pars \else draw_multi_pars \fi ;
+% path p ; p := boundingbox currentpicture ;
+% currentpicture := currentpicture shifted (0,-StrutDepth/2) ;
+% setbounds currentpicture to p ;
+% \stopuseMPgraphic
+
+\definetextbackground[underline] [location=text,alternative=1,background=,frame=off]
+\definetextbackground[overstrike] [location=text,alternative=2,background=,frame=off]
+\definetextbackground[exlines] [location=text,alternative=3,background=,frame=off]
+\definetextbackground[strikethrough][location=text,alternative=4,background=,frame=off]
+
+\definestartstop [underline]
+ [before={\starttextbackground[underline]},
+ after=\stoptextbackground]
+
+\definestartstop
+ [overstrike]
+ [before={\starttextbackground[overstrike]},
+ after=\stoptextbackground]
+
+\definestartstop
+ [exlines]
+ [before={\starttextbackground[exlines]},
+ after=\stoptextbackground]
+
+\definestartstop
+ [strikethrough]
+ [before={\starttextbackground[strikethrough]},
+ after=\stoptextbackground]
+
+\starttext
+ \startunderline \input tufte \stopunderline \blank
+ \startoverstrike \input tufte \stopoverstrike \blank
+ \startexlines \input tufte \stopexlines \blank
+ \startstrikethrough \input tufte \stopstrikethrough \blank
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/core-pos.tex b/Master/texmf-dist/tex/context/base/core-pos.tex
index 429aefeec15..0324e522c1d 100644
--- a/Master/texmf-dist/tex/context/base/core-pos.tex
+++ b/Master/texmf-dist/tex/context/base/core-pos.tex
@@ -11,7 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% needs a cleanup, things may change
+% needs a cleanup, things may change; we also need to move the mp
+% related code to meta-pos
% shorter tags, ..:achtergrond:.. etc in pos actions
@@ -812,6 +813,107 @@
% \appendtoks \registerparoptions \to \everypar
+%D Eperimental code, don't use this yet: (must be sped up anyway)
+
+\def\@@noden{node:n:}
+\def\@@nodeo{node:o:}
+\def\@@nodep{node:p:}
+
+\def\nextnodelocation#1%
+ {\pluscounter{\@@noden#1}}
+
+\def\newnodelocation#1%
+ {\ifundefined{\@@noden#1}%
+ \setcounter{\@@noden#1}\zerocount
+ \letgvalue {\@@nodeo#1}\!!zerocount
+ \fi}
+
+\def\tagnodelocation#1%
+ {\xypos{\@@nodep#1:\countervalue{\@@noden#1}}}
+
+\def\getnodelocationp#1{\MPp{\@@nodep#1:\countervalue{\@@noden#1}}}
+\def\getnodelocationx#1{\MPx{\@@nodep#1:\countervalue{\@@noden#1}}}
+\def\getnodelocationy#1{\MPy{\@@nodep#1:\countervalue{\@@noden#1}}}
+
+\def\numnodelocationp#1#2{\MPp{\@@nodep#1:\number#2}}
+\def\numnodelocationx#1#2{\MPx{\@@nodep#1:\number#2}}
+\def\numnodelocationy#1#2{\MPy{\@@nodep#1:\number#2}}
+
+\def\getnodelocationn#1{\countervalue{\@@noden#1}}
+\def\getnodelocationo#1{\getvalue {\@@nodeo#1}}
+
+\chardef\nodelocationmode\plusone
+
+\def\analyzenodelocation#1%
+ {\doanalyzenodelocation{#1}{\getnodelocationn{#1}}\zerocount}
+
+\def\doanalyzenodelocation#1#2#3% class n default
+ {\begingroup
+ \donefalse
+ \ifcase\nodelocationmode
+ % do nothing
+ \else
+ \edef\nodelocationselfn{#2}%
+ \edef\nodelocationselfp{\numnodelocationp{#1}\nodelocationselfn}%
+ \edef\nodelocationselfx{\numnodelocationx{#1}\nodelocationselfn}%
+ \edef\nodelocationselfy{\numnodelocationy{#1}\nodelocationselfn}%
+ \scratchcounter\plusone
+ \doloop
+ {\ifnum\recurselevel=\nodelocationselfn\relax
+ \donetrue
+ \else
+ \edef\nodelocationotherp{\numnodelocationp{#1}\recurselevel}%
+ \edef\nodelocationotherx{\numnodelocationx{#1}\recurselevel}%
+ \edef\nodelocationothery{\numnodelocationy{#1}\recurselevel}%
+ \ifcase\nodelocationmode
+ \or
+ % ok for single column
+ \ifcase\nodelocationotherp\relax
+ \exitloop
+ \else\ifnum\nodelocationotherp<\nodelocationselfp\relax
+ \donetrue \advance\scratchcounter\plusone
+ \else\ifnum\nodelocationotherp>\nodelocationselfp\relax
+ % skip
+ \else\ifdim\nodelocationothery>\nodelocationselfy\relax
+ \donetrue \advance\scratchcounter\plusone
+ \else\ifdim\nodelocationothery<\nodelocationselfy\relax
+ % skip
+ \else\ifdim\nodelocationotherx<\nodelocationselfx\relax
+ \donetrue \advance\scratchcounter\plusone
+ \fi\fi\fi\fi\fi\fi
+ \or
+ % acceptable for double column
+ \ifcase\nodelocationotherp\relax
+ \exitloop
+ \else\ifnum\nodelocationotherp<\nodelocationselfp\relax
+ \donetrue \advance\scratchcounter\plusone
+ \else\ifnum\nodelocationotherp>\nodelocationselfp\relax
+ % skip
+ \else\ifnum\recurselevel>\nodelocationselfn\relax
+ \donetrue \exitloop
+ \else
+ \donetrue \advance\scratchcounter\plusone
+ \fi\fi\fi\fi
+ \else
+ \exitloop
+ \fi
+ \fi}%
+ \fi
+ \ifdone \else
+ \scratchcounter#3\relax
+ \fi
+ \setxvalue{\@@nodeo#1}{\the\scratchcounter}%
+ \endgroup}
+
+\unexpanded\def\shownodelocation#1%
+ {\analyzenodelocation{#1}%
+ (#1,%
+ n:\getnodelocationn{#1},%
+ p:\getnodelocationp{#1},%
+ x:\getnodelocationx{#1},%
+ y:\getnodelocationy{#1},%
+ o:\getnodelocationo{#1})}
+
%D \macros
%D {doifoverlappingelse}
%D
@@ -824,37 +926,6 @@
%D {action when not overlapping}
%D \stoptyping
-% \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
-%
-% \overlappingmargin-2sp % better
-
\def\overlappingmargin{-2\scaledpoint}
\def\doifoverlappingelse#1#2%
@@ -936,1796 +1007,10 @@
\rawprocesscommalist[#2]\docommando
\ifdone\egroup#3\else\egroup#4\fi}
-\def\doifpositionsonsamepageelse%
+\def\doifpositionsonsamepageelse
{\dodoifpositionsonsamepageelse{0}}
\def\doifpositionsonthispageelse#1#2#3%
{\dodoifpositionsonsamepageelse\realfolio}
-%D Before we come to graphics support, we have to make sure of
-%D the reference point on the page. The next macro does so and
-%D is hooked into the page building routine.
-
-% in the future, the depth of tail will reflect page depth
-
-\def\textanchor{text:\realfolio}
-
-% \def\placepositionanchors % todo : depth pagebox
-% {\ifpositioning
-% \setbox\scratchbox\vbox to \teksthoogte
-% {\topskipcorrection
-% \hbox{\strut\dopositionaction\headanchor}%
-% \vfill
-% \hbox{\strut\dopositionaction\tailanchor}}%
-% \dp\scratchbox\zeropoint
-% \wd\scratchbox\zetbreedte % not \zeropoint, else wrong text backgrounds
-% \hpos\textanchor{\box\scratchbox}%
-% \else
-% \vskip\teksthoogte
-% \fi}
-
-\def\placepositionanchors % todo : depth pagebox
- {\ifpositioning
- \setbox\scratchbox\vbox to \textheight
- {\simpletopskipcorrection
- \hbox{\strut\dopositionaction\headanchor}%
- \vfill
- \hbox{\strut\dopositionaction\tailanchor}}%
- \dp\scratchbox\zeropoint
- \wd\scratchbox\makeupwidth % not \zeropoint, else wrong text backgrounds
- \hpos\textanchor{\box\scratchbox}%
- \else
- \vskip\textheight
- \fi}
-
-%D The first version of this module implemented head and tail
-%D anchors. Currently we stick to just one anchor and derive
-%D the head and tail anchors from this one.
-
-\def\headanchor{head:\realfolio} % virtual position
-\def\tailanchor{tail:\realfolio} % virtual position
-
-\def\presetpositionanchors% compatibility hack (still needed?)
- {\ifpositioning
- \dopresetpositionanchors
- \fi}
-
-% \def\dopresetpositionanchors
-% {\bgroup
-% \dimen0=\ifdim\topskip>\strutht\topskip\else\strutht\fi
-% \dimen2=\MPy\textanchor
-% \dimen4=\dimen2
-% \advance\dimen2 \MPh\textanchor % space is essential
-% \advance\dimen2 -\dimen0
-% \advance\dimen4 \strutdp
-% \dimen6=\MPx\textanchor
-% \dimen8=\MPw\textanchor
-% \setxvalue{\POSprefix\headanchor}%
-% {\realfolio,\withoutpt\the\dimen6,\withoutpt\the\dimen2,%
-% \withoutpt\the\dimen8,\withoutpt\the\dimen0,\withoutpt\the\strutdp}%
-% \setxvalue{\POSprefix\tailanchor}%
-% {\realfolio,\withoutpt\the\dimen6,\withoutpt\the\dimen4,%
-% \withoutpt\the\dimen8,\withoutpt\the\strutht,\withoutpt\the\strutdp}%
-% %\showanchor\textanchor\showanchor\headanchor\showanchor\tailanchor\wait
-% \egroup}
-
-\def\dopresetpositionanchors
- {\bgroup
- \!!dimena\ifdim\topskip>\strutht\topskip\else\strutht\fi
- \!!dimenb\MPy\textanchor
- \!!dimenc\!!dimenb
- \advance\!!dimenb \MPh\textanchor % space is essential
- \advance\!!dimenb -\!!dimena
- \advance\!!dimenc \strutdp
- \!!dimend\MPx\textanchor
- \!!dimene\MPw\textanchor
- \setxvalue{\POSprefix\headanchor}%
- {\realfolio,\withoutpt\the\!!dimend,\withoutpt\the\!!dimenb,%
- \withoutpt\the\!!dimene,\withoutpt\the\!!dimena,\withoutpt\the\strutdp}%
- \setxvalue{\POSprefix\tailanchor}%
- {\realfolio,\withoutpt\the\!!dimend,\withoutpt\the\!!dimenc,%
- \withoutpt\the\!!dimene,\withoutpt\the\strutht,\withoutpt\the\strutdp}%
- %\showanchor\textanchor\showanchor\headanchor\showanchor\tailanchor\wait
- \egroup}
-
-\def\showanchor#1%
- {\expanded{\writestatus{#1}
- {\MPp{#1}\string|\MPx{#1}\string|\MPy{#1}\string|%
- \MPw{#1}\string|\MPh{#1}\string|\MPd{#1}}}}
-
-%D We set these anchors before and after each page.
-
-\appendtoks \presetpositionanchors \to \beforeeverypage
-\appendtoks \presetpositionanchors \to \aftereverypage
-
-%D \macros
-%D {positionoverlay,startpositionoverlay}
-%D
-%D As long as we're dealing with graphics it makes much sense
-%D to use the available overlay mechanism. For this purpose, we
-%D define some dedicated overlay extensions.
-%D
-%D \startbuffer[sample]
-%D \defineoverlay [sample] [\positionoverlay{sample}]
-%D
-%D \startpositionoverlay{sample}
-%D \setMPpositiongraphic{A-1}{connectcenter}{from=A-1,to=A-2}
-%D \stoppositionoverlay
-%D \stopbuffer
-%D
-%D \typebuffer[sample]
-%D
-%D \startbuffer[graphic]
-%D \startMPpositiongraphic{connectcenter}
-%D path pa, pb ; pair ca, cb ;
-%D initialize_box(\MPpos{\MPvar{from}}) ; pa := pxy ; ca := cxy ;
-%D initialize_box(\MPpos{\MPvar{to}}) ; pb := pxy ; cb := cxy ;
-%D draw pa withcolor red ;
-%D draw pb withcolor red ;
-%D draw ca -- cb withcolor blue ;
-%D anchor_box(\MPanchor{\MPvar{from}}) ;
-%D \stopMPpositiongraphic
-%D \stopbuffer
-%D
-%D We can best demonstrate this in an example, say:
-%D
-%D \startbuffer[text]
-%D \framed
-%D [backgroundachtergrond=sample,align=middle,width=7cm]
-%D {We want to connect \hpos {A-1} {this} word with its
-%D grammatical cousin \hpos {A-2} {that}.}
-%D \stopbuffer
-%D
-%D \typebuffer[text]
-%D
-%D \startlinecorrection
-%D %\getbuffer[graphic,sample,text]
-%D \stoplinecorrection
-%D
-%D The graphic is defined in the following way, using some
-%D macros defined in an auxiliary \METAPOST\ module that is
-%D preloaded.
-%D
-%D \typebuffer[graphic]
-
-\def\MPanchoridentifier{mpa} % {mp-anchor}
-\def\MPoverlayposprefix{MO::}
-
-% obsolete and wrong anyway
-%
-% \long\def\defineMPpositiongraphic#1%
-% {\long\setvalue{\MPoverlayposprefix#1}}
-
-%D The rest of the definitions concerning such overlays may
-%D look complicated,
-
-\let\currentpositionoverlay\empty
-
-%D Position actions are automatically executed when a position
-%D is set.
-
-% \def\positionoverlay#1%
-% {\ifpositioning
-% \vbox to \overlayheight
-% {\edef\MPanchor##1{\MPpos{#1::\MPanchoridentifier:\realfolio}}%
-% \the\everyinsertpositionaction
-% \copyposition{#1::\MPanchoridentifier}{#1::\MPanchoridentifier:\realfolio}%
-% \hpos
-% {#1::\MPanchoridentifier:\realfolio}
-% {\hbox to \overlaywidth{\dopositionaction{#1::\MPanchoridentifier}\hss}}%
-% \vfill}%
-% \fi}
-
-\let\MPanchornumber\realfolio
-
-% \def\positionoverlay#1%
-% {\ifpositioning
-% \vbox to \overlayheight
-% {\edef\MPanchorid{#1::\MPanchoridentifier:\MPanchornumber}%
-% \edef\MPanchor##1{\MPpos{\MPanchorid}}%
-% \the\everyinsertpositionaction
-% \copyposition{#1::\MPanchoridentifier}{#1::\MPanchoridentifier:\MPanchornumber}%
-% \hpos
-% {#1::\MPanchoridentifier:\MPanchornumber}
-% {\hbox to \overlaywidth{\dopositionaction{#1::\MPanchoridentifier}\hss}}%
-% \vfill}%
-% \fi}
-
-% \def\positionoverlay#1% the test prevents too many redundant positions
-% {\ifpositioning % in (not used) text* position layers
-% \vbox to \overlayheight
-% {\doifpositionactionelse{#1::\MPanchoridentifier}%
-% {\edef\MPanchorid{#1::\MPanchoridentifier:\MPanchornumber}%
-% \edef\MPanchor##1{\MPpos{\MPanchorid}}%
-% \the\everyinsertpositionaction
-% \copyposition{#1::\MPanchoridentifier}{#1::\MPanchoridentifier:\MPanchornumber}%
-% \hpos
-% {#1::\MPanchoridentifier:\MPanchornumber}%
-% {\hbox to \overlaywidth{\dopositionaction{#1::\MPanchoridentifier}\hss}}}%
-% {\hbox to \overlaywidth{\hss}}%
-% \vfill}%
-% \fi}
-
-\def\positionoverlay#1% the test prevents too many redundant positions
- {\ifpositioning % in (not used) text* position layers
- \vbox to \overlayheight
- {\doifpositionactionelse{#1::\MPanchoridentifier}%
- {\edef\MPanchorid{#1::\MPanchoridentifier:\MPanchornumber}%
- \edef\MPanchor##1{\MPpos{\MPanchorid}}%
- \the\everyinsertpositionaction
- \copyposition{#1::\MPanchoridentifier}{#1::\MPanchoridentifier:\MPanchornumber}%
- \hpos
- {#1::\MPanchoridentifier:\MPanchornumber}%
- % this is ok
- %{\hbox to \overlaywidth{\dopositionaction{#1::\MPanchoridentifier}\hss}}}%
- % but this one prevents cyclic runs due to
- % rounding errors
- {\setbox\scratchbox\hbox to \overlaywidth
- {\dopositionaction{#1::\MPanchoridentifier}\hss}%
- \ht\scratchbox\overlayheight
- \dp\scratchbox\zeropoint
- \box\scratchbox}}%
- {\hbox to \overlaywidth{\hss}}%
- \vfill}%
- \fi}
-
-\def\startpositionoverlay#1%
- {\iftrialtypesetting % we don't want redundant entries in the list
- \@EA\gobbleuntil\@EA\stoppositionoverlay
- \else
- \def\currentpositionoverlay{#1}%
- \fi}
-
-\def\stoppositionoverlay
- {\let\currentpositionoverlay\empty}
-
-\def\resetpositionoverlay#1%
- {\dosetpositionaction{#1::\MPanchoridentifier::}{}}
-
-%D Here the complication has to do with collecting actions
-%D for later execution. This collection is especially handy
-%D when we want to move actions to a specific layer.
-%D Such series of actions are stored in a macro (the one
-%D with the funny \type {++}) which is cleaned up after each
-%D invocation.
-
-\newtoks\everycleanpositionaction
-\newtoks\everyinsertpositionaction
-
-%\def\cleanuppositionaction#1%
-% {\doifdefined{\POSactionprefix#1++}
-% {\the\everycleanpositionaction
-% \setxvalue{\POSactionprefix#1++}{\getvalue{\POSactionprefix#1++}}}}
-
-%\def\cleanuppositionaction#1%
-% {\ifundefined{\POSactionprefix#1++}\else
-% \the\everycleanpositionaction
-% \setxvalue{\POSactionprefix#1++}{\getvalue{\POSactionprefix#1++}}%
-% \fi}
-
-\def\cleanuppositionaction#1% not in trialtypesetting
- {\ifundefined{\POSactionprefix#1++}\else
- \the\everycleanpositionaction
- \iflocalpositioning
- \letgvalue{\POSactionprefix#1++}\empty
- \else
- \setxvalue{\POSactionprefix#1++}{\getvalue{\POSactionprefix#1++}}%
- \fi
- \fi}
-
-\def\handlepositionaction#1\with#2\on#3%
- {\bgroup
- \ifx\currentpositionoverlay\empty
- \edef\!!stringa{#3}% no layer, just pos itself as anchor
- \else
- \edef\!!stringa{\currentpositionoverlay::\MPanchoridentifier}%
- \fi
- \edef\!!stringc{\POSactionprefix\!!stringa++}%
- \expanded{\dosetpositionaction{\!!stringa}{\noexpand\getvalue{\!!stringc}}}%
- \global\let#1\relax
- \edef\!!stringb{\executeifdefined\!!stringc\empty}%
- \setxvalue\!!stringc{\!!stringb#1#2}%
- \egroup}
-
-%D The indirectness enables us redefine macros for special
-%D purposes, like a cleanup.
-
-\def\handlepositionboxes#1#2#3%
- {\handlepositionaction\dohandlepositionboxes\with{#1}{#2}{#3}\on{#2}}
-
-\def\doinsertpositionboxes#1#2#3% pos tag setups
- {\ifnum\MPp{#1}=\realpageno\relax
- % \doifdefined{\MPoverlayposprefix#1}
- % {\getvalue{\MPoverlayposprefix#1}{#1}{#2}{#3}}%
- \executeifdefined{\MPoverlayposprefix#1}%
- \gobblethreearguments{#1}{#2}{#3}%
- \fi}
-
-\appendtoks
- \let\dohandlepositionboxes\doinsertpositionboxes % was handle ?
-\to \everyinsertpositionaction
-
-\def\docleanpositionboxes#1#2#3% pos tag setups
- {\ifnum\MPp{#1}<\realpageno \else
- \noexpand \dohandlepositionboxes{#1}{#2}{#3}% reinsert
- \fi}
-
-\appendtoks
- \let\dohandlepositionboxes\docleanpositionboxes
-\to \everycleanpositionaction
-
-%D A position graphic is a normal (non||reused) \METAPOST\
-%D graphic, used immediately, with zero dimensions, so that a
-%D sequence of them does not harm.
-
-\newbox\positiongraphicbox
-
-\def\startMPpositiongraphic % id setups
- {\dodoublegroupempty\dostartMPpositiongraphic}
-
-\long\def\dostartMPpositiongraphic#1#2#3\stopMPpositiongraphic
- {\long\setgvalue{MPG:#1}% tag list mpcode
- {\useMPpositiongraphic{#1}{#2}{#3}}}
-
-%\def\prepareMPpositionvariables
-% {\doifundefined{\@@meta self}{\setvalue{\@@meta self}{\currentposition}}%
-% \doifundefined{\@@meta from}{\setvalue{\@@meta from}{\currentposition}}}
-
-\def\prepareMPpositionvariables
- {\ifundefined{\@@meta self}\setvalue{\@@meta self}{\currentposition}\fi
- \ifundefined{\@@meta from}\setvalue{\@@meta from}{\currentposition}\fi}
-
-% \long\def\useMPpositiongraphic#1#2#3%
-% {\bgroup
-% \prepareMPvariables{#2}%
-% \prepareMPpositionvariables
-% \enableincludeMPgraphics
-% \startMPgraphic#3\stopMPgraphic
-% \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
-% \deallocateMPslot\currentMPgraphic
-% \placeMPgraphic
-% \egroup}
-
-\newif\ifcollectMPpositiongraphics \collectMPpositiongraphicstrue
-
-\long\def\useMPpositiongraphic#1#2#3%
- {\bgroup
- \prepareMPvariables{#2}%
- \prepareMPpositionvariables
- \enableincludeMPgraphics
- \ifcollectMPpositiongraphics
- \expanded{\startMPdrawing#3\noexpand\stopMPdrawing}%
- \global\MPdrawingdonetrue
- \else
- \startMPgraphic#3\stopMPgraphic
- \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
- \deallocateMPslot\currentMPgraphic
- \placeMPgraphic
- \fi
- \egroup}
-
-% Now we need a adapted action handler:
-
-% \def\dopositionaction#1% test saves hash entry in etex
-% {\ifundefined{\POSactionprefix#1::}\else
-% \ifnum\MPp{#1}>\zerocount % new
-% \bgroup
-% \traceposstring\clap\red{<#1>}%
-% \the\everyinsertpositionaction
-% \the\everypositionaction
-% \ifcollectMPpositiongraphics
-% % can save a lot of run time
-% \pushMPdrawing
-% \MPshiftdrawingtrue
-% \resetMPdrawing
-% \getvalue{\POSactionprefix#1::}%
-% \ifMPdrawingdone
-% \getMPdrawing
-% \fi
-% \resetMPdrawing
-% \popMPdrawing
-% \else
-% \getvalue{\POSactionprefix#1::}%
-% \fi
-% \cleanuppositionaction{#1}%
-% \egroup
-% \else
-% % shouldn't happen too often
-% \traceposstring\clap\cyan{<#1>}%
-% \fi
-% \fi}
-
-\def\dopositionaction#1% test saves hash entry in etex
- {\ifundefined{\POSactionprefix#1::}\else
- \ifnum\MPp{#1}>\zerocount % new
- \bgroup
- \setbox\scratchbox\hbox
- \bgroup
- \traceposstring\clap\red{<#1>}%
- \the\everyinsertpositionaction
- \the\everypositionaction
- \ifcollectMPpositiongraphics
- % can save a lot of run time
- \pushMPdrawing
- \MPshiftdrawingtrue
- \resetMPdrawing
- \getvalue{\POSactionprefix#1::}%
- \ifMPdrawingdone
- \getMPdrawing
- \fi
- \resetMPdrawing
- \popMPdrawing
- \else
- \getvalue{\POSactionprefix#1::}%
- \fi
- \cleanuppositionaction{#1}%
- \egroup % smashed is really needed else
- \smashedbox\scratchbox % we get problems with too big
- \egroup % overlays (s-pre-0x.tex)
- \else
- % shouldn't happen too often
- \traceposstring\clap\cyan{<#1>}%
- \fi
- \fi}
-
-\def\MPpositiongraphic
- {\dodoublegroupempty\doMPpositiongraphic}
-
-% \def\doMPpositiongraphic#1#2% tag setups
-% {\bgroup
-% \def\@@meta{#1:}%
-% \setupMPvariables[#2]%
-% \prepareMPpositionvariables
-% \MPshiftdrawingtrue
-% \def\doMPpositiongraphic##1##2{\getvalue{MPG:##1}}% temp hack
-% \setbox\positiongraphicbox\hbox
-% {\ignorespaces
-% \executeifdefined{MPM:#1}{\executeifdefined{MPG:#1}\donothing}%
-% \removelastspace}%
-% \smashbox\positiongraphicbox
-% \box\positiongraphicbox
-% \egroup}
-
-\def\doMPpositiongraphic#1#2% tag setups
- {\bgroup
- \def\@@meta{#1:}%
- \setupMPvariables[#2]%
- \prepareMPpositionvariables
- \MPshiftdrawingtrue
- \def\doMPpositiongraphic##1##2%
- {{% new, see (techniek)
- \def\@@meta{##1:}%
- \setupMPvariables[#2,##2]%
- \prepareMPpositionvariables
- % and needed
- \getvalue{MPG:##1}}}% temp hack
- \setbox\positiongraphicbox\hbox
- {\ignorespaces
- \executeifdefined{MPM:#1}{\executeifdefined{MPG:#1}\donothing}%
- \removelastspace}%
- \smashbox\positiongraphicbox
- \box\positiongraphicbox
- \egroup}
-
-\long\def\startMPpositionmethod#1#2\stopMPpositionmethod
- {\long\setgvalue{MPM:#1}{#2}} % todo: var list here
-
-%D Simple one position graphics.
-
-\def\setMPpositiongraphic
- {\dotriplegroupempty\dosetMPpositiongraphic}
-
-\def\dosetMPpositiongraphic#1#2#3% pos tag vars
- {\ifx\currentpositionoverlay\empty
- \dosetpositionaction{#1}{\MPpositiongraphic{#2}{#3}}%
- \else % silly can be one
- \handlepositiongraphics{#1}{#2}{#3}%
- \fi}
-
-\def\handlepositiongraphics#1#2#3% combine with boxes
- {\handlepositionaction\dohandleMPpositiongraphic\with{#1}{#2}{#3}\on{#2}}
-
-\def\doinsertMPpositiongraphic#1#2#3% pos tag setups
- {\ifnum\MPp{#1}=\realpageno\relax % extra saveguard
- \def\currentposition{#1}\MPpositiongraphic{#2}{#3}%
- \fi}
-
-\appendtoks
- \let\dohandleMPpositiongraphic\doinsertMPpositiongraphic
-\to \everyinsertpositionaction
-
-\def\docleanMPpositiongraphic#1#2#3% pos tag setups
- {\ifnum\MPp{#1}<\realpageno \else
- \noexpand \dohandleMPpositiongraphic{#1}{#2}{#3}%
- \fi}
-
-\appendtoks
- \let\dohandleMPpositiongraphic\docleanMPpositiongraphic
-\to \everycleanpositionaction
-
-%D Graphics that span two positions.
-
-\def\setMPpositiongraphicrange
- {\doquadruplegroupempty\dosetMPpositiongraphicrange}
-
-\def\dosetMPpositiongraphicrange#1#2#3#4% bpos epos tag vars
- {\ifx\currentpositionoverlay\empty
- \dosetpositionaction{#1}{\MPpositiongraphic{#3}{#4}}%
- \else
- \handlepositiongraphicsrange{#1}{#2}{#3}{#4}%
- \fi}
-
-\def\handlepositiongraphicsrange#1#2#3#4%
- {\handlepositionaction\dohandleMPpositiongraphicrange\with{#1}{#2}{#3}{#4}\on{#2}}
-
-% \def\doinsertMPpositiongraphicrange#1#2#3#4% pos pos tag setups
-% {\donefalse
-% \ifnum\MPp{#1}=\realpageno\relax \donetrue
-% \else\ifnum\MPp{#2}=\realpageno\relax \donetrue
-% \else\ifnum\MPp{#1}<\realpageno\relax\ifnum\MPp{#2}>\realpageno\donetrue
-% \fi\fi\fi\fi \ifdone
-% \def\currentposition{#1}\MPpositiongraphic{#3}{#4}%
-% \fi}
-
-\def\doinsertMPpositiongraphicrange#1#2#3#4% pos pos tag setups
- {\ifnum\MPp{#1}\MPp{#2}>\zerocount
- \iflocalpositioning
- \donetrue
- \else
- \donefalse
- \ifnum\MPp{#1}=\realpageno
- \donetrue
- \else\ifnum\MPp{#2}=\realpageno
- \donetrue
- \else\ifnum\MPp{#1}<\realpageno\relax\ifnum\MPp{#2}>\realpageno
- \donetrue
- \fi\fi\fi\fi
- \fi
- \ifdone
- \def\currentposition{#1}\MPpositiongraphic{#3}{#4}%
- \fi
- \fi}
-
-\appendtoks
- \let\dohandleMPpositiongraphicrange\doinsertMPpositiongraphicrange
-\to \everyinsertpositionaction
-
-\def\docleanMPpositiongraphicrange#1#2#3#4% pos tag setups
- {\ifnum\MPp{#2}<\realpageno \else
- \noexpand \dohandleMPpositiongraphicrange{#1}{#2}{#3}{#4}%
- \fi}
-
-\appendtoks
- \let\dohandleMPpositiongraphicrange\docleanMPpositiongraphicrange
-\to \everycleanpositionaction
-
-% will be overloaded, and/or code below moved to core-box
-
-\defineoverlay[\v!text-2][\positionoverlay{\v!text-2}]
-\defineoverlay[\v!text-1][\positionoverlay{\v!text-1}]
-\defineoverlay[\v!text+1][\positionoverlay{\v!text+1}]
-\defineoverlay[\v!text+2][\positionoverlay{\v!text+2}]
-
-%D The auxiliary \METAPOST\ macros are defined by default,
-%D by saying:
-
-\appendtoks
- if unknown context_core : input mp-core.mp ; fi ;
-\to \MPextensions
-
-%D Some of these macros are pretty clever but too complicated
-%D to be nice. When things are kind of stable I'll clean up
-%D this mess.
-
-%D THIS NEEDS A CLEANUP
-
-\setupMPvariables
- [mpos:box]
- [linecolor=blue,
- linewidth=\linewidth,
- fillcolor=lightgray,
- filloffset=\!!zeropoint]
-
-\startMPpositiongraphic{mpos:box}{fillcolor,linecolor,linewidth}
- initialize_box(\MPpos{\MPvar{self}}) ;
- boxfillcolor := \MPvar{fillcolor} ;
- boxlinecolor := \MPvar{linecolor} ;
- boxlinewidth := \MPvar{linewidth} ;
- boxfilloffset := \MPvar{filloffset} ;
- draw_box ;
- anchor_box(\MPanchor{\MPvar{self}}) ;
-\stopMPpositiongraphic
-
-\setupMPvariables
- [mpos:area]
- [linecolor=blue,
- linewidth=\linewidth,
- fillcolor=lightgray,
- filloffset=\!!zeropoint]
-
-\startMPpositiongraphic{mpos:area}{fillcolor,linecolor,linewidth}
- initialize_area(\MPpos{b:\MPvar{self}},\MPpos{e:\MPvar{self}}) ;
- boxfillcolor := \MPvar{fillcolor} ;
- boxlinecolor := \MPvar{linecolor} ;
- boxlinewidth := \MPvar{linewidth} ;
- boxfilloffset := \MPvar{filloffset} ;
- draw_area ;
- anchor_area(\MPanchor{b:\MPvar{self}}) ;
-\stopMPpositiongraphic
-
-%D This is already cleaned up.
-
-% gridtype = 1 => baseline
-% gridtype = 2 => betweenline
-
-\setupMPvariables
- [mpos:par]
- [mp=mpos:par:shape,
- gridtype=0,
- linetype=1,
- filltype=1,
- %snaptops=true, % not that nice: true/false
- gridcolor=red,
- linecolor=blue,
- fillcolor=lightgray,
- filloffset=\!!zeropoint,
- linewidth=\linewidth,
- gridwidth=\linewidth,
- lineradius=.5\bodyfontsize]
-
-\startuseMPgraphic{mpos:par:shape}
- \iftracepositions show_par \else draw_par \fi ;
-\stopuseMPgraphic
-
-\startuseMPgraphic{mpos:par:setup}
- boxgridtype := \MPvar{gridtype} ;
- boxlinetype := \MPvar{linetype} ;
- boxfilltype := \MPvar{filltype} ;
- boxgridcolor := \MPvar{gridcolor} ;
- boxlinecolor := \MPvar{linecolor} ;
- boxfillcolor := \MPvar{fillcolor} ;
- boxfilloffset := \MPvar{filloffset} ;
- boxlinewidth := \MPvar{linewidth} ;
- boxgridwidth := \MPvar{gridwidth} ;
- boxlineradius := \MPvar{lineradius} ;
- %snap_multi_par_tops := \MPvar{snaptops} ;
-\stopuseMPgraphic
-
-\startuseMPgraphic{mpos:par:extra}
- % user stuff, like:
- % snap_multi_par_tops := false ;
-\stopuseMPgraphic
-
-% \startMPpositionmethod{mpos:par}
-% \doifpositionelse{w:\MPvar{self}}
-% {\startMPpositiongraphic{mpos:par}%
-% {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
-% initialize_area_par(\MPpos{b:\MPvar{self}},
-% \MPpos{e:\MPvar{self}},
-% \MPpos{w:\MPvar{self}}) ;
-% \includeMPgraphic{mpos:par:setup} ;
-% \includeMPgraphic{mpos:par:extra} ;
-% \includeMPgraphic{\MPvar{mp}} ; % \includeMPgraphic{mpos:par:shape} ;
-% anchor_par(\MPanchor{b:\MPvar{self}}) ;
-% \stopMPpositiongraphic}
-% {\startMPpositiongraphic{mpos:par}%
-% {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
-% initialize_par(\MPpos{b:\MPvar{self}},
-% \MPpos{e:\MPvar{self}},
-% \MPpos{text:\realfolio},
-% \MPpos{p:\MPparcounter},
-% \MPvv {p:\MPparcounter}{0,0,0,0,0,0}) ;
-% \includeMPgraphic{mpos:par:setup} ;
-% \includeMPgraphic{mpos:par:extra} ;
-% \includeMPgraphic{\MPvar{mp}} ; % \includeMPgraphic{mpos:par:shape} ;
-% anchor_par(\MPanchor{b:\MPvar{self}}) ;
-% \stopMPpositiongraphic}%
-% \MPpositiongraphic{mpos:par}{}%
-% \stopMPpositionmethod
-
-%D Less readable but shorter.
-
-\ifx\MPparcounter\undefined \newcounter\MPparcounter \fi
-
-\def\MPself {\MPvar{self}}
-\def\MPbself {b:\MPself}
-\def\MPeself {e:\MPself}
-\def\MPwself {w:\MPself}
-\def\MPparanchor{p:\MPparcounter}
-
-\def\MPl#1{\MPplus{#1}20}
-\def\MPr#1{\MPplus{#1}30}
-
-\startMPpositionmethod{mpos:par} %%%%%%%%%%% will become obsolete
- \edef\MPparcounter{\MPv\MPbself{1}{0}}%
- \doifpositionelse\MPwself
- {\startMPpositiongraphic{mpos:par}%
- {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
- initialize_area_par(\MPpos\MPbself,
- \MPpos\MPeself,
- \MPpos\MPwself) ;
- \includeMPgraphic{mpos:par:setup} ;
- \includeMPgraphic{mpos:par:extra} ;
- \includeMPgraphic{\MPvar{mp}} ;
- anchor_par(\MPanchor\MPbself) ;
- \stopMPpositiongraphic}
- {\startMPpositiongraphic{mpos:par}%
- {fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,lineradius}
- initialize_par(\MPpos\MPbself,
- \MPpos\MPeself,
- \MPpos\textanchor,
- \MPpos\MPparanchor,
- \MPvv \MPparanchor{0,0,0,0,0,0}) ;
- \includeMPgraphic{mpos:par:setup} ;
- \includeMPgraphic{mpos:par:extra} ;
- \includeMPgraphic{\MPvar{mp}} ;
- anchor_par(\MPanchor\MPbself) ;
- \stopMPpositiongraphic}%
- \MPpositiongraphic{mpos:par}{}%
-\stopMPpositionmethod
-
-%D The next alternative works in columnsets :
-
-% \iftracepositions show\else draw\fi_multi_pars ;
-
-\startuseMPgraphic{mpos:par:columnset}
- \iftracepositions show_multi_pars \else draw_multi_pars \fi ;
-\stopuseMPgraphic
-
-\startMPpositionmethod{mpos:par:columnset}
- \edef\MPparcounter{\MPv\MPbself{1}{0}}%
- \startMPpositiongraphic{mpos:par}%
- {fillcolor,filloffset,linecolor,gridcolor,%
- linewidth,gridwidth,lineradius}
- \includeMPgraphic{mpos:par:setup} ;
- \includeMPgraphic{mpos:par:extra} ;
- prepare_multi_pars(\MPpos\MPbself,\MPpos\MPeself,\MPpos\MPwself,
- \MPpos\MPparanchor,\MPvv\MPparanchor{0,0,0,0,0,0}) ;
- relocate_multipars(-\MPxy\MPanchorid) ; % inside layerpos
- \includeMPgraphic{\MPvar{mp}} ;
- \stopMPpositiongraphic
- \MPpositiongraphic{mpos:par}{}%
-\stopMPpositionmethod
-
-%D \starttyping
-%D \setupbackground
-%D [test]
-%D [mp=mpos:par:columnset,
-%D methodmethode=mpos:par:columnset]
-%D \stoptyping
-
-%D We need to treat floats in a special way.
-
-\appendtoks
- local_multi_par_area:=\iflocalpositioning true\else false\fi;
-\to \MPinitializations
-
-\def\textbackgroundoverlay#1%
- {\iflocalpositioning\v!local\else\v!text\fi#1}
-
-\newcounter\localpositionnumber
-
-\def\MPanchornumber
- {\iflocalpositioning\localpositionnumber\else\realfolio\fi}
-
-%D So far for the trickery.
-
-\newcounter\textbackgrounddepth
-
-\appendtoks
- \savecurrentvalue\totalnofparbackgrounds\nofparbackgrounds
-\to \everybye
-
-\appendtoks
- \initializeparbackgrounds
-\to \everystarttext
-
-\ifx\totalnofparbackgrounds\undefined \newcounter\totalnofparbackgrounds \fi
-\ifx\nofparbackgrounds \undefined \newcounter\nofparbackgrounds \fi
-
-\def\initializeparbackgrounds
- {\ifcase\totalnofparbackgrounds\else
- \global\positioningtrue
- \global\positioningpartrue
- \fi}
-
-\unexpanded\def\starttextbackground
- {\bgroup
- \increment\textbackgrounddepth
- \dodoubleempty\dostarttextbackground}
-
-\let\dodostarttextbackground\relax
-\let\dodostoptextbackground \relax
-
-% \def\currentparbackground{background:0}
-% \def\nextparbackground {background:1}
-
-\def\currentparbackground{pbg:0}
-\def\nextparbackground {pbg:1}
-
-\def\btbanchor{b:\currentparbackground}
-\def\etbanchor{e:\currentparbackground}
-
-\def\nextbtbanchor{b:\nextparbackground}
-\def\nextetbanchor{e:\nextparbackground}
-
-\def\backgroundvariable#1%
- {\csname\??td\currenttextbackground#1\endcsname}
-
-% \definetextbackground[more][state=start,backgroundcolor=red] % location=paragraph
-% \definetextbackground[test][state=start,backgroundcolor=green]
-%
-% \page \placefigure[left]{}{}
-%
-% \starttextbackground[test]
-% \readfile{ward}{}{}
-% \starttextbackground[more]
-% \readfile{ward}{}{}
-% \stoptextbackground
-% \readfile{ward}{}{}
-% \stoptextbackground
-%
-% \page \placefigure[right]{}{}
-%
-% \starttextbackground[test]
-% \readfile{ward}{}{}
-% \starttextbackground[more]
-% \readfile{ward}{}{}
-% \stoptextbackground
-% \readfile{ward}{}{}
-% \stoptextbackground
-
-\def\dostarttextbackground[#1][#2]%
- {\checktextbackgrounds
- \def\currenttextbackground{#1}%
- \doglobal\increment\nofparbackgrounds
- %\edef\currentparbackground{background:\nofparbackgrounds}%
- \edef\currentparbackground{pbg:\nofparbackgrounds}%
- \bgroup
- \increment\nofparbackgrounds
- %\xdef\nextparbackground{background:\nofparbackgrounds}%
- \xdef\nextparbackground{pbg:\nofparbackgrounds}%
- \egroup
- % todo : \synchonizepositionpage{b:\currentparbackground}{s:\currentparbackground}%
- \setuptextbackground[#1][#2]%
- \let\dodostarttextbackground\relax
- \let\dodostoptextbackground \relax
- \doifvalue{\??td#1\c!state}\v!start
- {\dopresettextbackground{#1}}%
- \dodostarttextbackground}
-
-% todo \backgroundvariable\c!variant
-
-\def\dopresettextbackground#1% todo: \backgroundparameter
- {\ExpandFirstAfter\processaction % \EFA niet echt nodig
- [\getvalue{\??td#1\c!location}]
- [ \v!text=>\let\dodostarttextbackground\dostarttextbackgroundtxt
- \let\dodostoptextbackground \dostoptextbackgroundtxt,
- \v!paragraph=>\let\dodostarttextbackground\dostarttextbackgroundpar
- \let\dodostoptextbackground \dostoptextbackgroundpar,
- \v!none=>\let\dodostarttextbackground\relax
- \let\dodostoptextbackground \relax]%
- \ifx\dodostarttextbackground\dostarttextbackgroundpar % untested
- \ifnum\textbackgrounddepth>\plusone % new
- \let\dodostarttextbackground\dostarttextbackgroundtxt
- \let\dodostoptextbackground \dostoptextbackgroundtxt
- \fi
- \fi
- \doifelsevalue{\??td#1\c!frame}\v!on
- {\doifelsevalue{\??td#1\c!corner}\v!round
- {\setvalue{\??td#1\c!frame}{2}}
- {\setvalue{\??td#1\c!frame}{1}}}
- {\setvalue{\??td#1\c!frame}{0}}%
- \doifelsevalue{\??td#1\c!background}\v!color
- {\setvalue{\??td#1\c!background}{1}}
- {\setvalue{\??td#1\c!background}{0}}%
- %\startpositionoverlay{\v!text\getvalue{\??td#1\c!level}}%
- \startpositionoverlay{\textbackgroundoverlay{\getvalue{\??td#1\c!level}}}%
- \expanded
- {\setMPpositiongraphicrange % moet veel efficienter
- {\btbanchor}% {b:\currentparbackground}%
- {\etbanchor}% {e:\currentparbackground}%
- {\getvalue{\??td#1\c!method}}%
- {self=\currentparbackground,
- mp=\getvalue{\??td#1\c!mp},
- gridtype=\getvalue{\??td#1\c!alternative},
- filltype=\getvalue{\??td#1\c!background},
- linetype=\getvalue{\??td#1\c!frame},
- gridcolor=\getvalue{\??td#1\c!framecolor},
- linecolor=\getvalue{\??td#1\c!framecolor},
- fillcolor=\getvalue{\??td#1\c!backgroundcolor},
- filloffset=\getvalue{\??td#1\c!backgroundoffset},
- gridwidth=\getvalue{\??td#1\c!rulethickness},
- linewidth=\getvalue{\??td#1\c!rulethickness},
- lineradius=\getvalue{\??td#1\c!radius}}}%
- \stoppositionoverlay}
-
-\def\stoptextbackground
- {\dodostoptextbackground
- \carryoverpar\egroup}
-
-\def\starttextbackgroundmanual
- {\dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
- \fpos\currentparbackground\ignorespaces}
-
-\def\stoptextbackgroundmanual
- {\tpos\currentparbackground
- \dostopattributes}
-
-\def\dostarttextbackgroundtxt
- {\ifvmode \leavevmode \fi
- \dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
- \fpos\currentparbackground\ignorespaces}
-
-\def\dostoptextbackgroundtxt
- {\tpos\currentparbackground
- \dostopattributes}
-
-% keep this simple one, it's used in prikkels and alike
-%
-% \def\dostarttextbackgroundpar
-% {\endgraf % new
-% \getvalue{\??td\currenttextbackground\c!before}%
-% \noindent\fpos\currentparbackground\ignorespaces
-% \bgroup
-% \nobreak \vskip-\lineheight \nobreak
-% \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip
-% \kern\scratchskip\nobreak
-% \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!leftoffset}}%
-% \advance\leftskip\leftskipadaption
-% \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!rightoffset}}%
-% \advance\rightskip\leftskipadaption
-% \dostartattributes{\??td\currenttextbackground}\c!style\c!color{}%
-% \nowhitespace
-% \seteffectivehsize
-% \par}
-%
-% \def\dostoptextbackgroundpar
-% {\par
-% \dostopattributes
-% \doassignsomeskip\getvalue{\??td\currenttextbackground\c!bottomoffset}\to\scratchskip
-% \kern\scratchskip\nobreak
-% \nobreak \vskip-\lineheight \nobreak
-% \nowhitespace
-% \egroup
-% \nobreak \noindent \strut \hfill \kern\zeropoint \tpos\currentparbackground
-% \endgraf % new
-% \getvalue{\??td\currenttextbackground\c!after}}
-
-\def\dostarttextbackgroundpar
- {\endgraf % new
- \getvalue{\??td\currenttextbackground\c!before}%
- \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip
- \xdef\textbackgroundskip{\the\scratchskip}%
- \noindent
- \ifgridsnapping
- \ifdim\textbackgroundskip>\zeropoint
- \struttedbox{\hbox{\raise\textbackgroundskip\hbox{\fpos\currentparbackground}}}%
- \else
- \fpos\currentparbackground
- \fi
- \else
- \fpos\currentparbackground
- \fi
- \bgroup
- \endgraf % we need a vertical nobreak - 29/06/2004
- \nobreak \vskip-\lineheight \nobreak
- \doassignsomeskip\getvalue{\??td\currenttextbackground\c!topoffset}\to\scratchskip
- \ifgridsnapping \else \ifdim\textbackgroundskip>\zeropoint
- \kern\textbackgroundskip\nobreak
- \fi \fi
- \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!leftoffset}}%
- \advance\leftskip\leftskipadaption
- \dosetleftskipadaption{\getvalue{\??td\currenttextbackground\c!rightoffset}}%
- \advance\rightskip\leftskipadaption
- % new
- \dosetraggedcommand{\getvalue{\??td\currenttextbackground\c!align}}%
- \raggedcommand
- %
- \dostartattributes{\??td\currenttextbackground}\c!style\c!color\empty
- \nowhitespace
- \seteffectivehsize
- \doinhibitblank % \blank[\v!disable]% new
- \par}
-
-\def\dostoptextbackgroundpar
- {\par
- \removelastskip % new
- \dostopattributes
- \doassignsomeskip\getvalue{\??td\currenttextbackground\c!bottomoffset}\to\scratchskip
- \ifdim\lastskip>\zeropoint
- \advance\scratchskip-\lastskip
- \fi
- \xdef\textbackgroundskip{\the\scratchskip}%
- \ifgridsnapping \else \ifdim\textbackgroundskip>\zeropoint
- \kern\scratchskip\nobreak
- \fi \fi
- \nobreak \vskip-\lineheight \nobreak
- \nowhitespace
- \egroup
-\bgroup \forgeteverypar % NOT REALLY NEEDED, SAVES HASH/MEM
- \nobreak \noindent \strut \hfill \kern\zeropoint
- \ifgridsnapping % experimental, pascal (todo: topoffset in same way)
- \ifdim\textbackgroundskip>\zeropoint
- \struttedbox{\hbox{\lower\textbackgroundskip\hbox{\tpos\currentparbackground}}}%
- \else
- \tpos\currentparbackground
- \fi
- \else
- \tpos\currentparbackground
- \fi
-\egroup
- \endgraf % new
- \getvalue{\??td\currenttextbackground\c!after}}
-
-\let\textparpages \!!zeropoint
-\let\textparheight\!!zeropoint
-\let\textparwidth \!!zeropoint
-
-\def\calculatetextpardimensions
- {\docalculatetextpardimensions\btbanchor \etbanchor \MPparanchor}
-
-\def\calculatenexttextpardimensions
- {\docalculatetextpardimensions\nextbtbanchor\nextetbanchor\relax}
-
-\def\docalculatetextpardimensions#1#2#3%
- {\scratchcounter\MPp#2%\etbanchor
- \advance\scratchcounter-\MPp#1%\btanchor
- \edef\textparpages{\the\scratchcounter}%
- \ifcase\scratchcounter
- % one page
- \scratchdimen \MPy#1%\btanchor
- \advance\scratchdimen-\MPy#2%\etbanchor
- \else
- % two or more pages
- \scratchdimen \MPy#1%\btanchor
- \advance\scratchdimen-\MPy#2%\etbanchor
- \advance\scratchdimen-\MPy\textanchor
- \advance\scratchdimen \MPy\textanchor
- \advance\scratchdimen \MPh\textanchor\relax
- \ifcase\scratchcounter>2 \ifnum\scratchcounter<5
- % more pages
- \scratchdimen\textheight
- \advance\scratchcounter \minusone
- \multiply\scratchdimen \scratchcounter
- \else
- % keep'm small
- \scratchdimen5\textheight
- \fi \fi
- \fi
- \edef\textparheight{\the\scratchdimen}%
- \ifcase\scratchcounter
- % one page
- \scratchdimen \MPx#2%\etbanchor
- \advance\scratchdimen-\MPx#1%\btanchor
- \else
- % two or more pages / maybe also hang
- \ifx#3\relax
- \scratchdimen\makeupwidth % \textwidth
- \else
- \scratchdimen\MPw\MPparanchor
- \advance\scratchdimen-\MPl\MPparanchor
- \advance\scratchdimen-\MPr\MPparanchor
- \fi
- \fi
- \edef\textparwidth{\the\scratchdimen}}
-
-\def\mintextparheight{4\lineheight}
-
-\def\dontsplitnexttextbackground % dangerous but useful
- {\ifdim\pagetotal>\textheight \else
- \ifdim\pagegoal=\maxdimen \else
- \calculatenexttextpardimensions
- % too tricky
- % \scratchdimen=\textparheight
- % \advance\scratchdimen\pagetotal\relax
- % \ifdim\scratchdimen>\pagegoal
- % \page
- % \fi
- \ifdim\textparheight>\zeropoint
- \ifdim\textparheight>\mintextparheight\else
- \page % option
- \fi
- \fi
- \fi
- \fi}
-
-\def\definetextbackground
- {\dodoubleempty\dodefinetextbackground}
-
-\def\dodefinetextbackground[#1][#2]%
- {\ifsecondargument % why ?
- \copyparameters[\??td#1][\??td]
- [\c!state,\c!location,\c!alternative,\c!mp,\c!method,
- \c!background,\c!backgroundcolor,\c!corner,\c!level,
- \c!backgroundoffset,\c!before,\c!after,\c!align,
- \c!radius,\c!frame,\c!framecolor,\c!rulethickness,
- \c!leftoffset,\c!rightoffset,\c!topoffset,\c!bottomoffset]%
- \getparameters[\??td#1][#2]%
- \doifvalue{\??td#1\c!state}\v!start\checktextbackgrounds
- \unexpanded\setvalue{#1}%
- {\groupedcommand{\starttextbackground[#1]}{\stoptextbackground}}%
- \setvalue{\e!start#1}{\starttextbackground[#1]}%
- \setvalue{\e!stop #1}{\stoptextbackground}%
- \fi}
-
-\def\setuptextbackground
- {\dodoubleargument\dosetuptextbackground}
-
-\def\dosetuptextbackground[#1][#2]%
- {\ifsecondargument
- \doifelsenothing{#1}
- {\dodosetuptextbackground{#2}\empty}
- {\processcommalist[#1]{\dodosetuptextbackground{#2}}}%
- \else
- \dodosetuptextbackground{#1}\empty
- \fi}
-
-\def\dodosetuptextbackground#1#2%
- {\getparameters[\??td#2][#1]%
- \def\currenttextbackground{#2}%
- \doifvalue{\??td#2\c!state}\v!start\checktextbackgrounds}
-
-\let\currenttextbackground\empty
-
-\def\checktextbackgrounds
- {\ifproductionrun
- \enabletextarearegistration
- \enablehiddenbackground
- \fi}
-
-\setuptextbackground
- [\c!mp=mpos:par:columnset, % buggy: mpos:par:shape
- \c!method=mpos:par:columnset, %
- \c!state=\v!start,
- \c!location=\v!text,
- \c!leftoffset=\!!zeropoint, % 1em,
- \c!rightoffset=\getvalue{\??td\currenttextbackground\c!leftoffset},
- \c!topoffset=\!!zeropoint, % \v!medium,
- \c!bottomoffset=\getvalue{\??td\currenttextbackground\c!topoffset},
- \c!level=-1,
- \c!alternative=0,
- \c!align=,
- \c!background=\v!color,
- \c!backgroundcolor=lightgray,
- \c!backgroundoffset=\!!zeropoint,
- \c!corner=\v!rectangular,
- \c!radius=.5\bodyfontsize,
- \c!frame=\v!on,
- \c!framecolor=blue,
- \c!rulethickness=\linewidth]
-
-%D As an example we define a grid background:
-
-\definetextbackground
- [\v!grid]
- [\c!state=\v!stop,
- \c!location=\v!paragraph,
- \c!frame=\v!off,
- \c!framecolor=red,
- \c!background=,
- \c!alternative=1]
-
-\ifx\basegrid\undefined \else \letvalue\v!grid=\basegrid \fi
-
-% lelijk, aanpassen, opties
-
-\setupMPvariables
- [mpos:connect]
- [linecolor=red,
- linewidth=1pt]
-
-\setupMPvariables
- [mpos:encircle]
- [fillcolor=lightgray,
- filloffset=\!!zeropoint,
- linecolor=blue,
- linewidth=1pt]
-
-\startuseMPgraphic{mpos:common:ec}
- path pa ; pair ca ; color lc ; numeric lw ;
- lw := \MPvar{linewidth} ;
- lc := \MPvar{linecolor} ;
- initialize_box(\MPpos{\MPvar{self}}) ;
- pa := pxy ; ca := cxy ; pa := boundingbox pa enlarged 2lw ;
- pa := llcorner pa...lrcorner pa...urcorner pa...ulcorner pa...cycle ;
- drawoptions (withpen pencircle scaled lw withcolor lc) ;
-\stopuseMPgraphic
-
-\startMPpositiongraphic{mpos:encircle}{linecolor,fillcolor,linewidth}
- \includeMPgraphic{mpos:common:ec}
- fill pa withcolor \MPvar{fillcolor} ; draw pa ;
- anchor_box(\MPanchor{\MPvar{self}}) ;
-\stopMPpositiongraphic
-
-\startMPpositiongraphic{mpos:connect}{linecolor,linewidth}
- path pb, pc ; pair cb, cc ;
- \includeMPgraphic{mpos:common:ec}
- initialize_box(\MPpos{\MPvar{to}}) ;
- pb := pxy ; cb := cxy ; pb := boundingbox pb enlarged 2lw ;
- pb := llcorner pb...lrcorner pb...urcorner pb...ulcorner pb...cycle ;
- pc := ca {up} .. {down} cb ;
- cc := (pc intersection_point pa) ;
- if intersection_found :
- pc := pc cutbefore cc ;
- cc := (pc intersection_point pb) ;
- if intersection_found :
- pc := pc cutafter cc ;
- drawarrow pc ; drawarrow reverse pc ;
- fi ;
- fi ;
- anchor_box(\MPanchor{\MPvar{self}}) ;
-\stopMPpositiongraphic
-
-%D \macros
-%D {stackposdown, stackposup, stackposleft,stackposright}
-%D
-%D A non graphic example of the use of positioning, is to stack
-%D text in for instance the margin.
-%D
-%D \stackposdown \inleft {some text}The text \type {some text}
-%D goes into the left margin, and \stackposdown \inleft {some
-%D more}\type {some more} as well. When they overlap, they
-%D will not touch.
-%D
-%D Here we said \type {\stackposdown \inleft{some text}}. Instead
-%D of \stackposleft \inleft {one}stacking \stackposleft \inleft
-%D {two}vertically, one can stack horizontally by \stackposleft
-%D \inleft {three}using \type {\stackposleft}.
-%D
-%D We can go in all four directions, using \type {\stackposdown},
-%D \type {\stackposup}, \type {\stackposleft} and \type
-%D {\stackposright}.
-
-\def\stackposdistance{.5em}
-
-\newcounter\currentautopos
-
-\def\POSstackprefix{stack:}
-
-\def\dostackposbox#1#2%
- {\dowithnextbox
- {#2{\let\previousautopos\currentautopos
- \doglobal\increment\currentautopos
- \hpos{\POSstackprefix\currentautopos}
- {\doifoverlappingelse{\POSstackprefix\currentautopos}{\POSstackprefix\previousautopos}
- {#1}
- {\flushnextbox}}}}%
- \hbox}
-
-\def\stackposup {\dostackposbox{\raise\lineheight\flushnextbox}}
-\def\stackposdown {\dostackposbox{\lower\lineheight\flushnextbox}}
-\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\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi
-% {\lower\scratchdimen\flushnextbox}%
-% \next
-% % \fi
-% \flushnextbox}}}
-
-% Because there can be many stacked items in a line and successive lines, we
-% play dirty and adapt the position and height of the current node so that
-% this becomes visible to a next pass.
-%
-% \startbuffer
-% \inleft {test 1} test 1 \inleft {test 2} test 2 \endgraf
-% \inleft {test 3} test 3
-% \stopbuffer
-% \getbuffer \typebuffer \flushstatus \page
-%
-% \startbuffer
-% \inleft {test 1} test 1 \inleft {test 2} test 2 \inleft {test 3} test 3 \endgraf
-% \inleft {test 4} test 4
-% \stopbuffer
-% \getbuffer \typebuffer \flushstatus \page
-%
-% \startbuffer
-% \inleft {test 1} test 1 \endgraf
-% \inleft {test 2} test 2 \endgraf
-% \inleft {test 3} test 3
-% \stopbuffer
-% \getbuffer \typebuffer \flushstatus \page
-%
-% \startbuffer
-% \inleft {test 1\\test 1} test 1 \inleft {test 2} test 2 \endgraf
-% \inleft {test 3} test 3
-% \stopbuffer
-% \getbuffer \typebuffer \flushstatus \page
-%
-% \startbuffer
-% \inleft {test 1\\test 1\\test 1\\test 1\\test 1} test 1 \endgraf
-% test 2 \endgraf
-% \inleft {test 3} test 3
-% \stopbuffer
-% \getbuffer \typebuffer \flushstatus \page
-%
-% \startbuffer
-% \inleft{test 1} test \inleft{test 2} test \inleft{test 3\\test 3} test
-% \stopbuffer
-% \getbuffer \typebuffer \flushstatus \page
-%
-% \startbuffer
-% \inleft{test 1\\test 1\\test 1} test \inleft{test 2\\test 2} test \inleft{test 3\\test 3\\test 3} test \endgraf
-% \inleft{test 1\\test 1\\test 1} test \inleft{test 2\\test 2} test \inleft{test 3\\test 3\\test 3} test
-% \stopbuffer
-% \getbuffer \typebuffer \flushstatus \page
-
-\newdimen\laststackvmove
-
-\def\stackeddown
- {\bgroup
- % this macro assumes a few things and is meant to work for margin notes
- \dowithnextbox
- {\doglobal\increment\currentautopos
- \global\laststackvmove\zeropoint
- \hpos{\POSstackprefix\currentautopos}
- {\edef\next
- {\nextboxht\the\nextboxht
- \nextboxdp\the\nextboxdp
- \nextboxwd\the\nextboxwd}%
- \let\previousautopos\currentautopos
- \scratchdimen\zeropoint
- \scratchcounter\zerocount
- \doloop
- {\decrement\previousautopos\relax
- \edef\currentposition {\POSstackprefix\currentautopos}%
- \edef\previousposition{\POSstackprefix\previousautopos}%
- \ifnum\MPp\currentposition=\MPp\previousposition\relax
- %\registerstatus{doing \currentautopos/\previousautopos}%
- \doifoverlappingelse\currentposition\previousposition
- {\scratchskip \MPy\currentposition
- \advance\scratchskip-\MPy\previousposition
- \advance\scratchskip-\MPd\currentposition % untested
- \advance\scratchskip \MPd\previousposition % untested
- \advance\scratchskip \MPh\currentposition
- % todo: also take depth into account
- \relax
- \ifdim\scratchskip<\scratchdimen
- %\registerstatus{no \the\scratchskip}%
- \else
- %\registerstatus{yes \the\scratchskip}%
- \scratchdimen\scratchskip
- \fi}%
- \donothing % {\registerstatus{next}}%
- \ifnum\previousautopos<\zerocount\exitloop\fi
- \else
- \exitloop
- \fi}%
- \ifdim\scratchdimen=\zeropoint \else
- \bgroup
- \edef\currentposition{\POSstackprefix\currentautopos}%
- \scratchskip\scratchdimen
- \advance\scratchskip\MPh\currentposition
- \scratchdimen-\scratchdimen
- \advance\scratchdimen\MPy\currentposition
- %\registerstatus{old \currentautopos: \MPy\currentposition/\MPh\currentposition}%
- \expanded{\replacepospxywhd
- {\currentposition}{\MPp\currentposition}{\MPx\currentposition}{\the\scratchdimen}%
- {\MPw\currentposition}{\the\scratchskip}{\MPd\currentposition}}%
- %\registerstatus{new \currentautopos: \MPy\currentposition/\MPh\currentposition}%
- \egroup
- \global\laststackvmove\scratchdimen % new
- \setbox\nextbox\iftracepositions\@EA\ruledhbox\else\@EA\hbox\fi
- {\lower\scratchdimen\flushnextbox}%
- \next
- %\registerstatus{\strut}%
- \fi
- \flushnextbox}%
- \egroup}}
-
-%D The next hack make sure that margin texts near faulty
-%D strutted lines are handled ok.
-
-\newif\ifrepositionmarginbox % \repositionmarginboxtrue
-
-\newcounter\currentmarginpos
-
-% \def\dopositionmarginbox#1%
-% {\bgroup
-% \ifrepositionmarginbox
-% \doglobal\increment\currentmarginpos
-% \setposition{\s!margin:\currentmarginpos}%
-% \scratchdimen=\MPy{\s!margin:\currentmarginpos}%
-% \doglobal\increment\currentmarginpos
-% \advance\scratchdimen by -\MPy{\s!margin:\currentmarginpos}%
-% \advance\scratchdimen by -\strutdp
-% \setbox#1=\hbox
-% {\setposition{\s!margin:\currentmarginpos}\raise\scratchdimen\box#1}%
-% \dp#1=\!!zeropoint
-% \ht#1=\!!zeropoint
-% \fi
-% \vadjust{\box#1}%
-% \egroup}
-
-\def\dopositionmarginbox#1% how about page boundaries !
- {\bgroup
- \ifrepositionmarginbox
- \doglobal\increment\currentmarginpos
- \setposition{\s!margin:\currentmarginpos}%
- \scratchdimen\MPy{\s!margin:\currentmarginpos}%
- \doglobal\increment\currentmarginpos
- \advance\scratchdimen -\MPy{\s!margin:\currentmarginpos}%
- \advance\scratchdimen -\strutdp
- % new
- \setbox#1\hbox
- {\hskip-\MPx{\s!margin:\currentmarginpos}%
- \hskip\MPx{head:\realfolio}%
- \box#1}%
- % so far
- \setbox#1\hbox
- {\setposition{\s!margin:\currentmarginpos}%
- \raise\scratchdimen\box#1}%
- \dp#1\zeropoint
- \ht#1\zeropoint
- \fi
- \graphicvadjust{\box#1}%
- \egroup}
-
-%D For a right menu, a sequence of calls to \type
-%D {right_menu_button} is generated.
-%D
-%D \starttyping
-%D right_menu_button (n, p, s=0/1/2, x, y, w, h, d) ;
-%D \stoptyping
-%D
-%D Here, n is the number of the button, s a status variable,
-%D while the rest is positional info. The status variable is
-%D 0, 1 or~2: not found, found and found but current page.
-
-% 0=not found 1=found 2=current page
-
-% geen leeg
-
-\newtoks\MPmenutoks
-
-\def\MPmenubuttons#1{\the\MPmenutoks}
-
-\appendtoks \global\MPmenutoks\emptytoks \to \everyshipout
-
-% 0=notfound 1=found 2=currentpage
-
-\def\do@@amposition#1#2#3%
- {\doifelsevalue{\??am#1\c!position}\v!yes
- {\doglobal\increment\currentamposition
- \doifnumberelse{#2}
- {\docheckrealreferencepage{#2}%
- \global\chardef\currentamrealpage\ifrealreferencepage2\else1\fi}
- {\doifreferencefoundelse{#2}
- {\global\chardef\currentamrealpage\ifrealreferencepage2\else1\fi}
- {\global\chardef\currentamrealpage0}}% % not found
- \expanded
- {\doglobal\noexpand\appendtoks
- #1_menu_button(\currentamposition,\the\currentamrealpage,\noexpand\MPpos{#1:\currentamposition}) ;
- \to \MPmenutoks}%
- \hpos{#1:\currentamposition}{#3}}
- {#3}}
-
-\def\do@@ammenuposition#1%
- {\ifnum\currentamposition>0
- \dowithnextbox{\hpos{menu:#1:\realfolio}{\flushnextbox}}\hbox
- \fi}
-
-%D \macros
-%D {GFC, GTC, GSC}
-%D
-%D The next macros extend tables and tabulation with
-%D backgrounds and position related features. Areas are
-%D specified with symbolic names, and symbolic references to
-%D the graphics involved. Each table has its own namespace.
-
-\newcounter\noftabpositions
-\newtoks \posXCtoks
-
-\def\tbPOSprefix
- {tbp:\noftabpositions:}
-
-\def\tablepos
- {\scratchtoks\posXCtoks
- \global\posXCtoks\emptytoks
- \the\scratchtoks}
-
-\let\tabulatepos\tablepos
-
-\def\dodododoGSC[#1:#2]%
- {\remappositionframed{#2}{\tbPOSprefix#1}%
- \bpos{\tbPOSprefix#1}%
- \doglobal\appendtoks\@EA\epos\@EA{\tbPOSprefix#1}\to\posXCtoks}
-
-\def\dododoGSC[#1:#2:#3]%
- {\doglobal\appendtoks\dodododoGSC[#1:#2]\to\posXCtoks\NC}
-
-\def\dodoGSC[#1]%
- {\def\docommando##1{\dododoGSC[##1:##1]}%
- \processcommalist[#1]\docommando}
-
-\def\dodododoGFC[#1:#2:#3]%
- {\remappositionframed{#2}{\tbPOSprefix#1}%
- \bpos{\tbPOSprefix#1}}
-
-\def\dododoGFC[#1]%
- {\def\docommando##1{\dodododoGFC[##1:##1]}%
- \processcommalist[#1]\docommando}
-
-\def\dodoGFC[#1]%
- {\doglobal\appendtoks\dododoGFC[#1]\to\posXCtoks\NC}
-
-\def\dododododoGTC[#1:#2]%
- {\epos{\tbPOSprefix#1}}
-
-\def\dodododoGTC[#1]%
- {\def\docommando##1{\dododododoGTC[##1:##1]}%
- \processcommalist[#1]\docommando}
-
-\def\dododoGTC[#1]%
- {\doglobal\appendtoks\dodododoGTC[#1]\to\posXCtoks}
-
-\def\dodoGTC[#1]%
- {\doglobal\appendtoks\dododoGTC[#1]\to\posXCtoks\NC}
-
-\def\dodododoXC[#1#2]%
- {\if#1>\dodoGFC [#2:#2]\else
- \if#1+\dodoGFC [#2:#2]\else
- \if#1<\dodoGTC [#2:#2]\else
- \if#1-\dodoGTC [#2:#2]\else
- \if#1=\dodoGSC [#2:#2]\else
- \dodoGSC[#1#2:#1#2]\fi\fi\fi\fi\fi}
-
-\def\dododoXC#1%
- {\dodododoXC[#1]}
-
-\def\dodoXC[#1]%
- {{\let\NC\relax\processcommalist[#1]\dododoXC}}
-
-\def\doGSC[#1]{\iffirstargument\dodoGSC[#1]\else\expandafter\NC\fi}
-\def\doGFC[#1]{\iffirstargument\dodoGFC[#1]\else\expandafter\NC\fi}
-\def\doGTC[#1]{\iffirstargument\dodoGTC[#1]\else\expandafter\NC\fi}
-\def\doXC [#1]{\iffirstargument\dodoXC [#1]\else\expandafter\fi\NC}
-
-\def\tbGSC{\dosingleempty\doGSC}
-\def\tbGFC{\dosingleempty\doGFC}
-\def\tbGTC{\dosingleempty\doGTC}
-\def\tbXC {\dosingleempty\doXC }
-
-%D The amount of code to support tables and tabulation is
-%D rather minimalistic.
-
-\let\tabulatepos\tablepos
-
-\def\tabulatenormalpos
- {\hss\tabulatepos\hss}
-
-\def\tabulateequalpos
- {\setbox\scratchbox\hbox{\tabulateEQ}%
- \hbox to \wd\scratchbox{\hss\kern\zeropoint\tabulatepos\hss}%
- \hskip-\wd\scratchbox
- \box\scratchbox}
-
-\def\tabulatenormalcolumn#1% overloaded
- {&\iftabulateequal\tabulateequalpos\else\tabulatenormalpos\fi
- &\global\chardef\tabulatetype#1&}
-
-\def\tabulateequalcolumn#1% overloaded
- {&\tabulateequalpos
- &\global\chardef\tabulatetype#1&}
-
-\appendtoks
- \doglobal\increment\noftabpositions
-\to \everytabulate
-
-%D In order to prevent potential clashes with abbreviations,
-%D postpone the mapping.
-
-\appendtoks
- \let\GSC\tbGSC \let\GFC\tbGFC \let\GTC\tbGTC \let\XC\tbXC
-\to \everytabulate
-
-%D \macros
-%D {definepositionframed}
-%D
-%D The next example show how to provide backgrounds to table
-%D cells. First we define some framed backgrounds.
-%D
-%D \startbuffer
-%D \definepositionframed[x][background=color,backgroundcolor=red]
-%D \definepositionframed[y][background=color,backgroundcolor=green]
-%D \definepositionframed[z][background=color,backgroundcolor=blue]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D % \getbuffer
-%D
-%D \startbuffer
-%D \starttabulate[|c|c|c|]
-%D \GFC[f:x] this is a small \NC table \NC in which we \NC \FR
-%D \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR
-%D \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D The table itself defines three areas (a, b and~c) using
-%D these frames.
-%D
-%D \typebuffer
-%D % \getbuffer
-%D
-%D Tables (based on \TABLE) are supported by:
-
-\def\normalTABLEsimplebar {\unskip\!ttRightGlue&\tablepos&} % |
-\def\normalTABLEcomplexbar{\unskip\!ttRightGlue&\omit\tablepos\!ttAlternateVrule} % \|
-\def\normalTABLEquote {\unskip\!ttRightGlue&\omit\tablepos&} % "
-
-\appendtoks
- \doglobal\increment\noftabpositions
-\to \everytable
-
-%D Since we don't want nameclashes:
-
-\appendtoks
- \let\GSC\tbGSC \let\GFC\tbGFC \let\GTC\tbGTC \let\XC\tbXC
-\to \everytable
-
-%D In the previous example, we could have provided an overlay to
-%D the framed definition. A more direct approach is demonstrated
-%D below:
-%D
-%D \startbuffer
-%D \def\cw#1{\color[white]{#1}}
-%D
-%D \startMPpositiongraphic{tableshade}
-%D initialize_area(\MPpos{\MPvar{from}},\MPpos{\MPvar{to}}) ;
-%D color c ; c := \MPvar{color} ;
-%D linear_shade(pxy,0,.4c,.9c) ;
-%D anchor_area(\MPanchor{\MPvar{from}}) ;
-%D \stopMPpositiongraphic
-%D
-%D \setMPpositiongraphic{b:x}{tableshade}{from=b:x,to=e:x,color=red}
-%D \setMPpositiongraphic{b:y}{tableshade}{from=b:y,to=e:y,color=green}
-%D \setMPpositiongraphic{b:z}{tableshade}{from=b:z,to=e:z,color=blue}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D The definition of the table looks about the same as the
-%D previous one:
-%D
-%D \startbuffer
-%D \starttable[|c|c|c|]
-%D \GFC[b:z] \cw{this is a small} \NC \cw{table} \NC in which we \NC \FR
-%D \NC \cw{will demonstrate} \GFC[c:y] \cw{that this} \GTC[c] \cw{positioning} \NC \MR
-%D \GSC[a:x] \cw{mechanism also} \GTC[b] \cw{works quite well} \NC in tables \NC \LR
-%D \stoptable
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-
-% \definepositionframed[w][background=color,backgroundcolor=yellow]
-% \definepositionframed[x][background=color,backgroundcolor=red]
-% \definepositionframed[y][background=color,backgroundcolor=green]
-% \definepositionframed[z][background=color,backgroundcolor=blue]
-%
-% \starttabulate[|c|c|c|]
-% \NC this is a small \NC table \NC in which we \NC \FR
-% \NC will demonstrate \NC that this \NC positioning \NC \MR
-% \NC mechanism also \NC works quite well \NC in tables \NC \LR
-% \stoptabulate
-%
-% \starttabulate[|c|c|c|]
-% \GFC[f:x] this is a small \GTC table \NC in which we \NC \FR
-% \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR
-% \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR
-% \stoptabulate
-%
-% \starttabulate[|c|c|c|]
-% \GFC[f:x,d:w] this is a small \GTC[d] table \NC in which we \NC \FR
-% \NC will demonstrate \GFC[g:z] that this \GTC[g] positioning \NC \MR
-% \GSC[e:y] mechanism also \GTC[f] works quite well \NC in tables \NC \LR
-% \stoptabulate
-%
-% \starttabulate[|c|c|c|]
-% \XC[+f:x] this is a small \XC table \NC in which we \NC \FR
-% \NC will demonstrate \XC[+g:z] that this \XC[-g] positioning \NC \MR
-% \XC[=e:y] mechanism also \XC[-f] works quite well \NC in tables \NC \LR
-% \stoptabulate
-%
-% \starttabulate[|c|c|c|]
-% \XC[+f:x,+d:w] this is a small \XC[-d] table \NC in which we \NC \FR
-% \NC will demonstrate \XC[+g:z] that this \XC[-g] positioning \NC \MR
-% \XC[=e:y] mechanism also \XC[-f] works quite well \NC in tables \NC \LR
-% \stoptabulate
-
-% evt [b:x]
-%
-% \definepositionframed[x][background=color,fillcolor=red]
-% \definepositionframed[y][background=color,fillcolor=green]
-% \definepositionframed[z][background=color,fillcolor=blue]
-
-\def\remappositionframed#1#2% from to
- {\copyposition{b:#1}{b:#2}%
- \copyposition{e:#1}{e:#2}%
- \dosetpositionaction{b:#2}{\dopositionaction{b:#1}}}
-
-\def\definepositionframed
- {\dodoubleargument\dodefinepositionframed}
-
-\def\dodefinepositionframed[#1][#2]%
- {\dosetpositionaction{b:#1}{\dopositionframed[#1][#2]}}
-
-\def\positionframed
- {\dodoubleempty\dopositionframed}
-
-\def\dopositionframed[#1][#2]%
- {\bgroup
- \setbox\scratchbox\hbox
- {\dimen0=\MPx{e:#1}%
- \advance\dimen0 -\MPx{b:#1}%
- \dimen2=\MPy{b:#1}%
- \advance\dimen2 -\MPy{e:#1}%
- \advance\dimen2 \MPd{e:#1}%
- \lower\dimen2\hbox
- {\advance\dimen2 \MPh{b:#1}%
- \framed
- [\c!width=\dimen0,\c!height=\dimen2,
- \c!offset=\v!overlay,#2]{}}}%
- \smashedbox\scratchbox
- \egroup}
-
-% \def\sethdistances#1%
-% {\hbox{\lpos{ml:#1}\hpos{mh:#1}{\strut}\rpos{mr:#1}}}
-%
-% \def\gethdistances#1%
-% {\scratchdimen\MPx{mh:#1}%
-% \advance\scratchdimen -\MPx{ml#1}%
-% \edef\lefthdistance{\the\scratchdimen}%
-% \scratchdimen\MPx{mr:#1}%
-% \advance\scratchdimen -\MPx{mh:#1}%
-% \edef\righthdistance{\the\scratchdimen}}
-
\protect \endinput
-
-% todo 1: shift down option
-
-\startuseMPgraphic{mpos:par:columnset}
- \iftracepositions show_multi_pars \else draw_multi_pars \fi ;
- path p ; p := boundingbox currentpicture ;
- currentpicture := currentpicture shifted (0,-StrutDepth/2) ;
- setbounds currentpicture to p ;
-\stopuseMPgraphic
-
-\setupcolors[state=start]
-
-\definetextbackground[underline][location=text,alternative=1,background=,frame=off,distance=2pt]
-
-\definestartstop
- [underline]
- [before={\starttextbackground[underline]},
- after=\stoptextbackground]
diff --git a/Master/texmf-dist/tex/context/base/core-ref.tex b/Master/texmf-dist/tex/context/base/core-ref.tex
index fc5acc2f028..4a0c1a3ce12 100644
--- a/Master/texmf-dist/tex/context/base/core-ref.tex
+++ b/Master/texmf-dist/tex/context/base/core-ref.tex
@@ -93,14 +93,14 @@
3: riferimento di tipo sconosciuto --
4: riferimento illecito --
21: documento -- caricato
- 22: il documento -- non interattivo
+ 22: il documento -- non ø interattivo
23: riferimento ambiguo -- (prefisso=--)
\stopmessages
\startmessages norwegian library: references
title: referanser
1: ukjent referanse --
- 2: duplikat referanse -- p side --
+ 2: duplikat referanse -- pø side --
3: ukjent referansetype --
4: ulovlig referanse --
21: dokument -- er lest inn
@@ -119,6 +119,17 @@
23: referinta obscura -- (prefix=--)
\stopmessages
+\startmessages french library: references
+ title: réferences
+ 1: réference -- inconnue
+ 2: réference -- dupliquée à la page --
+ 3: type -- de réference inconnu
+ 4: réference -- inconnue
+ 21: document -- chargé
+ 22: le document -- n'est pas interactif
+ 23: reference -- indéterminé (préfixe=--)
+\stopmessages
+
%D This module deals with referencing. In \CONTEXT\ referencing
%D is one of the core features, although at a first glance
%D probably nobody will notice. This is good, because
@@ -187,8 +198,9 @@
\the\everyreference
\makesectionformat
\writereference{#2}
- {\sectionformat\sectionseparator\sectionseparator\noexpand\pagenumber}
- {\noexpand\realfolio}{#3}%
+ {\sectionformat\sectionseparator\sectionseparator\noexpand\pagenumber}%
+ {\noexpand\realfolio}%
+ {#3}%
\egroup}
\def\rawpagereference#1#2%
@@ -196,15 +208,18 @@
\the\everyreference
\makesectionformat
\writereference{#2}
- {\sectionformat\sectionseparator\sectionseparator\noexpand\pagenumber}
- {\noexpand\realfolio}{}%
+ {\sectionformat\sectionseparator\sectionseparator\noexpand\pagenumber}%
+ {\noexpand\realfolio}%
+ {}%
\egroup}
\def\rawtextreference#1#2#3%
{\bgroup
\the\everyreference
\writereference{#2}
- {}{\noexpand\realfolio}{#3}%
+ {}%
+ {\noexpand\realfolio}%
+ {#3}%
\egroup}
@@ -604,10 +619,47 @@
\def\currentfolioreference{0}
+% \def\dogetreferenceelements#1#2#3#4#5%
+% {\chardef\currentreferencetype=\ifx#1\relax0\else#1\fi\relax
+% \ifnum\currentreferencetype<2
+% \edef\currentpagereference{#2}%
+% \ifx\currentpagereference \empty
+% \let\currentfolioreference\folio
+% \else
+% \def \currentpagereference {\referencepagenumber[#2]}%
+% \edef\currentfolioreference{\dosplitofffoliopart[#2]}%
+% \fi
+% \edef\currentrealreference{#3}%
+% \settextreferences#4\end
+% \ifnum0#5<\crossreferencenumber
+% \forwardreferencetrue
+% \else
+% \forwardreferencefalse
+% \fi
+% \else
+% \edef\currentrealreference {#3}%
+% \def \currentdatareference {#2}%
+% \let \currentfolioreference\folio
+% \settextreferences#4\end
+% \forwardreferencefalse
+% \fi
+% \ifodd\currentreferencetype
+% \realreferencepagefalse
+% \else
+% \docheckrealreferencepage\currentrealreference
+% \ifrealreferencepage \else
+% \docheckrealreferencepage\currentdatareference
+% \fi
+% \fi}
+
+\let\currentlocationreference\empty
+
\def\dogetreferenceelements#1#2#3#4#5%
{\chardef\currentreferencetype=\ifx#1\relax0\else#1\fi\relax
- \ifnum\currentreferencetype<2
+ \ifnum\currentreferencetype<\plustwo
\edef\currentpagereference{#2}%
+ \let \currentdatareference\empty
+ \edef\currentlocationreference{#2}%
\ifx\currentpagereference \empty
\let\currentfolioreference\folio
\else
@@ -622,6 +674,7 @@
\forwardreferencefalse
\fi
\else
+ \let \currentlocationreference\empty
\edef\currentrealreference {#3}%
\def \currentdatareference {#2}%
\let \currentfolioreference\folio
@@ -713,22 +766,41 @@
\def\rt!crossdone#1#2#3#4{\rt!done{#1}{#2}{#3}{#4}}
+% \def\dohandleduplicatereference#1%
+% {\bgroup
+% \let\rt!cross\rt!crossdone
+% \@EA\xdef\csname\r!cross\referenceprefix#1\endcsname
+% {\csname\r!cross\referenceprefix#1\endcsname}%
+% \egroup}
+
\def\dohandleduplicatereference#1%
{\bgroup
\let\rt!cross\rt!crossdone
- \@EA\xdef\csname\r!cross\referenceprefix#1\endcsname
+ \@EA\xdef\csname\r!cross\referenceprefix#1\endcsname % no let !
{\csname\r!cross\referenceprefix#1\endcsname}%
\egroup}
-\def\checkfirstreferenceoccurance#1#2%
- {\ifcsname\r!cross\referenceprefix#1\endcsname
+% \def\checkfirstreferenceoccurance#1#2% etex
+% {\ifcsname\r!cross\referenceprefix#1\endcsname
+% \getreferenceelements{#1}%
+% \ifnum\currentreferencetype=\rt!cross
+% \dohandleduplicatereference{#1}%
+% #2%
+% \fi
+% \else
+% #2%
+% \fi}
+
+\def\checkfirstreferenceoccurance#1#2% etex
+ {\@EA\ifx\csname\r!cross\referenceprefix#1\endcsname\relax % no ifcsname needed here
+ \predefinereference{#1}%
+ #2%
+ \else
\getreferenceelements{#1}%
\ifnum\currentreferencetype=\rt!cross
\dohandleduplicatereference{#1}%
#2%
\fi
- \else
- #2%
\fi}
\def\doiffirstreferenceoccurance
@@ -1339,7 +1411,7 @@
% \egroup
% \doresetgotowhereever} % to prevent problems with direct goto's
-\def\doifreferencefoundelse#1#2#3% REF \cs
+\def\doifreferencefoundelse#1#2#3% REF \cs / never more than one group (else \aftergroup usage problems)
{\checkreferences
% first we collect the secondary ones
\bgroup
@@ -1666,6 +1738,24 @@
%D An unknown reference is reported on the screen, in the log
%D file and, when enabled, in the left margin of the text.
+% \def\reportreferenceerror#1#2%
+% {\bgroup
+% \the\everyreference % cleanup : etc in french
+% \ifinpagebody\else
+% \doifconcepttracing
+% {\doifsomething{#2}
+% {\inleft
+% {\infofont
+% \scratchdimen\leftmarginwidth
+% \advance\scratchdimen -2em
+% \doboundtext{#2}\scratchdimen{..}->}}}%
+% \fi
+% \doifpredefinedreferenceelse
+% \donothing
+% {\predefinereference
+% \showmessage\m!references{#1}{[\unharmedreferenceprefix][#2]}}%
+% \egroup}
+
\def\reportreferenceerror#1#2%
{\bgroup
\the\everyreference % cleanup : etc in french
@@ -1680,7 +1770,7 @@
\fi
\doifpredefinedreferenceelse
\donothing
- {\predefinereference
+ {\predefinereference\predefinedreference
\showmessage\m!references{#1}{[\unharmedreferenceprefix][#2]}}%
\egroup}
@@ -1708,11 +1798,20 @@
% {\setgvalue{\r!cross\predefinedreference}{\rt!cross{}{}{}{}}%
% \setgvalue{\r!cross\unharmedreferenceprefix\predefinedreference}{\rt!cross{}{}{}{}}}
-\def\dummypredefinedreference{\r!cross{}{}{}{}}
+% \def\dummypredefinedreference{\r!cross{}{}{}{}}
+%
+% \def\predefinereference
+% {\global\@EA\let\csname\r!cross\predefinedreference \endcsname\dummypredefinedreference
+% \global\@EA\let\csname\r!cross\unharmedreferenceprefix\endcsname\dummypredefinedreference} % bug!
+%
+% we need to predefine in order to make dup checking possible (when no ref
+% is defined yet)
+
+\def\predefinereference#1% takes now an argument
+ {\global\@EA\let\csname\r!cross #1\endcsname\dummypredefinedreference
+ \global\@EA\let\csname\r!cross\unharmedreferenceprefix#1\endcsname\dummypredefinedreference}
-\def\predefinereference
- {\global\@EA\let\csname\r!cross\predefinedreference \endcsname\dummypredefinedreference
- \global\@EA\let\csname\r!cross\unharmedreferenceprefix\endcsname\dummypredefinedreference}
+\def\dummypredefinedreference{\rt!done{}{}{}{}}
%D Testing on existance then becomes:
diff --git a/Master/texmf-dist/tex/context/base/core-reg.tex b/Master/texmf-dist/tex/context/base/core-reg.tex
index 431cee6b9d6..309aee2f9ed 100644
--- a/Master/texmf-dist/tex/context/base/core-reg.tex
+++ b/Master/texmf-dist/tex/context/base/core-reg.tex
@@ -80,6 +80,34 @@
%
% \index[tsch]{tsch} test \index{Qtsch} test \index[ratsch]{Rtsch} test
+% \def\doprocesspageregister[#1]#2#3% key altnum entry
+% {\begingroup
+% \thisisnextinternal\s!ind
+% \ifduplicate\getlastregisterentry{#3}\fi
+% \convertexpanded{\registerparameter\c!keyexpansion}{#1}\asciiregisterentryA
+% \convertexpanded{\registerparameter\c!expansion }{#3}\asciiregisterentryB
+% \doifsomething{\registerparameter\c!keyexpansion}
+% {\ifx\asciiregisterentryA\empty
+% \convertexpanded{\registerparameter\c!keyexpansion}{#3}\asciiregisterentryA
+% \fi}%
+% \makesectionformat
+% \doifelse{\registerparameter\c!ownnumber}\v!yes
+% \donetrue\donefalse
+% % the spaces between } { are essential for texutil's split
+% \expanded
+% {\writeutility%
+% {r \ifcase\registerpagestatus\space\or e \or f \or t \fi
+% {\currentregister} %
+% {\nextinternalreference} %
+% {\asciiregisterentryA} %
+% {\asciiregisterentryB} %
+% {\sectionformat\sectionseparator\sectionseparator
+% \ifdone#2\else\noexpand\pagenumber\fi} %
+% {\noexpand\realfolio}}}%
+% \getfirstcharacter\currentregister
+% \registerinfo{> \firstcharacter}{#3}%
+% \endgroup}
+
\def\doprocesspageregister[#1]#2#3% key altnum entry
{\begingroup
\thisisnextinternal\s!ind
@@ -123,49 +151,58 @@
% \ifvmode\nobreak\fi
% \GotoPar}
+% \long\def\doflushatpar#1%
+% %{\dogotopar{#1}}
+% %{\dogotopar{\dontleavehmode#1}} % this one can introduce empty lines
+% {\dogotopar{#1\ifvmode\nobreak\fi}} % while this one can mess up vertical space
+%
+% fails when [text] \index{test} [empty line] [text] so we now have
+% Taco's test based solution:
+
+\def\doflushatpar
+ {\ifvmode
+ \expandafter\dogotopar
+ \else
+ \expandafter\firstofoneargument
+ \fi}
+
\def\dodoregister[#1]#2#3%
- {\dogotopar{\doprocesspageregister[#1]{#2}{#3}}}
+ {\doflushatpar{\doprocesspageregister[#1]{#2}{#3}}}
\def\writetoregister[#1]% to be documented
{\doregister{#1}}
\def\startregister
- {\dodoubleargument\dostartregister}
-
-%\def\dostartregister[#1][#2]#3%
-% {\chardef\registerpagestatus=2
-% \def\currentregister{#1}%
-% \setgvalue{\??id#1\??id#2}{\dodostopregister[#1][#2]{#3}}%
-% \complexdoregister[#2]{#3}}
+ {\dotripleempty\dostartregister}
-\def\dostartregister[#1][#2]#3%
- {\chardef\registerpagestatus2
+\def\dostartregister[#1][#2][#3]#4%
+ {\chardef\registerpagestatus\plustwo
\def\currentregister{#1}%
- \setgvalue{\??id#1\??id#2}{\dodostopregister[#1][#2]{#3}}%
- \donoregister[#2]{#3}}
+ \setgvalue{\??id#1\??id#2}{\dodostopregister[#1][#3]{#4}}%
+ \dodoregister[#3]{}{#4}}
\def\stopregister
{\dodoubleargument\dostopregister}
\def\dostopregister[#1][#2]%
- {\getvalue{\??id#1\??id#2}\setgvalue{\??id#1\??id#2}{}}
+ {\getvalue{\??id#1\??id#2}\letgvalue{\??id#1\??id#2}\relax}
-\def\dodostopregister[#1][#2]%
- {\chardef\registerpagestatus3
+\def\dodostopregister[#1][#2]#3%
+ {\chardef\registerpagestatus\plusthree
\def\currentregister{#1}%
- \donoregister[#2]}
+ \dodoregister[#2]{}{#3}} % key altnum entry
-\def\complexdozieregister[#1]#2#3%
+\def\doprocessseeregister[#1]#2#3%
{\begingroup
\thisisnextinternal\s!ind
\ifduplicate\getlastregisterentry{#2}\fi
\convertexpanded{\registerparameter\c!keyexpansion}{#1}\asciiregisterentryA
\convertexpanded{\registerparameter\c!expansion }{#2}\asciiregisterentryB
\convertexpanded{\registerparameter\c!expansion }{#3}\asciiregisterentryC
-\doifsomething{\registerparameter\c!keyexpansion}
- {\ifx\asciiregisterentryA\empty
- \convertexpanded{\registerparameter\c!keyexpansion}{#2}\asciiregisterentryA
- \fi}%
+ \doifsomething{\registerparameter\c!keyexpansion}
+ {\ifx\asciiregisterentryA\empty
+ \convertexpanded{\registerparameter\c!keyexpansion}{#2}\asciiregisterentryA
+ \fi}%
\makesectionformat
\expanded
{\writeutility%
@@ -177,16 +214,18 @@
{\asciiregisterentryC} %
{\sectionformat}}}%
\endgroup
- \registerinfo{> zie}{#2}%
- \GotoPar}
+ \registerinfo{> see}{#2}}
+
+\def\complexdoseeregister[#1]#2#3%
+ {\doflushatpar{\doprocessseeregister[#1]{#2}{#3}}}
-\def\dozieregister#1%
+\def\doseeregister#1%
{\def\currentregister{#1}%
- \complexorsimpleempty\dozieregister}
+ \complexorsimpleempty\doseeregister} % = \dosingleempty\doseeregister
-\def\dowritetoregister[#1]% % de twee-traps-aanroep is nodig
- {\edef\currentregister{#1}% % om gebruik van \ExpandBothAfter
- \doprocesspageregister{}} % mogelijk te maken
+\def\dowritetoregister[#1]% % de twee-traps-aanroep is nodig
+ {\edef\currentregister{#1}% % om gebruik van \ExpandBothAfter
+ \doprocesspageregister} % mogelijk te maken
\def\writetoregister
{\dodoubleempty\dowritetoregister}
@@ -242,12 +281,12 @@
\def\registertexthowto{#2}}%
\def\doregistertexthowto#1#2%
- {\dostartattributes{\??id#1\registertexthowto}\c!textstyle\c!textcolor{}%
+ {\dostartattributes{\??id#1\registertexthowto}\c!textstyle\c!textcolor\empty
\getvalue{\??id#1\c!textcommand}{#2}%
\dostopattributes}
\def\doregisterpagehowto#1#2%
- {\dostartattributes{\??id#1\registerpagehowto}\c!pagestyle\c!pagecolor{}%
+ {\dostartattributes{\??id#1\registerpagehowto}\c!pagestyle\c!pagecolor\empty
\getvalue{\??id#1\c!pagecommand}{#2}%
\dostopattributes}
@@ -292,21 +331,84 @@
\def\dosetpageregisterpage#1#2#3#4#5#6%
{\doifreglevelelse[#5]{\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}{}}
-\def\dodosetpageregisterpage#1#2#3#4#5#6%
+% \def\dodosetpageregisterpage#1#2#3#4#5#6%
+% {\global\utilitydonetrue
+% \c!entryletter
+% \setregisterhowto[#3]%
+% \def\dohandleregisterentry##1%
+% {\bgroup
+% \if!!donea % \strut nieuw
+% %\setbox0\hbox{\showlocation{\doregistertexthowto{#2}
+% % {\strut\limitedregisterentry{#2}{##1}}}}%
+% % \gotonextinternal\s!ind{#4}{#6}{\box0}%
+% %
+% \hhboxindent\hangindent % maybe also left and right skip
+% \setbox0\hbox{\doregistertexthowto{#2}{\strut\limitedregisterentry{#2}{##1}}}%
+% \unhhbox0\with{\gotonextinternal\s!ind{#4}{#6}{\box\hhbox}}%
+% %
+% \else
+% \doregistertexthowto{#2}{##1}%
+% \fi
+% \egroup
+% \!!doneafalse}%
+% \!!doneafalse
+% \doifelsevalue{\??id#2\c!interaction}\v!text
+% {\ifcase\currententrylevel \or
+% \!!doneatrue\c!entrya\c!entryb\c!entryc \or
+% \c!entrya\!!doneatrue\c!entryb\c!entryc \or
+% \c!entrya\c!entryb\!!doneatrue\c!entryc \fi}
+% {\c!entrya\c!entryb\c!entryc}%
+% \global\let\c!entrya\relax
+% \global\let\c!entryb\relax
+% \global\let\c!entryc\relax
+% \global\let\c!entryletter\relax
+% \global\let\c!entryreference\relax
+% % \global\firstregisterentrytrue
+% \iffirstregisterpage
+% \global\chardef\lastregisterpagestatus\zerocount
+% \expandafter\hskip\getvalue{\??id#2\c!distance}\relax
+% \donetrue
+% \else\ifnum#1=3
+% |--|\relax % -- !
+% \donetrue
+% \else\ifnum\lastregisterpagestatus=2
+% \donefalse % waiting for "to" pagenumber
+% \else
+% \registerpageseparator
+% |\space|\relax % \relax needed because | looks ahead
+% \donetrue
+% \fi\fi\fi
+% \ifdone
+% \begingroup
+% %
+% \doifelsevalue{\??id#2\c!prefix}\v!none % default v!both
+% {\chardef\pageprefixmode\zerocount}%
+% {\doifvalue{\??id#2\c!prefix}\v!first % only first in range (1.2-4)
+% {\ifnum#1=3 \chardef\pageprefixmode\zerocount \fi}}%
+% %
+% \doifelsevalue{\??id#2\c!interaction}\v!pagenumber
+% {\bgroup
+% \setbox0\hbox
+% {\showlocation{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
+% \gotonextinternal{\s!ind}{#4}{#6}{\box0}%{\copy0}%
+% \egroup}
+% {\hbox{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
+% \endgroup
+% \ignorespaces
+% \global\chardef\lastregisterpagestatus#1\relax
+% \fi
+% \global\firstregisterpagefalse}
+
+\def\dodosetpageregisterpageA#1#2#3#4#5#6%
{\global\utilitydonetrue
\c!entryletter
\setregisterhowto[#3]%
\def\dohandleregisterentry##1%
{\bgroup
\if!!donea % \strut nieuw
- %\setbox0\hbox{\showlocation{\doregistertexthowto{#2}
- % {\strut\limitedregisterentry{#2}{##1}}}}%
- % \gotonextinternal\s!ind{#4}{#6}{\box0}%
- %
\hhboxindent\hangindent % maybe also left and right skip
\setbox0\hbox{\doregistertexthowto{#2}{\strut\limitedregisterentry{#2}{##1}}}%
\unhhbox0\with{\gotonextinternal\s!ind{#4}{#6}{\box\hhbox}}%
- %
\else
\doregistertexthowto{#2}{##1}%
\fi
@@ -323,8 +425,10 @@
\global\let\c!entryb\relax
\global\let\c!entryc\relax
\global\let\c!entryletter\relax
- \global\let\c!entryreference\relax
- % \global\firstregisterentrytrue
+ \global\let\c!entryreference\relax}
+
+\def\dodosetpageregisterpageB#1#2#3#4#5#6%
+ {% \global\firstregisterentrytrue
\iffirstregisterpage
\global\chardef\lastregisterpagestatus\zerocount
\expandafter\hskip\getvalue{\??id#2\c!distance}\relax
@@ -340,6 +444,13 @@
\donetrue
\fi\fi\fi
\ifdone
+ \begingroup
+ %
+ \doifelsevalue{\??id#2\c!prefix}\v!none % default v!both
+ {\chardef\pageprefixmode\zerocount}%
+ {\doifvalue{\??id#2\c!prefix}\v!first % only first in range (1.2-4)
+ {\ifnum#1=3 \chardef\pageprefixmode\zerocount \fi}}%
+ %
\doifelsevalue{\??id#2\c!interaction}\v!pagenumber
{\bgroup
\setbox0\hbox
@@ -347,13 +458,99 @@
\gotonextinternal{\s!ind}{#4}{#6}{\box0}%{\copy0}%
\egroup}
{\hbox{\doregisterpage{#2}[#5]\ifnum#1=2\/\fi}}%
+ \endgroup
\ignorespaces
\global\chardef\lastregisterpagestatus#1\relax
\fi
\global\firstregisterpagefalse}
+\def\resetseenregisterpage
+ {\global\let\firstseenregisterreal \relax
+ \global\let\currentseenregisterreal\relax
+ \global\let\lastseenregisterreal \relax
+ \global\let\firstseenregisterpage \relax
+ \global\let\currentseenregisterpage\relax
+ \global\let\lastseenregisterpage \relax}
+
+\resetseenregisterpage
+
+\def\dodosetpageregisterpageC#1#2#3#4#5#6%
+ {\xdef\currentseenregisterpage{#5}%
+ \xdef\currentseenregisterreal{#6}%
+ \gdef\flushseenregisterpage{\doflushseenregisterpage{#1}{#2}{#3}{#4}}%
+ \ifx\firstseenregisterreal\relax
+ \global\let\firstseenregisterreal\currentseenregisterreal
+ \global\let\firstseenregisterpage\currentseenregisterpage
+ \global\let\lastseenregisterreal \currentseenregisterreal
+ \global\let\lastseenregisterpage \currentseenregisterpage
+ \else\ifnum\numexpr\lastseenregisterreal+\plusone\relax=\currentseenregisterreal\relax
+ \global\let\lastseenregisterreal \currentseenregisterreal
+ \global\let\lastseenregisterpage \currentseenregisterpage
+ \else
+ \ifx\firstseenregisterreal\lastseenregisterreal
+ \expanded{\dodosetpageregisterpageB{1}{#2}{#3}{#4}{\lastseenregisterpage}{\lastseenregisterreal}}%
+ \else
+ \expanded{\dodosetpageregisterpageB{2}{#2}{#3}{#4}{\firstseenregisterpage}{\firstseenregisterreal}}%
+ \expanded{\dodosetpageregisterpageB{3}{#2}{#3}{#4}{\lastseenregisterpage }{\lastseenregisterreal }}%
+ \fi
+ \global\let\firstseenregisterreal\currentseenregisterreal
+ \global\let\firstseenregisterpage\currentseenregisterpage
+ \global\let\lastseenregisterreal \currentseenregisterreal
+ \global\let\lastseenregisterpage \currentseenregisterpage
+ \fi\fi}
+
+\def\doflushseenregisterpage#1#2#3#4%
+ {\global\let\flushseenregisterpage\relax
+ \ifx\firstseenregisterreal\relax
+ % nothing in the hold
+ \else\ifx\firstseenregisterreal\lastseenregisterreal
+ \expanded{\dodosetpageregisterpageB{1}{#2}{#3}{#4}{\lastseenregisterpage}{\lastseenregisterreal}}%
+ \else
+ \expanded{\dodosetpageregisterpageB{2}{#2}{#3}{#4}{\firstseenregisterpage}{\firstseenregisterreal}}%
+ \expanded{\dodosetpageregisterpageB{3}{#2}{#3}{#4}{\lastseenregisterpage }{\lastseenregisterreal }}%
+ \fi\fi
+ \resetseenregisterpage}
+
+\let\flushseenregisterpage\relax
+
+\chardef\collapseregisterpages\zerocount
+
+\def\dodosetpageregisterpage
+ {\ifcase\collapseregisterpages
+ \expandafter\dodosetpageregisterpagenormal
+ \else
+ \expandafter\dodosetpageregisterpagecollapsed
+ \fi}
+
+\def\dodosetpageregisterpagenormal#1#2#3#4#5#6%
+ {\dodosetpageregisterpageA{#1}{#2}{#3}{#4}{#5}{#6}%
+ \dodosetpageregisterpageB{#1}{#2}{#3}{#4}{#5}{#6}}
+
+\def\dodosetpageregisterpagecollapsed#1#2#3#4#5#6%
+ {\dodosetpageregisterpageA{#1}{#2}{#3}{#4}{#5}{#6}%
+ \dodosetpageregisterpageC{#1}{#2}{#3}{#4}{#5}{#6}}
+
+% test case for collapsing (experimental, for Steffen Wolfrum)
+%
+% \starttext
+% \chardef\collapseregisterpages\zerocount \placeregister[index] \blank[2*big]
+% \chardef\collapseregisterpages\plusone \placeregister[index] \page
+% \dorecurse{10}{test 1:!\index{test} test \page}
+% \dorecurse{5} {test 2:\recurselevel \page}
+% \dorecurse{10}{test 3:!\index{test} test \page}
+% \dorecurse{5} {test 4:\recurselevel \page}
+% \dorecurse{1} {test 5:!\index{test} test \page}
+% \dorecurse{5} {test 6:\recurselevel \page}
+% \dorecurse{10}{test 7:!\index{test} test \page}
+% \dorecurse{5} {test 8:\recurselevel \page}
+% oeps \index{oeps}
+% xxxx \index{xxxx}
+% todo \index{todo}
+% \stoptext
+
\def\dosetpageregistersee#1#2#3#4% ugly separator hack
- {\expanded{\doifreglevelelse[#4\sectionseparator\sectionseparator0]}%
+ {\flushseenregisterpage
+ \expanded{\doifreglevelelse[#4\sectionseparator\sectionseparator0]}%
{{\global\utilitydonetrue
\setregisterhowto[#2]%
\def\dohandleregisterentry##1% dubbelop | \strut nieuw
@@ -376,12 +573,13 @@
\def\doregistercharacter[#1]#2%
{\global\firstregisterentrytrue
- \doifelsevalue{\??id#1\c!indicator}\v!yes
- {\executeifdefined
- {\strippedcsname\doregistercharacter\getvalue{\??id#1\c!alternative}}%
- \doregistercharactera
- [#1]{#2}}
- {\noregistercharacter[#1]{#2}}}
+ \doifsomething{#2}
+ {\doifelsevalue{\??id#1\c!indicator}\v!yes
+ {\executeifdefined
+ {\strippedcsname\doregistercharacter\getvalue{\??id#1\c!alternative}}%
+ \doregistercharactera
+ [#1]{#2}}
+ {\noregistercharacter[#1]{#2}}}}
\def\noregistercharacter[#1]#2%
{\getvalue{\??id#1\c!before}%
@@ -413,12 +611,18 @@
%D Don't use \type{\string#2}; another hack is needed, since
%D \type {#2} can be \type {\string} itself.
+% \def\doregisterreference[#1]#2%
+% {\doifvalue{\??id#1\c!referencing}\v!on
+% {\pagereference[#1:#2]}}
+
\def\doregisterreference[#1]#2%
- {\doifvalue{\??id#1\c!referencing}\v!on
- {\pagereference[#1:#2]}}
+ {\doifsomething{#2}
+ {\doifvalue{\??id#1\c!referencing}\v!on
+ {\pagereference[#1:\strippedcsname#2]}}}
\def\dosetpageregisterletter#1#2%
- {\gdef\c!entryreference
+ {\flushseenregisterpage
+ \gdef\c!entryreference
{\global\let\c!entryreference\relax
\doregisterreference[#1]{#2}}%
\gdef\c!entryletter
@@ -426,21 +630,43 @@
\global\let\c!entryletter\relax
\doregistercharacter[#1]{#2}}}
+% \def\HowUgly #1{\doHowUgly#1\relax}
+% \def\doHowUgly#1#2\relax{\iffirstregisterentry{\bf#1}#2\fi#1#2} # handles utf too
+%
+% \setupregister[index][indicator=no,deeptextcommand=\HowUgly]
+%
+% \starttext
+% \chapter{First Chapter}
+% Some text...\index{word}
+% \section {First Section}
+% Some text...\index{word}
+% Some text...\index{another entry}
+% Some text...\index{ansi}
+% Some text...\index{another entry}
+% \page[yes]
+% \completeindex
+% \stoptext
+
+\def\dohandlepageregisterentry#1#2%
+ {\dohandleregisterentry{\executeifdefined{\??id#1\c!deeptextcommand}\firstofoneargument{#2}}}
+
\def\dosetpageregisterentrya#1#2%
- {\edef\currententrylevel{1}%
+ {\flushseenregisterpage
+ \edef\currententrylevel{1}%
\global\let\c!entryb\relax
\global\let\c!entryc\relax
\gdef\c!entrya
{\iffirstregisterentry\else\endgraf\fi % new
\global\firstregisterpagetrue
\hangindent1em\noindent\c!entryreference
- \dohandleregisterentry{#2}%
+ \dohandlepageregisterentry{#1}{#2}%
\global\firstregisterentryfalse
\global\firstsubentrytrue
\global\firstsubsubentrytrue}}
\def\dosetpageregisterentryb#1#2%
- {\edef\currententrylevel{2}%
+ {\flushseenregisterpage % redundant
+ \edef\currententrylevel{2}%
\global\let\c!entryc\relax
\global\def\c!entryb
{\iffirstregisterentry\else\endgraf\fi % new
@@ -448,13 +674,14 @@
\global\let\c!entrya\relax
\iffirstsubentry\nobreak\fi
\hangindent2em\noindent\c!entryreference\hskip1em\relax
- \dohandleregisterentry{#2}%
+ \dohandlepageregisterentry{#1}{#2}%
\global\firstregisterentryfalse
\global\firstsubentryfalse
\global\firstsubsubentrytrue}}
\def\dosetpageregisterentryc#1#2%
- {\edef\currententrylevel{3}%
+ {\flushseenregisterpage % redundant
+ \edef\currententrylevel{3}%
\gdef\c!entryc
{\iffirstregisterentry\else\endgraf\fi % new
\global\firstregisterpagetrue
@@ -462,7 +689,7 @@
\global\let\c!entryb\relax
\iffirstsubsubentry\nobreak\fi
\hangindent3em\noindent\c!entryreference\hskip2em\relax
- \dohandleregisterentry{#2}%
+ \dohandlepageregisterentry{#1}{#2}%
\global\firstregisterentryfalse
\global\firstsubsubentryfalse}}
@@ -509,7 +736,7 @@
\c!entryletter
\iflocation
\getalllistreferences{#1}{#2}%
-% \endgraf
+ % no \endgraf
\hangindent1em\noindent\c!entryreference
%
%\thisissomeinternal{\s!lin}{\internallistreference}%
@@ -566,7 +793,7 @@
\docommando\lastlistreference\v!next}%
% tot hier
\else
-% \endgraf
+ % no \endgraf
\noindent\c!entryreference
\limitedregisterentry{#1}{#2}%
\fi
@@ -594,36 +821,36 @@
\doglobal\increment\internallistreference}%
\setvalue{#1\s!from}%
{\getvalue{#1\s!page}}%
-\ifautoregisterhack
- \setvalue{#1\s!page}##1##2##3##4%
- {\doifreglevelelse[##3]
- {\global\utilitydonetrue
- \iffirstregisterpage
- \@EA\xdef\csname\??id#1\??id\currentregisterentry\endcsname
- {\internallistreference::##4}%
- \else % catches errors in index
- \ifcsname\??id#1\??id\currentregisterentry\endcsname
+ \ifautoregisterhack
+ \setvalue{#1\s!page}##1##2##3##4%
+ {\doifreglevelelse[##3]
+ {\global\utilitydonetrue
+ \iffirstregisterpage
\@EA\xdef\csname\??id#1\??id\currentregisterentry\endcsname
- {\csname\??id#1\??id\currentregisterentry\endcsname,##4}%
- \fi
- \fi}
- {}}%
-\else
- \setvalue{#1\s!page}##1##2##3##4%
- {\doifreglevelelse[##3]
- {\global\utilitydonetrue
- \iffirstregisterpage
- \global\firstregisterpagefalse
- \@EA\xdef\csname\??id#1\??id\currentregisterentry\endcsname
- {\internallistreference::##2-##4}%
- \else % catches errors in index
- \ifcsname\??id#1\??id\currentregisterentry\endcsname
+ {\internallistreference::##4}%
+ \else % catches errors in index
+ \ifcsname\??id#1\??id\currentregisterentry\endcsname
+ \@EA\xdef\csname\??id#1\??id\currentregisterentry\endcsname
+ {\csname\??id#1\??id\currentregisterentry\endcsname,##4}%
+ \fi
+ \fi}
+ {}}%
+ \else
+ \setvalue{#1\s!page}##1##2##3##4%
+ {\doifreglevelelse[##3]
+ {\global\utilitydonetrue
+ \iffirstregisterpage
+ \global\firstregisterpagefalse
\@EA\xdef\csname\??id#1\??id\currentregisterentry\endcsname
- {\csname\??id#1\??id\currentregisterentry\endcsname,##2-##4}%
- \fi
- \fi}
- {}}%
-\fi}
+ {\internallistreference::##2-##4}%
+ \else % catches errors in index
+ \ifcsname\??id#1\??id\currentregisterentry\endcsname
+ \@EA\xdef\csname\??id#1\??id\currentregisterentry\endcsname
+ {\csname\??id#1\??id\currentregisterentry\endcsname,##2-##4}%
+ \fi
+ \fi}
+ {}}%
+ \fi}
\def\docoupleregister[#1][#2]%
{\iflocation
@@ -726,11 +953,29 @@
\docommandoprolinrefB{#1}\nextlistreference\v!next
\fi}}
-\def\dodolinkedregister[#1][#2]#3% page auto link
+% \def\dodolinkedregister[#1][#2]#3% page auto link
+% {\bgroup
+% \chardef\registerpagestatus\plusone
+% \def\currentregister{#1}%
+% \iflocation
+% \ifautoregisterhack
+% \def\next{\doprocessautoregister[#1][#2]}%
+% \else
+% \def\next{\doprocesslinkregister[#1][#2]}%
+% \fi
+% \else
+% \def\next{\doprocesspageregister[#2]{}}%
+% \fi
+% \next{#3}%
+% \egroup
+% \ifvmode\nobreak\fi
+% \GotoPar}
+
+\def\doprocesslinkedregister[#1][#2]#3% page auto link
{\bgroup
\chardef\registerpagestatus\plusone
\def\currentregister{#1}%
- \iflocation
+ \iflocation % \next is not needed
\ifautoregisterhack
\def\next{\doprocessautoregister[#1][#2]}%
\else
@@ -740,9 +985,10 @@
\def\next{\doprocesspageregister[#2]{}}%
\fi
\next{#3}%
- \egroup
- \ifvmode\nobreak\fi
- \GotoPar}
+ \egroup}
+
+\def\dodolinkedregister[#1][#2]#3% page auto link
+ {\doflushatpar{\doprocesslinkedregister[#1][#2]{#3}}}
\def\dolinkedregister#1%
{\dodoubleempty\dodolinkedregister[#1]}
@@ -754,10 +1000,8 @@
\global\let\currentregisterentry\empty
\global\firstsubentrytrue % not needed
\global\firstsubsubentrytrue % not needed too
- \setvalue{#1\s!entrya}##1%
- {\dosetautoregisterentrya{#1}{##1}}%
- \setvalue{#1\s!entry}##1%
- {\dosetpageregisterletter{#1}{##1}}}
+ \setvalue{#1\s!entrya}##1{\dosetautoregisterentrya{#1}{##1}}%
+ \setvalue{#1\s!entry }##1{\dosetpageregisterletter{#1}{##1}}}
\def\dosetautoregisterentrya#1#2%
{\global\utilitydonetrue
@@ -838,6 +1082,9 @@
\begingroup
\edef\currentregister{#1}%
\setupregister[\currentregister][#2]%
+ \doifelse{\registerparameter\c!compress}\v!yes % new
+ {\chardef\collapseregisterpages\plusone}
+ {\chardef\collapseregisterpages\zerocount}%
\raggedright
\startcolumns
[\c!n=\registerparameter\c!n,
@@ -845,12 +1092,20 @@
\c!align=\registerparameter\c!align]%
\dontcomplain
\startpacked[\v!blank]%
- \doutilities\currentregister\jobname\currentregister\relax\par
+ \doutilities\currentregister\jobname\currentregister\dobeforeplaceregister\doafterplaceregister
\stoppacked
\stopcolumns
\endgroup
\fi}
+\def\dobeforeplaceregister
+ {\resetseenregisterpage
+ \relax}
+
+\def\doafterplaceregister
+ {\flushseenregisterpage
+ \par}
+
\def\completeregister
{\dodoubleempty\docompleteregister}
@@ -865,6 +1120,10 @@
\endgroup
\fi}
+\def\doregisterregisterlanguage#1%
+ {\savesortlanguage{\getvalue{\??id#1\s!language}}%
+ \immediatewriteutility{r l {#1} {\getvalue{\??id#1\s!language}}}}
+
\def\dodefineregister[#1][#2]%
{\setupregister[#1]%
[\c!n=2,
@@ -873,6 +1132,7 @@
\c!before=\blank, % binnen kolommen: \blank[\v!line]
\c!after=,
\c!symbol=,
+ \c!compress=\v!no,
\c!interaction=\v!pagenumber,
\c!alternative=\v!a,
\c!distance=1em,
@@ -888,15 +1148,21 @@
\c!maxwidth=,
\c!number=\v!no,
\c!unknownreference=\v!empty,
+ \c!prefix=\v!both,
\c!expansion=,
- \c!keyexpansion=]%
+ \c!keyexpansion=,
+ %\c!deeptextcommand=, % undefined by default !
+ \s!language=\currentmainlanguage]%
+ \doglobal\appendtoksonce
+ \doregisterregisterlanguage{#1}%
+ \to \everysavesortkeys
\presetheadtext[#1=\Word{#1}]%
\addutilityreset{#1}%
\setvalue{#1}{\doregister{#1}}%
\setvalue{\e!coupled#1}{\dolinkedregister{#1}}%
\setvalue{\s!set#1}{\dosetregister{#1}}%
\setvalue{\s!reset#1}{\doresetregister{#1}}%
- \setvalue{\e!see#1}{\dozieregister{#1}}%
+ \setvalue{\e!see#1}{\doseeregister{#1}}%
\setvalue{\e!place#1}{\placeregister[#1]}%
\setvalue{\e!complete#1}{\completeregister[#1]}%
\setvalue{\e!setup#1\e!endsetup}[##1]{\getparameters[\??id#1][##1]}}
diff --git a/Master/texmf-dist/tex/context/base/core-rul.tex b/Master/texmf-dist/tex/context/base/core-rul.tex
index e21d6385a0c..30b06403ca0 100644
--- a/Master/texmf-dist/tex/context/base/core-rul.tex
+++ b/Master/texmf-dist/tex/context/base/core-rul.tex
@@ -556,18 +556,18 @@
\def\@@frame@@{@@frame@@}
-\setvalue{t\@@frame@@\v!on\v!on}{\hrule\!!height\ruledlinewidth\kern-\ruledlinewidth}
+\setvalue{t\@@frame@@\v!on \v!on}{\hrule\!!height\ruledlinewidth\kern-\ruledlinewidth}
\setvalue{t\@@frame@@\v!off\v!on}{\hrule\!!height\ruledlinewidth\kern-\ruledlinewidth}
- \setvalue{t\@@frame@@\v!on}{\hrule\!!height\ruledlinewidth\kern-\ruledlinewidth}
-\setvalue{b\@@frame@@\v!on\v!on}{\kern-\ruledlinewidth\hrule\!!height\ruledlinewidth}
+\setvalue{t\@@frame@@\v!on }{\hrule\!!height\ruledlinewidth\kern-\ruledlinewidth}
+\setvalue{b\@@frame@@\v!on \v!on}{\kern-\ruledlinewidth\hrule\!!height\ruledlinewidth}
\setvalue{b\@@frame@@\v!off\v!on}{\kern-\ruledlinewidth\hrule\!!height\ruledlinewidth}
- \setvalue{b\@@frame@@\v!on}{\kern-\ruledlinewidth\hrule\!!height\ruledlinewidth}
-\setvalue{l\@@frame@@\v!on\v!on}{\vrule\!!width\ruledlinewidth\kern-\ruledlinewidth}
+\setvalue{b\@@frame@@\v!on }{\kern-\ruledlinewidth\hrule\!!height\ruledlinewidth}
+\setvalue{l\@@frame@@\v!on \v!on}{\vrule\!!width\ruledlinewidth\kern-\ruledlinewidth}
\setvalue{l\@@frame@@\v!off\v!on}{\vrule\!!width\ruledlinewidth\kern-\ruledlinewidth}
- \setvalue{l\@@frame@@\v!on}{\vrule\!!width\ruledlinewidth\kern-\ruledlinewidth}
-\setvalue{r\@@frame@@\v!on\v!on}{\kern-\ruledlinewidth\vrule\!!width\ruledlinewidth}
+\setvalue{l\@@frame@@\v!on }{\vrule\!!width\ruledlinewidth\kern-\ruledlinewidth}
+\setvalue{r\@@frame@@\v!on \v!on}{\kern-\ruledlinewidth\vrule\!!width\ruledlinewidth}
\setvalue{r\@@frame@@\v!off\v!on}{\kern-\ruledlinewidth\vrule\!!width\ruledlinewidth}
- \setvalue{r\@@frame@@\v!on}{\kern-\ruledlinewidth\vrule\!!width\ruledlinewidth}
+\setvalue{r\@@frame@@\v!on }{\kern-\ruledlinewidth\vrule\!!width\ruledlinewidth}
%D I condidered using the low level support command
%D \type{\ruledhbox}, but this would slow down processing by a
@@ -587,6 +587,8 @@
%D start with defining some booleans. These give an impression
%D of what we are going to take into account.
+% todo: chardefs
+
\newif\ifboxhasoffset
\newif\ifboxhaswidth
\newif\ifboxhasheight
@@ -594,6 +596,7 @@
\newif\ifboxhasstrut
\newif\ifboxisoverlaid
\newif\ifboxhasframe
+\newif\ifdelayedstrut
%D We also need a few \DIMENSIONS:
@@ -638,13 +641,13 @@
\def\copylocalframed[#1]#2[#3]%
{\copyparameters[#1][#3]%
- [\c!width,\c!height,\c!offset,\c!empty,\c!rulethickness,%
+ [\c!width,\c!height,\c!autowidth,\c!offset,\c!empty,\c!rulethickness,%
\c!radius,\c!corner,\c!depth,\c!frame,\c!framecolor,%
\c!foregroundstyle,\c!foregroundcolor,\c!lines,\c!orientation,%
\c!topframe,\c!bottomframe,\c!leftframe,\c!rightframe,%
\c!rulethickness,\c!frameoffset,\c!background,\c!component,%
\c!backgroundoffset,\c!backgroundscreen,\c!backgroundcolor,%
- \c!align,\c!bottom,\c!top,\c!strut,\c!location,\c!setups,\c!extras]%
+ \c!align,\c!bottom,\c!top,\c!strut,\c!autostrut,\c!location,\c!setups,\c!extras]%
\copyparameters[#1\c!background][#1]%
[\c!radius,\c!corner,\c!depth]%
\copyparameters[#1\c!frame][#1]%
@@ -696,6 +699,9 @@
\def\framedparameter#1%
{\csname\@@framed#1\endcsname}
+\newdimen\!!framedwidth
+\newdimen\!!framedheight
+
\def\startlocalframed[#1][#2]%
{\bgroup
\inframedtrue
@@ -733,10 +739,13 @@
\edef\localformat{\framedparameter\c!align}%
\edef\localstrut {\framedparameter\c!strut}%
% these are not
+ \edef\@@localautostrut {\framedparameter\c!autostrut}%
\edef\@@localframing {\framedparameter\c!frame}%
\edef\@@locallocation {\framedparameter\c!location}%
\edef\@@localorientation{\framedparameter\c!orientation}%
%
+ \edef\@@localautowidth {\framedparameter\c!autowidth}%
+ %
\ifx\@@localframing\v!overlay % no frame, no offset, no framewidth
\boxhasframefalse
\let\localoffset\v!overlay
@@ -784,30 +793,32 @@
\@@localoffset\localoffset
\advance\@@localoffset \ruledlinewidth
\fi\fi
+ \!!framedheight\zeropoint
+ \!!framedwidth \zeropoint
\ifx\localwidth\v!fit
\ifboxhasformat
\boxhaswidthtrue
- \!!widtha\hsize
+ \!!framedwidth\hsize
\else
\boxhaswidthfalse
\fi
\else\ifx\localwidth\v!fixed % equals \v!fit but no shapebox
\ifboxhasformat
\boxhaswidthtrue
- \!!widtha\hsize
+ \!!framedwidth\hsize
\else
\boxhaswidthfalse
\fi
\else\ifx\localwidth\v!broad
\boxhaswidthtrue
- \!!widtha\hsize
+ \!!framedwidth\hsize
\else\ifx\localwidth\v!local
\boxhaswidthtrue
\setlocalhsize
- \!!widtha\localhsize
+ \!!framedwidth\localhsize
\else
\boxhaswidthtrue
- \!!widtha\localwidth
+ \!!framedwidth\localwidth
\fi\fi\fi\fi
\ifx\localheight\v!fit
\boxhasheightfalse % no longer: \boxhasstrutfalse
@@ -815,34 +826,35 @@
\boxhasheightfalse
\else
\boxhasheighttrue
- \!!heighta\localheight
+ \!!framedheight\localheight
\fi\fi
\ifboxhasheight
% obey user set height, also downward compatible
\else
\doifvaluesomething{\@@framed\c!lines}
{\ifcase\framedparameter\c!lines\else
- \!!heighta\framedparameter\c!lines\lineheight
- \edef\localheight{\the\!!heighta}%
+ \!!framedheight\framedparameter\c!lines\lineheight
+ \edef\localheight{\the\!!framedheight}%
\boxhasheighttrue
\fi}%
\fi
% this is now an option: width=local
%
- % \ifdim\!!widtha=\hsize
+ % \ifdim\!!framedwidth=\hsize
% \parindent\zeropoint
% \setlocalhsize
- % \!!widtha\localhsize
+ % \!!framedwidth\localhsize
% \fi
% i.e. disable (colsetbackgroundproblemintechniek)
- \advance\!!widtha -2\@@localoffset
- \advance\!!heighta -2\@@localoffset
+ \advance\!!framedwidth -2\@@localoffset
+ \advance\!!framedheight -2\@@localoffset
\ifx\localstrut\v!no
\boxhasstrutfalse
\else\ifx\localstrut\v!global
\setstrut
\else\ifx\localstrut\v!local
\setfontstrut
+ \else
\fi\fi\fi
\ifboxhasstrut
\setstrut
@@ -853,11 +865,23 @@
\let\localbegstrut\pseudobegstrut % was: \relax
\let\localendstrut\pseudoendstrut % was: \relax
\let\localstrut \pseudostrut % was: \relax
- %\ifboxhasheight\ifdim\!!heighta<\strutht % saveguard
- % \let\localbegstrut\relax % but not that
- % \let\localstrut \relax % save afterall
+ %\ifboxhasheight\ifdim\!!framedheight<\strutht % saveguard
+ % \let\localbegstrut\relax % but not that
+ % \let\localstrut \relax % save after all
%\fi\fi
\fi
+ \ifx\@@localautostrut\v!yes
+ \let\delayedbegstrut\relax
+ \let\delayedendstrut\relax
+ \let\delayedstrut \relax
+ \else
+ \let\delayedbegstrut\localbegstrut
+ \let\delayedendstrut\localendstrut
+ \let\delayedstrut \localstrut
+ \let\localbegstrut \relax
+ \let\localendstrut \relax
+ \let\localstrut \relax
+ \fi
\ifboxhasheight
\let\\\vboxednewline
\ifboxhaswidth
@@ -893,9 +917,9 @@
\fi
\fi
\edef\framedwidth % a new feature, visible for user
- {\ifdim\!!widtha >\zeropoint\the\!!widtha \else\zeropoint\fi}%
+ {\ifdim\!!framedwidth >\zeropoint\the\!!framedwidth \else\zeropoint\fi}%
\edef\framedheight% a new feature, visible for user
- {\ifdim\!!heighta>\zeropoint\the\!!heighta\else\zeropoint\fi}%
+ {\ifdim\!!framedheight>\zeropoint\the\!!framedheight\else\zeropoint\fi}%
% first alternative
%\def\dowithframedbox%
% {\let\postprocessframebox\relax %new
@@ -955,85 +979,33 @@
%D ...,bottom=\kern0pt,...
%D \stoptyping
-% \def\stoplocalframed
-% {\dontshowcomposition
-% \@@stopframedorientation
-% \ifboxhasformat
-% \ifx\localwidth\v!fit
-% \ifreshapeframebox\doreshapeframedbox\fi
-% \boxhaswidthfalse
-% \else\ifx\localwidth\v!fixed
-% \boxhaswidthfalse
-% \else
-% \resetshapeframebox
-% \fi\fi
-% \else
-% \resetshapeframebox
-% \fi
-% \ifboxhaswidth
-% \wd\framebox\!!widtha
-% \fi
-% \ifboxhasheight
-% \ht\framebox\!!heighta
-% \fi
-% \doifvalue{\@@framed\c!empty}\v!yes
-% {\setbox\scratchbox\null
-% \wd\scratchbox\wd\framebox
-% \ht\scratchbox\ht\framebox
-% \dp\scratchbox\dp\framebox
-% \setbox\framebox\box\scratchbox}%
-% \stopregistercolor
-% \docolorframebox
-% \ifboxhasoffset
-% \dooffsetframebox
-% \fi
-% \ifboxisoverlaid \else
-% \dolocateframebox
-% \fi
-% \ifx\postprocessframebox\relax \else
-% \let\next\postprocessframebox
-% \let\postprocessframebox\relax % prevent nesting
-% \next\framebox
-% \fi
-% \edef\overlaylinecolor{\framedparameter\c!framecolor}%
-% \edef\overlaylinewidth{\the\ruledlinewidth}% \@@...
-% \ifboxhasframe % real or invisible frame
-% \doframedbox
-% \fi
-% \doifvaluesomething{\@@framed\c!background}\dobackedbox
-% \ifx\@@locallocation\v!low
-% \doinlineframedbox
-% \else\ifx\@@locallocation\v!depth
-% \doloweredframedbox
-% \else\ifx\@@locallocation\v!hanging
-% \dohangingframedbox
-% \fi\fi\fi
-% \box\framebox
-% \egroup
-% \egroup}
-%
-% new version, installable handler:
-
\def\stoplocalframed
{\dontshowcomposition
\@@stopframedorientation
\ifboxhasformat
- \ifx\localwidth\v!fit
+ \ifx\@@localautowidth\v!force
\ifreshapeframebox\doreshapeframedbox\fi
\boxhaswidthfalse
- \else\ifx\localwidth\v!fixed
- \boxhaswidthfalse
\else
- \resetshapeframebox
- \fi\fi
+ \ifx\localwidth\v!fit
+ \ifx\@@localautowidth\v!yes
+ \ifreshapeframebox\doreshapeframedbox\fi
+ \fi
+ \boxhaswidthfalse
+ \else\ifx\localwidth\v!fixed
+ \boxhaswidthfalse
+ \else
+ \resetshapeframebox
+ \fi\fi
+ \fi
\else
\resetshapeframebox
\fi
\ifboxhaswidth
- \wd\framebox\!!widtha
+ \wd\framebox\!!framedwidth
\fi
\ifboxhasheight
- \ht\framebox\!!heighta
+ \ht\framebox\!!framedheight
\fi
\doifvalue{\@@framed\c!empty}\v!yes
{\setbox\scratchbox\null
@@ -1182,9 +1154,9 @@
\scratchcounter\@@localorientation
\divide\scratchcounter\plustwo
\ifodd\scratchcounter
- \swapmacros\framedwidth\framedheight
- \swapmacros\localwidth \localheight
- \swapdimens\!!heighta \!!widtha
+ \swapmacros\framedwidth \framedheight
+ \swapmacros\localwidth \localheight
+ \swapdimens\!!framedheight\!!framedwidth
\def\@@stopframedorientation{\@@dostopframedorientation\plusone}%
\else
\def\@@stopframedorientation{\@@dostopframedorientation\zerocount}%
@@ -1194,9 +1166,9 @@
\def\@@dostopframedorientation#1%
{\ifcase#1\else
- \swapmacros\framedwidth\framedheight
- \swapmacros\localwidth \localheight
- \swapdimens\!!heighta \!!widtha
+ \swapmacros\framedwidth \framedheight
+ \swapmacros\localwidth \localheight
+ \swapdimens\!!framedheight\!!framedwidth
\fi
\setbox\framebox\hbox{\dorotatebox\@@localorientation\hbox{\box\framebox}}}
@@ -1473,139 +1445,72 @@
%D or free widths and heights. Each combination gets its own
%D macro.
-% \def\dopresetformatbox
-% {\forgetall
-% \oninterlineskip}
-
-% \def\doformatboxSomeFormat
-% {\vbox to \!!heighta
-% \bgroup
-% \dopresetformatbox
-% \hsize\!!widtha
-% \vsize\!!heighta
-% \raggedcommand
-% \dobeforeframedbox
-% \bgroup
-% \localbegstrut
-% \aftergroup\localendstrut
-% \aftergroup\doafterframedbox
-% \aftergroup\egroup
-% \let\next=}
-
-% \def\doformatboxNoFormat
-% {\vbox to \!!heighta
-% \bgroup
-% \dopresetformatbox
-% \hsize\!!widtha
-% \vsize\!!heighta
-% \raggedcenter
-% \vss
-% \bgroup
-% \localbegstrut
-% \aftergroup\localendstrut
-% \aftergroup\vss
-% \aftergroup\egroup
-% \let\next=}
-
-% \def\doformatboxHeight
-% {\vbox to \!!heighta
-% \bgroup
-% \dopresetformatbox
-% \raggedcommand
-% \vss
-% \bgroup
-% \aftergroup\localendstrut
-% \aftergroup\vss
-% \aftergroup\egroup
-% \localbegstrut
-% \let\next=}
-
-% \def\doformatboxWidth
-% {\vbox
-% \bgroup
-% \dopresetformatbox
-% \hsize\!!widtha
-% \raggedcommand
-% \dobeforeframedbox
-% \bgroup
-% \localbegstrut
-% \aftergroup\localendstrut
-% \aftergroup\doafterframedbox
-% \aftergroup\egroup
-% \let\next=}
-
-% \def\doformatboxVSize
-% {\vbox to \!!heighta
-% \bgroup
-% \forgetall
-% \vsize\!!heighta
-% \vss
-% \bgroup
-% \aftergroup\vss
-% \aftergroup\egroup
-% \hbox
-% \bgroup
-% \aftergroup\egroup
-% \localstrut
-% \let\next=}
-
-% \def\doformatboxHSize
-% {\hbox to \!!widtha
-% \bgroup
-% \forgetall
-% \hss
-% \localstrut
-% \bgroup
-% \aftergroup\hss
-% \aftergroup\egroup
-% \let\next=}
-
-% \def\doformatboxNoSize
-% {\hbox
-% \bgroup
-% \localstrut
-% \let\next=}
+%D The following code handles one-liners: \type{align={line,flushright}}.
+%D Beware, since we entered a group and either or not grab the next
+%D bgroup token, we need to finish the group in the oneliner mode.
+
+\ifx\raggedoneliner\undefined \chardef\raggedoneliner\zerocount \fi
+
+\def\doformatonelinerbox % beware: assumes explicit preceding bgroup
+ {\ifcase\raggedoneliner
+ \expandafter\nodoformatonelinerbox
+ \else
+ \expandafter\dodoformatonelinerbox
+ \fi}
+
+\def\dodoformatonelinerbox
+ {\dowithnextboxcontent
+ {\ignorespaces}
+ {\hbox to \hsize
+ {\ifcase\raggedstatus\or\hss\or\hss\fi
+ \unhbox\nextbox \removeunwantedspaces
+ \ifcase\raggedstatus\or \or\hss\or\hss\fi}%
+ \egroup}
+ \hbox}
+
+\def\nodoformatonelinerbox % grabs {
+ {\let\next=}
+
+%D The handlers:
\def\doformatboxSomeFormat
- {\vbox to \!!heighta
+ {\vbox to \!!framedheight
\bgroup
- \let\postprocessframebox\relax
+ \let\postprocessframebox\relax
\forgetall
\oninterlineskip
- \hsize\!!widtha
- \vsize\!!heighta
+ \hsize\!!framedwidth
+ \vsize\!!framedheight
\doframedsetups
\raggedcommand
\dobeforeframedbox
\bgroup
\localbegstrut
- \@@handleoneliner
\aftergroup\localendstrut
\aftergroup\doafterframedbox
\aftergroup\egroup
- \let\next=}
+ \doformatonelinerbox}
\def\doformatboxNoFormat
- {\vbox to \!!heighta
+ {\vbox to \!!framedheight
\bgroup
- \let\postprocessframebox\relax
+ \let\postprocessframebox\relax
\forgetall
\oninterlineskip
- \hsize\!!widtha
- \vsize\!!heighta
+ \hsize\!!framedwidth
+ \vsize\!!framedheight
\doframedsetups
\raggedcenter
\vss
\bgroup
\localbegstrut
- \@@handleoneliner
\aftergroup\localendstrut
\aftergroup\vss
\aftergroup\egroup
- \let\next=}
+ \doformatonelinerbox}
\def\doformatboxHeight
- {\vbox to \!!heighta
+ {\vbox to \!!framedheight
\bgroup
\let\postprocessframebox\relax
\forgetall
@@ -1618,8 +1523,7 @@
\aftergroup\vss
\aftergroup\egroup
\localbegstrut
- \@@handleoneliner
- \let\next=}
+ \doformatonelinerbox}
\def\doformatboxWidth
{\vbox
@@ -1627,24 +1531,23 @@
\let\postprocessframebox\relax
\forgetall
\oninterlineskip
- \hsize\!!widtha
+ \hsize\!!framedwidth
\doframedsetups
\raggedcommand
\dobeforeframedbox
\bgroup
\localbegstrut
- \@@handleoneliner
\aftergroup\localendstrut
\aftergroup\doafterframedbox
\aftergroup\egroup
- \let\next=}
+ \doformatonelinerbox}
\def\doformatboxVSize
- {\vbox to \!!heighta
+ {\vbox to \!!framedheight
\bgroup
\let\postprocessframebox\relax
\forgetall
- \vsize\!!heighta
+ \vsize\!!framedheight
\doframedsetups
\vss
\bgroup
@@ -1654,22 +1557,20 @@
\bgroup
\aftergroup\egroup
\localstrut
- \@@handleoneliner
- \let\next=}
+ \doformatonelinerbox}
\def\doformatboxHSize
- {\hbox to \!!widtha
+ {\hbox to \!!framedwidth
\bgroup
\let\postprocessframebox\relax
\forgetall
\doframedsetups
\hss
\localstrut
- \@@handleoneliner
\bgroup
\aftergroup\hss
\aftergroup\egroup
- \let\next=}
+ \doformatonelinerbox}
\def\doformatboxNoSize
{\hbox
@@ -1677,8 +1578,7 @@
\let\postprocessframebox\relax
\doframedsetups
\localstrut
- \@@handleoneliner
- \let\next=}
+ \doformatonelinerbox}
\let\doframedsetups\relax
@@ -2596,6 +2496,7 @@
\c!depthcorrection=\v!on,
\c!margin=\v!standard,
\c!orientation=,
+ \c!indenting=,
#2]%
\setvalue{\e!start#1}{\dostartframedtext[#1]}%
\setvalue{\e!stop #1}{\dostopframedtext }%
@@ -2647,8 +2548,12 @@
\localhsize\hsize
\fi\fi}
-\def\dododostartframedtext[#1][#2][#3]%
- {\doifsomething{#2}{\setvalue{\??kd#1\c!location}{#2}}%
+\setfalse\framedtextlocationnone
+
+
+\def\dododostartframedtext[#1][#2][#3]% #3 only passed to framed, not to framedtext
+ {\doifsomething{#2}{\setvalue{\??kd#1\c!location}{#2}}% does not listen to #3
+ \setfalse\framedtextlocationnone
\processaction % \v!low en \v!depth are already taken !
[\framedtextparameter{#1}\c!location]
[ \v!left=>\letvalue{\??kd#1\c!left }\relax
@@ -2658,7 +2563,8 @@
\v!middle=>\letvalue{\??kd#1\c!left }\hfill
\letvalue{\??kd#1\c!right}\hfill,
\v!none=>\letvalue{\??kd#1\c!left }\relax % new
- \letvalue{\??kd#1\c!right}\relax]% new
+ \letvalue{\??kd#1\c!right}\relax % new
+ \settrue\framedtextlocationnone]%
\letvalue{\??kd#1\c!location}\empty
% removed 06/2001
% \forgetparindent
@@ -2671,7 +2577,7 @@
% \insidefloattrue % ? better
\expanded{\switchtobodyfont[\framedtextparameter{#1}\c!bodyfont]}%
\startcolor[\framedtextparameter{#1}\c!color]%
- \localframed[\??kd#1][\c!strut=\v!no,#3]%
+ \localframed[\??kd#1][\c!strut=\v!no,#3]% todo: use delayedstrut
\bgroup
\let\\=\endgraf
\framedtextparameter{#1}\c!inner % oud spul
@@ -2684,6 +2590,7 @@
\nowhitespace % na vskip ! new 20/05/2004, fails with next content being box (\scale{..})
}%
\doinhibitblank % \blank[\v!disable]% plaatst signal
+\setupindenting[\framedtextparameter{#1}\c!indenting]%
\doconvertfont{\framedtextparameter{#1}\c!style}\empty
\def\dostopframedtext{\dodostopframedtext{#1}{#2}}}
@@ -2707,15 +2614,33 @@
\verticalstrut}
\stopboxedcontent
\stopcolor
- \egroup
- \doif{#2}\v!none\insidefloattrue % new
- \ifinsidefloat
+ \ifconditional\framedtextlocationnone
+ \egroup
+ \box\framebox
+ \else\ifinsidefloat
+ \egroup
\box\framebox
\else
+ \egroup
\doplacement[\??kd#1][\c!depthcorrection=\v!off]{\box\framebox}%
- \fi
+ \fi\fi
\egroup}
+%D Placement can be ignored:
+%D
+%D \starttyping
+%D \hbox to \hsize \bgroup
+%D \startframedtext[none][width=.5\textwidth] \input tufte \stopframedtext
+%D \startframedtext[none][width=.5\textwidth] \input zapf \stopframedtext
+%D \egroup
+%D
+%D \hbox to \hsize \bgroup
+%D \setupframedtexts[location=none]%
+%D \startframedtext[width=.5\textwidth] \input zapf \stopframedtext
+%D \startframedtext[width=.5\textwidth] \input tufte \stopframedtext
+%D \egroup
+%D \stoptyping
+
%D The simple brace (or group) delimited case is typeset
%D slightly different and is not aligned.
@@ -3114,7 +3039,9 @@
%D Although we could have used a scratch one, we first
%D declare a boolean.
-\newif\ifbackgroundsplit
+% 0=no-split, 1=no-split+indent, 2=split, 3=split+indent
+
+\chardef\backgroundsplitmode\plusthree
%D The \type{\vbox to \lineheight{}\vskip\zeropoint}
%D construction gives the first real line a decent height by
@@ -3126,70 +3053,83 @@
\setbox0\vbox\bgroup
\vbox to \lineheight{}\vskip\zeropoint
\blank[\v!disable]
- \advance\hsize -\@@agleftoffset
- \advance\hsize -\@@agrightoffset}
+ % \advance\hsize -\@@agleftoffset
+ % \advance\hsize -\@@agrightoffset
+ \leftskip \@@agleftoffset % new **
+ \rightskip\@@agrightoffset} % new **
%D This dummy line is removed by \type{\setbox2=\vsplit0 to
%D \lineheight}. That way \type{\topskip} takes care of the
%D lineheight. I'll probably forget to apply this trick
%D elsewhere.
-\def\dostopbackground% improved version (i hope)
+\def\dostopbackground % improved version (i hope)
{\endgraf
\removelastskip
\egroup
+ \dimen2\leftskip % new **
\forgetall
- \splitmaxdepth\boxmaxdepth
- \splittopskip\topskip
- \setbox2\vsplit0 to \lineheight % get rid of fake line
- \loop
- \ifdim\pagetotal=\zeropoint % empty page
- \scratchdimen\textheight
- \chardef\backgroundsplit1 % split to max height
- \else
- \scratchdimen\pagegoal
- \setbox\scratchbox\vbox{\@@agbefore}%
- \advance\scratchdimen -\ht\scratchbox
- \advance\scratchdimen -\pagetotal
- \chardef\backgroundsplit2 % split to partial height
- \fi
- \advance\scratchdimen -\@@agtopoffset
- \advance\scratchdimen -\@@agbottomoffset \relax
- \ifdim\scratchdimen>2\lineheight\relax % reasonable, will be configurable
- \ifdim\ht0>\scratchdimen % larger than page
- \setbox2\vsplit0 to \scratchdimen
+ \ifinsidefloat
+ \chardef\backgroundsplitmode\zerocount
+ \fi
+ \ifcase\backgroundsplitmode
+ \localframed[\??ag][\c!offset=\v!overlay]{\box0}%
+ \or
+ \hskip\dimen2
+ \localframed[\??ag][\c!offset=\v!overlay]{\box0}%
+ \else
+ \splitmaxdepth\boxmaxdepth
+ \splittopskip\topskip
+ \setbox2\vsplit0 to \lineheight % get rid of fake line
+ \loop
+ \ifdim\pagetotal=\zeropoint % empty page
+ \scratchdimen\textheight
+ \chardef\backgroundsplit\plusone % split to max height
\else
- \setbox2\box0
- \chardef\backgroundsplit0 % no split
+ \scratchdimen\pagegoal
+ \setbox\scratchbox\vbox{\@@agbefore}%
+ \advance\scratchdimen -\ht\scratchbox
+ \advance\scratchdimen -\pagetotal
+ \chardef\backgroundsplit\plustwo % split to partial height
\fi
- \setbox2\vbox \ifcase\backgroundsplit\or to \textheight \fi % max split
- {\vskip\@@agtopoffset
- \popsplitproperties
- \unvcopy2
- \prevdepth\dp2
- \obeydepth
- \vskip\@@agbottomoffset
- \vfill}
- \@@agbefore
- \ifcase\backgroundsplit\or\or % partial split
-\ifdim\pagegoal<\maxdimen
- \pagegoal=1.2\pagegoal % be a bit more tolerant
-\fi
- \fi
- \startlinecorrection
- \localframed
- [\??ag][\c!offset=\v!overlay]
- {\hskip\@@agleftoffset\box2\hskip\@@agrightoffset}%
- \stoplinecorrection
- \ifcase\backgroundsplit % no split
- \@@agafter
- \else % some split
- \vfill\eject % geen \page !
+ \advance\scratchdimen -\@@agtopoffset
+ \advance\scratchdimen -\@@agbottomoffset \relax
+ \ifdim\scratchdimen>2\lineheight\relax % reasonable, will be configurable
+ \ifdim\ht0>\scratchdimen % larger than page
+ \setbox2\vsplit0 to \scratchdimen
+ \else
+ \setbox2\box0
+ \chardef\backgroundsplit\zerocount % no split
+ \fi
+ \setbox2\vbox \ifcase\backgroundsplit\or to \textheight \fi % max split
+ {\vskip\@@agtopoffset
+ \popsplitproperties
+ \unvcopy2
+ \prevdepth\dp2
+ \obeydepth
+ \vskip\@@agbottomoffset
+ \vfill}
+ \@@agbefore
+ \ifcase\backgroundsplit\or\or % partial split
+ \ifdim\pagegoal<\maxdimen
+ \pagegoal=1.2\pagegoal % be a bit more tolerant
+ \fi
+ \fi
+ \startlinecorrection
+ %\localframed[\??ag][\c!offset=\v!overlay]{\hskip\@@agleftoffset\box2\hskip\@@agrightoffset}%
+ \ifnum\backgroundsplitmode=\plusthree \hskip\dimen2 \fi %
+ \localframed[\??ag][\c!offset=\v!overlay]{\box2}% new **
+ \stoplinecorrection
+ \ifcase\backgroundsplit % no split
+ \@@agafter
+ \else % some split
+ \vfill\eject % geen \page !
+ \fi
+ \else
+ \page
\fi
- \else
- \page
- \fi
- \ifdim\ht0>\zeropoint \repeat
+ \ifdim\ht0>\zeropoint \repeat
+ \fi
\egroup
\endgraf}
@@ -3385,8 +3325,10 @@
\c!bottom=\vss,
\c!top=,
\c!strut=\v!yes,
+ \c!autostrut=\v!yes,
\c!location=\v!normal,
\c!orientation=,
+ \c!autowidth=\v!yes,
\c!setups=]
\setupscreens
diff --git a/Master/texmf-dist/tex/context/base/core-sec.tex b/Master/texmf-dist/tex/context/base/core-sec.tex
index 1d91e66e01d..c5fc5db8ac5 100644
--- a/Master/texmf-dist/tex/context/base/core-sec.tex
+++ b/Master/texmf-dist/tex/context/base/core-sec.tex
@@ -67,31 +67,37 @@
2: sfarsit de bloc sectiune --
\stopmessages
+\startmessages french library: structures
+ title: structure
+ 1: début de blocsection --
+ 2: fin de blocsection --
+\stopmessages
+
\unprotect
% from now on, internaly numbers are separated by a period
% and postprocessed on demand
\def\numberseparator {.} % reasonable default
-\def\sectionseparator{:} % was : but is now -
+\def\sectionseparator{-} % was : but is now -
-\def\@@filterfirstpart [#1::#2]{#1}
-\def\@@filtersecondpart [#1::#2]{#2}
+\def\@@filterfirstpart [#1--#2]{#1}
+\def\@@filtersecondpart [#1--#2]{#2}
-\def\@@filterblockpart [#1::#2::#3]{#1}
-\def\@@filternumberpart [#1::#2::#3]{#2}
-\def\@@filterpagepart [#1::#2::#3]{#3}
-\def\@@filterblocknumberpart[#1::#2::#3]{#1::#2}
+\def\@@filterblockpart [#1--#2--#3]{#1}
+\def\@@filternumberpart [#1--#2--#3]{#2}
+\def\@@filterpagepart [#1--#2--#3]{#3}
+\def\@@filterblocknumberpart[#1--#2--#3]{#1--#2}
-\def\@@filterheadpart[#1]{\@EA\@@dofilterheadpart\@EA[#1:0]}
-\def\@@filtertailpart[#1]{\@EA\@@dofiltertailpart\@EA[#1:0]}
+\def\@@filterheadpart[#1]{\@EA\@@dofilterheadpart\@EA[#1-0]}
+\def\@@filtertailpart[#1]{\@EA\@@dofiltertailpart\@EA[#1-0]}
-\def\@@dofilterheadpart[#1:#2]{#1}
-\def\@@dofiltertailpart[#1:#2]{#2}
+\def\@@dofilterheadpart[#1-#2]{#1}
+\def\@@dofiltertailpart[#1-#2]{#2}
-\def\@@filterlevelpart[#1::#2::#3]{\@@dofilterlevelpart[#2:0:0:0:0]}
+\def\@@filterlevelpart[#1--#2--#3]{\@@dofilterlevelpart[#2-0-0-0-0]}
-\def\@@dofilterlevelpart[#1:0:0:0:#2]{#1}
+\def\@@dofilterlevelpart[#1-0-0-0-#2]{#1}
\def\gobbleuntilrelax#1\relax{}
@@ -129,42 +135,47 @@
\def\dohandleheadnumber#1%
{\expanded{\separatednumber{#1}}}
-\def\dodochecknummer#1#2#3% will become ugly after speed up
+\def\dodochecknumber#1#2#3% will become ugly after speed up
{\bgroup
\doifinstringelse{.0}{.#2}
{\doifnot{#3}\v!by
{%\debuggerinfo\m!systems{number #1 #3 becomes \getnumbervariable{#1\c!way}}%
\setevalue{\@@thenumber{#1}\c!way}{#3}% geen \xdef, gaat mis met \subpage
- \dochecknummer{#1}}} % tricky and ugly
+ \dochecknumber{#1}}} % tricky and ugly
{\doifnotvalue{\@@thenumber{#1}\s!check}{#2}
- {\setcounter{\@@thenumber{#1}}{0\getvalue{\@@thenumber{#1}\c!start}}%
- \setxvalue{\@@thenumber{#1}\c!way\c!local}%
- {\getvalue{\@@thenumber{#1}\c!way}}%
- \setxvalue{\@@thenumber{#1}\s!check}%
- {#2}}}%
+ {% new, calculate accumulated number
+ \scratchcounter\getvalue{\@@thenumber{#1}\c!n}\relax
+ \advance\scratchcounter\countervalue{\@@thenumber{#1}}\relax
+ \setxvalue{\@@thenumber{#1}\c!n}{\the\scratchcounter}%
+ %
+ \setcounter{\@@thenumber{#1}}{0\getvalue{\@@thenumber{#1}\c!start}}%
+ \setxvalue{\@@thenumber{#1}\c!way\c!local}{\getvalue{\@@thenumber{#1}\c!way}}%
+ \setxvalue{\@@thenumber{#1}\s!check}{#2}}}%
\egroup}
-\def\dochecknummer#1%
+\def\dochecknumber#1%
{\edef\currentsection{\csname\??by\csname\@@thenumber{#1}\c!way\endcsname\endcsname}%
\ifx\currentsection\empty\else
- \dodochecknummer
+ \dodochecknumber
{#1}%
{\csname\currentsection\c!number\endcsname}%
{\v!by\previoussection\currentsection}%
\fi}
-\def\checknummer#1%
+\def\checknumber[#1]%
{\bgroup
%\ifcase\blocklevel\else
\ifdoingblocks
\doifnotvalue{\@@thenumber{#1}\c!blockway}\v!no\setblockcounters
\fi
- \dochecknummer{#1}%
+ \dochecknumber{#1}%
\egroup}
\def\rawsectionnumber#1%
{\countervalue{\??se#1}}
+\def\precedingseparator{\@@koseparator} % brrr
+
\def\domakeprecedingsectionnumber[#1]% will become ugly after speed up
{\bgroup % added
\globallet\precedingsectionnumber\empty
@@ -180,7 +191,8 @@
\doifnot\currentsection\zerosection
{\doifnot{\@@sectionvalue\currentsection}{0}
{\xdef\precedingsectionnumber%
- {\getvalue{\currentsection\c!number}.}}}%
+ {\getvalue{\currentsection\c!number}%
+ \spr{\precedingseparator}}}}%
\fi}%
\fi
\egroup}
@@ -197,7 +209,7 @@
% \def\makesectionnumber[#1]%
% {\makeprecedingsectionnumber[#1]%
-% \xdef\hetnummer%
+% \xdef\composedsectionnumber%
% {\precedingsectionnumber\convertednumber[#1]}}%
%
% hack needed for chinese and oldstyle in normal tex, will change
@@ -206,29 +218,82 @@
{\bgroup
\forceunexpanded % i don't like this hack
\makeprecedingsectionnumber[#1]%
- \xdef\hetnummer% was \xdef maar dat gaat fout met font switches
+ \xdef\composedsectionnumber% was \xdef maar dat gaat fout met font switches
{\precedingsectionnumber\convertednumber[#1]}%
\egroup}
-\def\preparethenumber#1#2#3% {\??id#1} \number \result
- {\doifelsevaluenothing{#1\c!separator}
- {\let\numberseparator\empty
- \let#3#2}
- {% was \unexpanded \edef, but we need it unexpanded !
- \edef\numberseparator{\getvalue{#1\c!separator}}%
- \edef#3{\@EA\separatednumber\@EA{#2}}}} % hm, etex
+% \def\preparethenumber#1#2#3% {\??id#1} \number \result
+% {\doifelsevaluenothing{#1\c!separator}
+% {\let\numberseparator\empty
+% \let#3#2}
+% {% was \unexpanded \edef, but we need it unexpanded !
+% \edef\numberseparator{\spr{\getvalue{#1\c!separator}}}%
+% \doifelsenothing{\executeifdefined{#1\c!suffix}\empty}
+% {\edef#3%
+% {\@EA\separatednumber\@EA{#2}%
+% }}%\stp{\getvalue{#1\c!stopper}}}}
+% {\edef#3%
+% {\@EA\separatednumber\@EA{#2}%
+% \spr{\getvalue{#1\c!separator}}%
+% \getvalue{#1\c!suffix}%
+% \stp{\getvalue{#1\c!stopper}}}}}}
+%
+% some day we do a real cleanup
+
+\def\analyzenumber#1#2#3% {\??id#1} \(precedingsection)number \result
+ {% was \unexpanded \edef, but we need it unexpanded !
+ \doifelsenothing{\executeifdefined{#1\c!suffix}\empty}
+ {\let \numbersuffix \empty}
+ {\edef\numbersuffix{\spr{\getvalue{#1\c!suffix}}}}%
+ \doifelsenothing{\executeifdefined{#1\c!stopper}\empty}
+ {\let \numberstopper \empty}
+ {\edef\numberstopper{\spr{\getvalue{#1\c!stopper}}}}%
+ \doifelsenothing{\executeifdefined{#1\c!separator}\empty}
+ {\let \numberseparator \empty}
+ {\edef\numberseparator{\spr{\getvalue{#1\c!separator}}}}%
+ \let\numberprefix\empty}
+
+\def\preparefullnumber#1#2#3% {\??id#1} \(precedingsection)number \result
+ {\analyzenumber{#1}#2#3%
+ \ifx\numberseparator\empty
+ \edef\numberprefix{#2}%
+ \else
+ \edef\numberprefix{\@EA\separatednumber\@EA{#2}}%
+ \fi
+ \ifx\numbersuffix\empty
+ \ifx\numberprefix\empty
+ \let #3\empty
+ \else
+ \edef#3{\numberprefix\numberstopper}%
+ \fi
+ \else
+ \ifx\numberprefix\empty
+ \edef#3{\numbersuffix\numberstopper}%
+ \else
+ \edef#3{\numberprefix\numberseparator\numbersuffix\numberstopper}%
+ \fi
+ \fi}
+
+\def\prepareprefixnumber#1#2#3% {\??id#1} \number \result
+ {\analyzenumber{#1}#2#3%
+ \ifx\numberseparator\empty
+ \edef\numberprefix{#2}%
+ \else
+ \edef\numberprefix{\@EA\separatednumber\@EA{#2}}%
+ \fi
+ \let#3\numberprefix}
-\def\lossenummer[#1]%
+\def\sectionnumberonly[#1]%
{\makesectionnumber[#1]%
- \hetnummer}
+ \composedsectionnumber}
\def\currentnumber[#1]% kan tekst hier weg ?
- {\dotextprefix{\getvalue{\@@thenumber{#1}\c!text}}\lossenummer[#1]}
+ {\dotextprefix{\getvalue{\@@thenumber{#1}\c!text}}\sectionnumberonly[#1]}
\def\nextnumber[#1][#2][#3]%
{\incrementnumber[#1]%
\currentnumber[#1]%
- \rawreference{#2}{#3}{\hetnummer}}
+ \rawreference{#2}{#3}{\composedsectionnumber}}
% sectioning
@@ -243,49 +308,42 @@
\makecounter{\??se\v!text}
\letvalueempty{\??se\v!text\c!before}
-\letvalueempty{\??se\v!text\c!after }
+\letvalueempty{\??se\v!text\c!after }
\setvalue {\v!text\c!number}{0}
\letvalueempty{\v!text\s!format}
\letvalueempty{\??sk\v!text}
-\letvalueempty{\??sk }
+\letvalueempty{\??sk }
-\letvalue{\??by }\v!text
-\letvalue{\??by\v!text }\v!text
-\letvalue{\??by\v!all }\v!text
-\letvalue{\??by\v!by }\v!text
-\letvalue{\??by\v!by\v!text }\v!text
+\letvalue{\??by }\v!text
+\letvalue{\??by\v!text }\v!text
+\letvalue{\??by\v!all }\v!text
+\letvalue{\??by\v!by }\v!text
+\letvalue{\??by\v!by\v!text}\v!text
\letvalue{\??by\v!by\v!all }\v!text
\letvalue{\??by\v!by\v!page}\v!text % see footnotes
-%%%%%%%%% old
-
-\def\dosetupsection[#1][#2]%
- {\getparameters[\??se#1][#2]%
- \doifelsevalue{\??se#1\c!previousnumber}\v!yes
- {\setvalue{#1\c!number}{\@@longsectionnumber{#1}}}
- {\setvalue{#1\c!number}{\@@shortsectionnumber{#1}}}}
+\def\sectionofhead#1{\executeifdefined{\??ko#1\c!section}\s!unknown}
\def\setupsection
- {\dodoubleargument\dosetupsection}
-
-%%%%%%%%% new, multilingual
-
-\def\dosetupsection[#1][#2][#3]%
- {\ifthirdargument
- \getparameters[\??se#1#2][#3]%
- \else
- \getparameters[\??se#1][#2]%
- \fi
- \doifelsevalue{\??se#1\c!previousnumber}\v!yes
- {\setvalue{#1\c!number}{\@@longsectionnumber {#1}}}
- {\setvalue{#1\c!number}{\@@shortsectionnumber{#1}}}}
-
-\def\setupsection%
{\dotripleempty\dosetupsection}
-%%%%%%%%%
+\def\dosetupsection[#1]%
+ {\doifdefinedelse{\??se#1}
+ {\dodosetupsection[#1]}%
+ {\dodosetupsection[\sectionofhead{#1}]}}
+
+\def\dodosetupsection[#1][#2][#3]%
+ {\doifdefined{\??se#1}
+ {\ifthirdargument
+ \getparameters[\??se#1#2][#3]%
+ \else
+ \getparameters[\??se#1][#2]%
+ \fi
+ \doifelsevalue{\??se#1\c!previousnumber}\v!yes
+ {\setvalue{#1\c!number}{\@@longsectionnumber {#1}}}
+ {\setvalue{#1\c!number}{\@@shortsectionnumber{#1}}}}}
\def\docouplemarking[#1][#2]%
{\doifdefinedelse{\??ko#2\c!section}
@@ -323,6 +381,7 @@
\setevalue{\??by#1}{#1}%
\setevalue{\??by\v!by#1}{#1}%
\makecounter{\??se#1}%
+ \makecounter{\??se\v!last#1}% GB
\edef\lastsection{#1}%
\setvalue{\??sk#1}{#1}%
\letvalue{\??se#1\c!marking}\empty
@@ -331,39 +390,41 @@
\def\previoussection#1{\csname\??se#1\c!before\endcsname}
\def\nextsection #1{\csname\??se#1\c!after \endcsname}
+\let\preservedsection\v!unknown % \def\preservedsection{\firstsection}
+
+\def\checkpreservevalueafter#1% GB
+ {\ifnum\getvalue{\??se#1\c!level}<\nofsections
+ \edef\preservedsection{\getvalue{\??se#1\c!after}}%
+ \ifconditional\@@resetsubheadnumbers
+ \setcounter{\??se\v!last\preservedsection}\zerocount % {0}%
+ \else
+ \setcounter{\??se\v!last\preservedsection}{\countervalue{\??se\preservedsection}}%
+ \fi
+ \fi}
+
\def\@@setsectionnumber#1#2%
{\letgvalueempty{\??se#1\s!start}% signal i.p.v. boolean
\setcounter{\??se#1}{#2}%
- \ifconditional\@@resetsubheadnumbers\resetsectioncounters{#1}\fi
+ \checkpreservevalueafter{#1}% GB
+ \resetsectioncounters{#1}%
\checkpagecounter}
-\def\@@nextsectionnumber#1%
+\def\@@nextsectionnumber#1% patched by GB
{\letgvalueempty{\??se#1\s!start}% signal i.p.v. boolean
+ \ifnum\countervalue{\??se\v!last#1}>\zerocount
+ \setcounter{\??se#1}{\countervalue{\??se\v!last#1}}%
+ \setcounter{\??se\v!last#1}\zerocount % {0}%
+ \fi
\pluscounter{\??se#1}%
- \ifconditional\@@resetsubheadnumbers\resetsectioncounters{#1}\fi
+ \checkpreservevalueafter{#1}%
+ \resetsectioncounters{#1}%
\checkpagecounter}
\def\@@sectionvalue#1% % nog niet overal doorgevoerd
{\countervalue{\??se#1}} % zoeken op \??se
-% \def\@@sectionconversion#1%
-% {\getvalue{\??cv\getvalue{\??se#1\@@sectionblock\c!conversion}}}
-
% suited for chinese too:
-% \def\@@sectionconversion#1#2% a doublure with \@@shortsectionnumber
-% {\ifnum#2=0 0\else % else troubles with \uchar
-% \@EA\ifx\csname\??se#1\@@sectionblock\c!conversion\endcsname\relax
-% \@EA\ifx\csname\??se#1\c!conversion\endcsname\relax
-% #2%
-% \else
-% \getvalue{\??cv\getvalue{\??se#1\c!conversion}}{#2}%
-% \fi
-% \else
-% \getvalue{\??cv\getvalue{\??se#1\@@sectionblock\c!conversion}}{#2}%
-% \fi
-% \fi}
-
\def\@@sectionconversion#1#2% a doublure with \@@shortsectionnumber
{\ifnum#2=0 0\else % else troubles with \uchar
\@EA\ifx\csname\??se#1\@@sectionblock\c!conversion\endcsname\relax
@@ -377,13 +438,16 @@
\fi
\fi}
+% \def\@@sectionlevel#1%
+% {\ifundefined{\??se#1\c!level}0\else\getvalue{\??se#1\c!level}\fi}
+
\def\@@sectionlevel#1%
- {\ifundefined{\??se#1\c!level}0\else\getvalue{\??se#1\c!level}\fi}
+ {\executeifdefined{\??se#1\c!level}0}
% Omdat een markering kan worden herdefinieerd moeten we
% eerst testen of er wel een keten||afhankelijkheid is.
-\def\resetsectionmarks#1%
+\def\resetsectionmarks#1% can invoke a break
{\ifundefined{\??se#1}%
\fastresetmarker[\mainmarking{#1}]% % redundant \mainmarking
\else
@@ -505,8 +569,13 @@
\fi}%
\dobacktrackcommando\lastsection}}
+% \def\ignoresectionconversion % brrr
+% {\let\@@sectionconversion\secondoftwoarguments}
+
\def\dosetfilterlevel#1#2% beware: this one is \let
{\bgroup
+ \let\@@shortsectionnumber\@@sectionvalue
+% \ignoresectionconversion
\edef\askedlevel{#1}%
\edef\askedfilter{#2}%
\ifx\askedlevel\v!current
@@ -868,7 +937,7 @@
\def\dosetlocalsectionblock#1#2#3% new \edef's
{\edef\@@sectiontype {#1}%
- \edef\@@sectionblock {#2}%
+ \edef\@@sectionblock {#2}%
\edef\@@sectionblocks{#3}}
% beware, the \resetsectionmarks generates some nodes that
@@ -1018,10 +1087,14 @@
\global\paginageblokkeerdtrue
\fi}
+% \setuphead[section][aligntitle=float] % permits title next to sidefloat
+%
+% \placefigure[left]{}{} \section{\dorecurse{10}{bagger }} \input tufte
+
\def\dohandlepagebreakAB#1% will be replaced by a more clever (signaling) mechanism (in beta)
- {\flushsidefloats
+ {\doifnotvalue{\??ko#1\c!aligntitle}\v!float\flushsidefloats
\getvalue{\??ko#1\c!before}%
- %\whitespace vervangen door \noindent elders
+ % \whitespace vervangen door \noindent elders
\relax
\ifpaginageblokkeerd
\global\paginageblokkeerdfalse
@@ -1036,12 +1109,15 @@
\dosomebreak\allowbreak
\fi
\fi
+ \doifvalue{\??ko#1\c!aligntitle}\v!float\indent
\xdef\@@kolevel{\getvalue{\??se\@@sectie\c!level}}}
\def\dohandlepagebreakBB#1#2#3%
- {\doifinset{\getvalue{\??tk#2\c!state}}{\v!normal,\v!start}
+ {%\doifinsetelse{\getvalue{\??tk#2\c!state}}{\v!normal,\v!start}
+ \doifelselayouttextline{#2}
{\doifvaluesomething{\??ko#1#3}
- {\setuplayouttext[#2][\c!state=\getvalue{\??ko#1#3}]}}}
+ {\setuplayouttext[#2][\c!state=\getvalue{\??ko#1#3}]}}
+ \donothing}
\def\dohandlepagebreakB#1%
{\doifvaluesomething{\??ko#1\c!page}
@@ -1089,6 +1165,8 @@
{\expanded{\setupalign[\getvalue{\??ko#1\c!align}]}}%
\doifvaluesomething{\??ko#1\c!tolerance} % wordt al expanded in spa
{\expanded{\setuptolerance[\getvalue{\??ko#1\c!tolerance}]}}%
+ \doifvalue{\??ko#1\c!strut}\v!no % wordt al expanded in spa
+ {\setnostrut}% new
\def\\{\crlf\strut\ignorespaces}}
\def\localkopsetup{\localheadsetup} % kan tzt weg
@@ -1103,7 +1181,7 @@
\newif\ifemptyhead
\newif\ifwritetolist
\newif\ifheadnumber
-\newif\ifcontinuoushead
+\newif\ifzushead
\newif\ifheadnumbercontent % niet meer wijzigen / wordt mode
\newif\ifheadprefix
\newif\ifsomeheadconversion
@@ -1179,33 +1257,6 @@
\setupheadnumber[#1][\foundsectionnumber]%
\setupheadnumber[#1][-1]}
-% \def\setsomeheadconversion#1#2%
-% {\someheadconversionfalse
-% \doifelsevalue{\??ko#1\c!eigennummer}\v!ja
-% {\def\someheadconversion{#2}}
-% {\bepaalkopnummer[#1]%
-% \@EA\ifx\csname\??se\@@sectie\@@sectionblock\c!kopconversie\endcsname\relax
-% \@EA\ifx\csname\??se\@@sectie\c!kopconversie\endcsname\relax
-% \def\someheadconversion{#2}%
-% \else
-% \@EA\ifx\csname\??se\@@sectie\c!kopconversie\endcsname\empty
-% \def\someheadconversion{#2}%
-% \else
-% \someheadconversiontrue
-% \def\someheadconversion%
-% {\fullsectionnumber{#1}{\getvalue{\??se\@@sectie\c!kopconversie}}{#2}}%
-% \fi
-% \fi
-% \else
-% \@EA\ifx\csname\??se\@@sectie\@@sectionblock\c!kopconversie\endcsname\empty
-% \def\someheadconversion{#2}%
-% \else
-% \someheadconversiontrue
-% \def\someheadconversion%
-% {\fullsectionnumber{#1}{\getvalue{\??se\@@sectie\@@sectionblock\c!kopconversie}}{#2}}%
-% \fi
-% \fi}}
-%
% deal with eigennummer
\def\setsomeheadconversion#1#2%
@@ -1266,23 +1317,23 @@
\let\fullsectionnumber\limitedfullsectionnumber
-% \dodododosomekop IS NON GROUPED, SO WE NEED TO RESTORE !!!!
+% \dodododoconstructhead IS NON GROUPED, SO WE NEED TO RESTORE !!!!
%
% dit kan dus beter \everyaroundhead zijn
\let\currentheadnumber\empty
\let\currentheadtext \empty
-\def\dodosomekop#1[#2]#3% [ref] {title}
+\def\dodoconstructhead#1[#2]#3% [ref] {title}
{\doifelsevalue{\??ko#1\c!ownnumber}\v!yes
- {\doquadruplegroupempty\dododosomekop{#1}{#2}{#3}}
- {\fourthargumentfalse \dododosomekop{#1}{#2}{#3}{}}}
+ {\doquadruplegroupempty\dododoconstructhead{#1}{#2}{#3}}
+ {\fourthargumentfalse \dododoconstructhead{#1}{#2}{#3}{}}}
-\def\dododosomekop#1#2#3#4% [ref] {own} {title}
+\def\dododoconstructhead#1#2#3#4% [ref] {own} {title}
{\iffourthargument
- \def\next{\dodododosomekop{#1}[#2]{#3}{#4}}%
+ \def\next{\dodododoconstructhead{#1}[#2]{#3}{#4}}%
\else
- \def\next{\dodododosomekop{#1}[#2]{\finalsectionnumber}{#3}}%
+ \def\next{\dodododoconstructhead{#1}[#2]{\finalsectionnumber}{#3}}%
\fi
\next}
@@ -1304,14 +1355,14 @@
\let\localkopprefix\empty
-% \def\headparameter#1% to do: everywhere in core-sec
-% {\csname\??ko\currenthead#1\endcsname}
+\def\headparameter#1% to do: everywhere in core-sec
+ {\csname\??ko\currenthead#1\endcsname}
-\def\dodododosomekop#1[#2]#3#4% [ref] {number} {title}
+\def\dodododoconstructhead#1[#2]#3#4% [ref] {number} {title}
{\def\currenthead{#1}% dus #1 overal vervangen
\let\finalsectionnumber\dofinalsectionnumber % overloaded ungrouped -)
\unexpanded\def\\{\space}%
- \def\numberseparator{\getvalue{\??ko\currenthead\c!separator}}%
+ \edef\numberseparator{\spr{\getvalue{\??ko\currenthead\c!separator}}}%
\flushingcolumnfloatsfalse % {number} can be \finalsectionnumber
\someheadconversionfalse
\let\fullsectionnumber\limitedfullsectionnumber
@@ -1428,16 +1479,16 @@
\rawreference\s!sec{#2}{{#3}{\asciititle}}%
\resetsectionmarks\@@sectie
\setlistparameter\@@koppeling\c!expansion{\getvalue{\??ko#1\c!expansion}}%
-\doifelsevalue{\??ko#1\c!ownnumber}\v!yes % brrr, new per 18/1/2005, sometimes we need
- {\dowritetolist\@@koppeling{#3}{#4}\v!head} % entries in the list (special purpose) but
- {\dowritetolist\@@koppeling {}{#4}\v!head}% not in the header, ok we could pop in a command
-}% \dowritetolist\@@koppeling{}{#4}\v!head}
+ \doifelsevalue{\??ko#1\c!ownnumber}\v!yes % brrr, new per 18/1/2005, sometimes we need
+ {\dowritetolist\@@koppeling{#3}{#4}\v!head} % entries in the list (special purpose) but
+ {\dowritetolist\@@koppeling {}{#4}\v!head}% not in the header, ok we could pop in a command
+ }% \dowritetolist\@@koppeling{}{#4}\v!head}
{#4}
{\marking[#1]{#4}%
\doifelsevalue{\??ko#1\c!ownnumber}\v!yes % brrr
{\edef\finalsectionnumber{#3}}
{\determineheadnumber[#1]}%
-% todo : geen markering (leeg maken)
+ % todo : geen markering (leeg maken)
\expanded{\marking[#1\v!number]{\finalsectionnumber}}}%
\writesection{#1}{-}{#4}%
\fi
@@ -1530,7 +1581,8 @@
\flushingcolumnfloatstrue
\someheadconversionfalse
\let\fullsectionnumber\limitedfullsectionnumber
- \ifdisplaysectionhead\else\expandafter\GotoPar\fi}
+ % ignorespaces prevents spaces creeping in when after=\dontleavehmode
+ \ifdisplaysectionhead\ignorespaces\else\expandafter\GotoPar\fi}
\def\forcesectiontolist#1#2%
{\ifwritetolist
@@ -1629,7 +1681,7 @@
\chardef\headtimingmode=0
-% \chardef\headtimingmode=1
+% \chardef\headtimingmode=1 % 0 also works ok now too
%
% Martin Kolarik's problem:
%
@@ -1665,7 +1717,7 @@
% outerside font determines distance
\dosetfontattribute{\??ko#1}\c!style
% but we don't want color to influence user commands
-% todo: get the if-else out of it
+ % todo: get the if-else out of it
\getvalue{\??ko#1\c!command}
{} % no number
{\dostartattributes{\??ko#1}\c!style\c!color\empty
@@ -1676,19 +1728,24 @@
\else
\setupspacing
\fi
-% overwegen \dontleavehmode, else unwanted cr due to #2
- \ifcase\headtimingmode#2\fi
+ % \ifcase\headtimingmode#2\fi % can introduce cr
\getvalue{\??ko#1\c!commandbefore}%
\placeheadmargintexts{#1}% binnen #3?
\ifdisplaysectionhead
- \getvalue{\??ko#1\c!textcommand}%
- {\setstrut\begstrut#3\endstrut}% can be nilled with \setnostrut
+ \getvalue{\??ko#1\c!textcommand}% struts can be nilled with \setnostrut
+ {\setstrut
+ \begstrut
+ \ifcase\headtimingmode\hbox{#2}\fi
+ \executeifdefined{\??ko#1\c!deeptextcommand}\firstofoneargument{#3}
+ \endstrut}% \hbox prevents break
\xdef\localheadheight {\the\strutht}%
\xdef\localheaddepth {\the\strutdp}%
\xdef\localheadlineheight{\the\lineheight}%
- % == \globallet\localheaddepth\strutdepth
+ % == \globallet\localheaddepth\strutdepth
\else
- \getvalue{\??ko#1\c!textcommand}{#3}%
+ \ifcase\headtimingmode#2\fi
+ \getvalue{\??ko#1\c!textcommand}%
+ {\executeifdefined{\??ko#1\c!deeptextcommand}\firstofoneargument{#3}}%
\fi
\getvalue{\??ko#1\c!commandafter}%
\ifdisplaysectionhead\endgraf\fi
@@ -1719,13 +1776,18 @@
\getvalue{\??ko#1\c!command}%
{\dostartattributes{\??ko#1}\c!style\c!color\empty
\dostartattributes{\??ko#1}\c!numberstyle\c!numbercolor\empty
- \getvalue{\??ko#1\c!commandbefore}%
+ % \getvalue{\??ko#1\c!commandbefore}% strange, why here? moved 21/11/2005
\placeheadmargintexts{#1}% binnen #3?
\ifdisplaysectionhead
+ % can be nilled with \setnostrut
\getvalue{\??ko#1\c!numbercommand}%
- {\setstrut\begstrut#3\endstrut}% can be nilled with \setnostrut
+ {\setstrut
+ \begstrut
+ \executeifdefined{\??ko#1\c!deepnumbercommand}\firstofoneargument{#3}%
+ \endstrut}%
\else
- \getvalue{\??ko#1\c!numbercommand}{#3}%
+ \getvalue{\??ko#1\c!numbercommand}%
+ {\executeifdefined{\??ko#1\c!deepnumbercommand}\firstofoneargument{#3}}%
\fi
\dostopattributes
\dostopattributes}
@@ -1737,18 +1799,24 @@
\else
\setupspacing
\fi
-% overwegen \dontleavehmode, else unwanted cr due to #2
- \ifcase\headtimingmode#2\fi
+ % \ifcase\headtimingmode#2\fi % can introduce cr
+ \getvalue{\??ko#1\c!commandbefore}% makes more sense here
\placeheadmargintexts{#1}% binnen #3?
\ifdisplaysectionhead
- \getvalue{\??ko#1\c!textcommand}%
- {\setstrut\begstrut#4\endstrut}% can be nilled with \setnostrut
+ \getvalue{\??ko#1\c!textcommand}% struts can be nilled with \setnostrut
+ {\setstrut
+ \begstrut
+ \ifcase\headtimingmode\hbox{#2}\fi
+ \executeifdefined{\??ko#1\c!deeptextcommand}\firstofoneargument{#4}%
+ \endstrut}% \hbox prevents break
\xdef\localheadheight {\the\strutht}%
\xdef\localheaddepth {\the\strutdp}%
\xdef\localheadlineheight{\the\lineheight}%
% == \globallet\localheaddepth\strutdepth
\else
- \getvalue{\??ko#1\c!textcommand}{#4}%
+ \ifcase\headtimingmode#2\fi % inside textcommand ?
+ \getvalue{\??ko#1\c!textcommand}%
+ {\executeifdefined{\??ko#1\c!deeptextcommand}\firstofoneargument{#4}}%
\fi
\getvalue{\??ko#1\c!commandafter}%
\ifdisplaysectionhead\endgraf\fi
@@ -1757,6 +1825,18 @@
\fi
\endheadplacement{#1}{#5}}
+%D \starttyping
+%D \def\StretchedBox#1%
+%D {\framed
+%D [frame=off,offset=.5em,align=middle,width=broad]
+%D {\sc\def\stretchedspaceamount{.3em}\stretchednormalcase{#1}}}
+%D
+%D \definehead[MySubject]
+%D \setuphead [MySubject][deeptextcommand=\StretchedBox]
+%D
+%D \MySubject{feeling stretched feeling stretched feeling stretched feeling stretched}
+%D \stoptyping
+
\newsignal\headsignal
\let\headlastlinewidth\!!zeropoint
@@ -1764,14 +1844,14 @@
{\bgroup
\setsystemmode{#1}% to be documented
\ifgridsnapping\iftracegridsnapping\showstruts\fi\fi
- \xdef\localheadheight {\the\strutht}%
- \xdef\localheaddepth {\the\strutdp}%
+ \xdef\localheadheight {\the\strutht}%
+ \xdef\localheaddepth {\the\strutdp}%
\xdef\localheadlineheight{\the\lineheight}%
% == \globallet\localheaddepth\strutdp
\everypar\emptytoks % needed indeed
\noindent % ipv \whitespace elders, na \forgetall !
\bgroup
- \doifelsevalue{\??ko#1\c!aligntitle}\v!yes % new
+ \doifinsetelse{\getvalue{\??ko#1\c!aligntitle}}{\v!yes,\v!float}% new
{\skip0 1\leftskip
\skip2 1\rightskip
\xdef\localheadskip{\the\skip0}%
@@ -1792,72 +1872,6 @@
\def\localheadsetup{\dolocalheadsetup{#1}}%
\startsynchronization}
-% \def\endheadplacement#1#2%
-% {\doifelsevalue{\??rf#1\c!state}\v!start
-% {\doifvaluenothing{\??ko#1\c!file}{\autocrossdocumentfalse}}
-% {\autocrossdocumentfalse}%
-% % no message needed here, should be a proper switch
-% % \let\unknownreference\gobbleoneargument
-% \ifdisplaysectionhead
-% \let\headlastlinewidth\!!zeropoint
-% \snaptogrid[\getvalue{\??ko#1\c!grid}]\hbox
-% {\hskip\localheadskip
-% \hskip\getvalue{\??ko#1\c!margin}\relax
-% \iflocation
-% \ifautocrossdocument
-% \doifreferencefoundelse{\getvalue{\??ko#1\c!file}::#1}
-% {\edef\currentinnerreference{\s!aut:\currenttextreference}% stored in
-% \gotoouterlocation{}{\box0}} % text slot
-% {\hbox{\box0}}%
-% \else
-% \hbox{\box0}%
-% \fi
-% \else
-% \hbox{\box0}%
-% \fi}%
-% \doflushnotes % new, not really needed
-% \endgraf
-% \nointerlineskip
-% \dosomebreak\nobreak
-% #2%
-% \else
-% \strut
-% \doflushnotes % new, here since we're in par mode
-% \iflocation
-% \ifautocrossdocument
-% \hhboxindent=\ifcontinuoushead\headlastlinewidth\else\zeropoint\fi
-% \unhhbox0\with{\gotobox{\box\hhbox}[\getvalue{\??ko#1\c!file}::#1]}%
-% \advance\lasthhboxwidth by \numberheaddistance
-% \xdef\headlastlinewidth{\the\lasthhboxwidth}%
-% \else
-% \unhbox0
-% \globallet\headlastlinewidth\!!zeropoint
-% \fi
-% \else
-% \unhbox0
-% \globallet\headlastlinewidth\!!zeropoint
-% \fi
-% #2%
-% \dimen0=\numberheaddistance
-% \hskip\dimen0 \!!plus \dimen0 \!!minus .25\dimen0
-% \hskip\headsignal\ignorespaces
-% \fi
-% \ifdisplaysectionhead \ifvmode
-% \ifgridsnapping % important, font related depth, see comment
-% \prevdepth\strutdp
-% \else
-% \prevdepth\localheaddepth
-% \fi
-% \fi \fi
-% \stopsynchronization
-% \egroup
-% \egroup
-% \ifdisplaysectionhead
-% \dochecknextindentation{\??ko#1}%
-% \else
-% \nonoindentation % recently added, was a bug
-% \fi}
-
% \setuphead[chapter] [style=\bfd,after=,hang=line] % fit broad 2
% \setuphead[section] [style=\bfc,after=,hang=line]
% \setuphead[subsection] [style=\bfb,after=,hang=line]
@@ -1894,23 +1908,25 @@
\dp0 \strutdp
\edef\localheaddepth{\the\strutdp}}
+\newconditional\continuoussectionhead % oeps, \newif\ifcontinuoushead got lost
+
\def\endheadplacement#1#2%
{\doifelsevalue{\??rf#1\c!state}\v!start
{\doifvaluenothing{\??ko#1\c!file}{\autocrossdocumentfalse}}
{\autocrossdocumentfalse}%
% no message needed here, should be a proper switch
-\noflines\zerocount
+ \noflines\zerocount
\ifdisplaysectionhead
-% new
-\processaction
- [\getvalue{\??ko#1\c!hang}]
- [ \v!line=>\hangheadplacement\noflines\zerocount,
- \v!broad=>\hangheadplacement\getnoflines\scratchdimen,
- \v!fit=>\hangheadplacement\getrawnoflines\scratchdimen,
- \v!none=>\noflines\zerocount,
- \v!default=>\noflines\zerocount,
- \v!unknown=>\hangheadplacement\noflines0\commalistelement\advance\noflines\minusone]%
-% so far
+ % new
+ \processaction
+ [\getvalue{\??ko#1\c!hang}]
+ [ \v!line=>\hangheadplacement\noflines\zerocount,
+ \v!broad=>\hangheadplacement\getnoflines\scratchdimen,
+ \v!fit=>\hangheadplacement\getrawnoflines\scratchdimen,
+ \v!none=>\noflines\zerocount,
+ \v!default=>\noflines\zerocount,
+ \v!unknown=>\hangheadplacement\noflines0\commalistelement\advance\noflines\minusone]%
+ % so far
\let\headlastlinewidth\!!zeropoint
\snaptogrid[\getvalue{\??ko#1\c!grid}]\hbox
{\hskip\localheadskip
@@ -1929,18 +1945,20 @@
\fi}%
\doflushnotes % new, not really needed
\endgraf
-\ifnum\noflines>\zerocount
- \dorecurse\noflines{\nointerlineskip\dosomebreak\nobreak\strut\endgraf}%
-\fi
- \nointerlineskip
- \dosomebreak\nobreak
+ \ifvmode
+ \ifnum\noflines>\zerocount
+ \dorecurse\noflines{\nointerlineskip\dosomebreak\nobreak\strut\endgraf}%
+ \fi
+ \nointerlineskip
+ \dosomebreak\nobreak
+ \fi
#2%
\else
\strut
\doflushnotes % new, here since we're in par mode
\iflocation
\ifautocrossdocument
- \hhboxindent=\ifcontinuoushead\headlastlinewidth\else\zeropoint\fi
+ \hhboxindent=\ifconditional\continuoussectionhead\headlastlinewidth\else\zeropoint\fi
\unhhbox0\with{\gotobox{\box\hhbox}[\getvalue{\??ko#1\c!file}::#1]}%
\advance\lasthhboxwidth by \numberheaddistance
\xdef\headlastlinewidth{\the\lasthhboxwidth}%
@@ -1978,14 +1996,14 @@
\scratchcounter=\lastpenalty\unpenalty % no beauty in this
\ifdim\lastskip=\headsignal
\handlepagebreakC{#1}%
- \global\continuousheadtrue
+ \global\settrue\continuoussectionhead
\else
\penalty\scratchcounter
- \global\continuousheadfalse
+ \global\setfalse\continuoussectionhead
#1{#2}%
\fi
\else
- \global\continuousheadfalse
+ \global\setfalse\continuoussectionhead
#1{#2}%
\fi}
@@ -2055,7 +2073,7 @@
{\setvalue{\??ko:#1}{#2}%
\setvalue{\??ko::#1}}
-\def\@@placehead
+\def\normalplacehead
{\executeifdefined
{\??ko::\numberheadalternative}
{\getvalue{\??ko::\v!normal}}}
@@ -2084,9 +2102,11 @@
{\vbox
{\localheadsetup
\begstrut % use one \strut here!
+ \dontleavehmode % in case there is no strut, else side effects with llap
\ifheadnumbercontent
- \llap{\hbox to 5em{\hfill{#1}%
- \hskip\localheadskip\hskip\leftmargindistance}}%
+ \llap{\hbox to 5em{\hfill{#1}\hskip\localheadskip\hskip\leftmargindistance}}% introduces whitespace
+ % maybe better:
+ % \inleftmargin{\hbox{\hss{#1}\hskip\localheadskip}}%
\fi
{#2}}}
@@ -2110,7 +2130,7 @@
\def\placeheadlohi#1#2#3%
{\ifheadnumbercontent
\setbox0\hbox{#2}
- \setbox2#1{\localheadsetup\advance\hsize-\wd0\relax#3}%
+ \setbox2=#1{\localheadsetup\advance\hsize-\wd0\relax#3}%
\hbox{\box0\hskip\numberheaddistance\box2}%
\else
#1{\localheadsetup\noindent#3}%
@@ -2136,6 +2156,7 @@
\c!textstyle=\getvalue{\??ko#1\c!style},
\c!numbercolor=\getvalue{\??ko#1\c!color},
\c!textcolor=\getvalue{\??ko#1\c!color}]%
+ % deeptextcommand and deepnumbercommand are left undefined !
\doifassignmentelse{#2}
{\getparameters
[\??ko#1]
@@ -2161,12 +2182,14 @@
\c!resetnumber=\v!yes,
\c!incrementnumber=\v!yes,
\c!alternative=\@@koalternative,
- \c!command=\@@placehead,
+ \c!command=\normalplacehead,
\c!separator=\@@koseparator,
+ \c!stopper=\@@kostopper,
\c!align=\@@koalign,
\c!aligntitle=\@@koaligntitle,
\c!tolerance=\@@kotolerance,
\c!indentnext=\@@koindentnext,
+ \c!strut=\@@kostrut,
\c!hang=\@@kohang,
\c!file=,
\c!expansion=,
@@ -2179,13 +2202,13 @@
{\copyparameters
[\??ko#1][\??ko\getvalue{\??ko#1\c!default}]
[\c!before,\c!after,\c!command,\c!file,\c!page,\c!continue,
- \c!header,\c!text,\c!footer,\c!separator,\c!resetnumber,
+ \c!header,\c!text,\c!footer,\c!separator,\c!stopper,\c!resetnumber,
\c!number,\c!ownnumber,\c!placehead,\c!incrementnumber,
\c!style,\c!color,\c!distance,\c!alternative,\c!indentnext,
% new per 20/03/3002 (o-pbu-l) / was too confusing
% \c!numberstyle,\c!textstyle,\c!expansion,
% again too confusing
- \c!align,\c!aligntitle,\c!tolerance,\c!grid,\c!hang,
+ \c!align,\c!aligntitle,\c!tolerance,\c!grid,\c!hang,\c!strut,
\c!numbercommand,\c!textcommand,\c!margintext,\c!margin]}}%
\getparameters[\??ko#1][#2]%
\doifsomething{\getvalue{\??ko#1\c!section}}
@@ -2194,9 +2217,7 @@
{\definemarking[#1]%
\couplemarking[#1][\getvalue{\??ko#1\c!section}]%
\definemarking[#1\v!number]%
-% klopt dit wel ?
\couplemarking[#1\v!number][\getvalue{\??ko#1\c!section}]}}%
-% \couplemarking[#1\v!nummer][\getvalue{\??ko#1\c!sectie}\v!nummer]}}%
\doifundefined{\??li#1}{\definelist[#1]}}
{\ConvertToConstant\doifelse{#1}{#2}
{\doifundefined{\??li#1}{\definelist[#1]}}
@@ -2204,16 +2225,16 @@
[\??ko#1][\??ko#2]
[\c!level,\c!section,\c!coupling,\c!prefix,
\c!before,\c!after,\c!command,\c!file,\c!page,\c!continue,
- \c!separator,
+ \c!separator,\c!stopper,
\c!header,\c!text,\c!footer,\c!resetnumber,
\c!number,\c!ownnumber,\c!placehead,\c!incrementnumber,
\c!style,\c!color,\c!distance,\c!alternative,\c!indentnext,
% new per 20/03/3002 (o-pbu-l) / was too confusing
% \c!numberstyle,\c!textstyle,\c!expansion,
% again too confusing
- \c!align,\c!aligntitle,\c!tolerance,\c!grid,\c!hang,
+ \c!align,\c!aligntitle,\c!tolerance,\c!grid,\c!hang,\c!strut,
\c!numbercommand,\c!textcommand,\c!margintext,\c!margin]%
-\getparameters[\??ko#1][\c!expansion=]% iig een value, rather fuzzy
+ \getparameters[\??ko#1][\c!expansion=]% iig een value, rather fuzzy
\definemarking[#1][#2]%
\definemarking[#1\v!number][#2\v!number]%
\doifundefined{\??li#1}{\definelist[#1][#2]}}}%
@@ -2221,13 +2242,13 @@
\setevalue{\??sk#1}{\getvalue{\??ko#1\c!coupling}}%
\setevalue{\??by#1}{\getvalue{\??ko#1\c!section}}%
\setevalue{\??by\v!by#1}{\getvalue{\??ko#1\c!section}}%
- \setvalue{#1}{\dodoubleempty\dosomekop[#1]}}
+ \setvalue{#1}{\dodoubleempty\doconstructhead[#1]}}
\def\definehead
{\dodoubleemptywithset\dodefinehead}
-\def\dosomekop[#1][#2]%
- {\dowithpargument{\dodosomekop{#1}[#2]}}
+\def\doconstructhead[#1][#2]%
+ {\dowithpargument{\dodoconstructhead{#1}[#2]}}
\def\dosetuphead[#1][#2]%
{\getparameters[\??ko#1][#2]%
@@ -2235,7 +2256,7 @@
% set \c!command to nothing and (quite natural) got the
% wrong references etc. The whole bunch should be boxed!
\expandafter\convertcommand\csname\??ko#1\c!command\endcsname\to\ascii
- \doifnothing\ascii{\setvalue{\??ko#1\c!command}{\@@placehead}}}
+ \doifnothing\ascii{\setvalue{\??ko#1\c!command}{\normalplacehead}}}
\def\setuphead
{\dodoubleargumentwithset\dosetuphead}
@@ -2267,10 +2288,12 @@
[\c!alternative=\v!normal,
\c!sectionnumber=\v!yes,
\c!separator=.,
+ \c!stopper=,
\c!limittext=\v!yes,
\c!align=,
\c!aligntitle=,
\c!tolerance=,
+ \c!strut=,
\c!indentnext=\v!no,
\c!margin=\zeropoint,
\c!hang=\v!none,
@@ -2281,50 +2304,47 @@
\definesectionblock [\v!appendix] [\v!appendices] [\c!number=\v!yes]
\definesectionblock [\v!backpart] [\v!backmatter] [\c!number=\v!no]
-\definesection[\v!sectionlevel-1] % part
-\definesection[\v!sectionlevel-2] % chapter
-\definesection[\v!sectionlevel-3] % section
-\definesection[\v!sectionlevel-4] % subsection
-\definesection[\v!sectionlevel-5] % subsubsection
-\definesection[\v!sectionlevel-6] % subsubsubsection
-\definesection[\v!sectionlevel-7] % subsubsubsubsection
+\definesection[\s!section-1] % part
+\definesection[\s!section-2] % chapter
+\definesection[\s!section-3] % section
+\definesection[\s!section-4] % subsection
+\definesection[\s!section-5] % subsubsection
+\definesection[\s!section-6] % subsubsubsection
+\definesection[\s!section-7] % subsubsubsubsection
% \c!eigennummer ook hier?
\definehead
[\v!part]
- [\c!section=\v!sectionlevel-1]
+ [\c!section=\s!section-1]
\definehead
[\v!chapter]
- [\c!section=\v!sectionlevel-2]
+ [\c!section=\s!section-2]
\definehead
[\v!section]
- [\c!section=\v!sectionlevel-3]
+ [\c!section=\s!section-3]
\definehead
[\v!subsection]
- [\c!section=\v!sectionlevel-4,
+ [\c!section=\s!section-4,
\c!default=\v!section]
\definehead
[\v!subsubsection]
- [\c!section=\v!sectionlevel-5,
- %\c!default=\v!section]
- \c!default=\v!subsection] % nieuw
+ [\c!section=\s!section-5,
+ \c!default=\v!subsection]
\definehead
[\v!subsubsubsection]
- [\c!section=\v!sectionlevel-6,
- %\c!default=\v!section]
- \c!default=\v!subsubsection] % nieuw
+ [\c!section=\s!section-6,
+ \c!default=\v!subsubsection]
\definehead
[\v!subsubsubsubsection]
- [\c!section=\v!sectionlevel-7,
- %\c!default=\v!section]
- \c!default=\v!subsubsubsection] % nieuw
+ [\c!section=\s!section-7,
+ \c!default=\v!subsubsubsection]
\definehead
[\v!title]
@@ -2363,7 +2383,7 @@
\c!incrementnumber=\v!no]
\setupsection
- [\v!sectionlevel-2]
+ [\s!section-2]
[\v!appendix\c!conversion=\v!Character,
\c!previousnumber=\v!no]
diff --git a/Master/texmf-dist/tex/context/base/core-snc.tex b/Master/texmf-dist/tex/context/base/core-snc.tex
index 55c6e15df51..ac6960f4d06 100644
--- a/Master/texmf-dist/tex/context/base/core-snc.tex
+++ b/Master/texmf-dist/tex/context/base/core-snc.tex
@@ -116,8 +116,21 @@
\def\dopresyncposition[#1][#2]{\setxvalue{\s!preset:\s!syncpos:#1}{\noexpand\dodopresyncposition{#1}{#2}}}
\def\flushsyncpositions % this order !
- {\the\presetsyncpositions
- \the\resetsyncpositions}
+ {\begingroup
+ \the\presetsyncpositions
+ \the\resetsyncpositions
+ \endgroup}
+
+\def\flushsyncxxsets#1%
+ {\setbox\scratchbox\hbox{\the#1}%
+ \ifvoid\scratchbox\else
+ \prewordbreak \let\prewordbreak\relax % only once
+ \smashbox\scratchbox
+ \box\scratchbox
+ \fi}
+
+\def\flushsyncresets {\flushsyncxxsets\resetsyncpositions }
+\def\flushsyncpresets{\flushsyncxxsets\presetsyncpositions}
% \appendtoks \flushsyncpositions \to \everypar
% \appendtoks \flushsyncpositions \to \everyheadstart
@@ -126,16 +139,6 @@
%
% \appendtoks \flushsyncpositions \to \neverypar
-\def\flushsyncxxsets#1#2%
- {\setbox\scratchbox\hbox{\the#1}%
- \ifvoid\scratchbox\else
- \smashbox\scratchbox
- #2\box\scratchbox
- \fi}
-
-\def\flushsyncresets {\flushsyncxxsets\resetsyncpositions \relax}
-\def\flushsyncpresets{\flushsyncxxsets\presetsyncpositions\prewordbreak} % check prewordbreak
-
\protect \endinput
\starttext
diff --git a/Master/texmf-dist/tex/context/base/core-spa.tex b/Master/texmf-dist/tex/context/base/core-spa.tex
index cb3363f8c09..189d98396fb 100644
--- a/Master/texmf-dist/tex/context/base/core-spa.tex
+++ b/Master/texmf-dist/tex/context/base/core-spa.tex
@@ -13,7 +13,7 @@
\writestatus{loading}{Context Spacing Macros}
-% to be sorted out: dependencies, orderof initialization
+% to be sorted out: dependencies, order of initialization
\unprotect
@@ -35,6 +35,8 @@
\appendtoks \simplesetupspacing \to \everybodyfont % nieuw
\appendtoks \setdisplayskips \to \everybodyfont % nieuw
+\appendtoks \setrelativeinterlinespace \to \everybodyfont
+
\appendtoks \updateraggedskips \to \everyfontswitch % under test
\prependtoks \let\par\endgraf \to \everypagebody % see \fillinline
@@ -171,14 +173,43 @@
\setfontparameters % redundant, can be \setstrut, test first
\updateraggedskips} % yes indeed
+% \let\currentrelativeinterlinespace\empty
+%
+% \def\setuprelativeinterlinespace[#1]%
+% {\processallactionsinset
+% [#1]
+% [ \v!on=>\oninterlineskip,
+% \v!off=>\offinterlineskip,
+% \v!reset=>\let\currentrelativeinterlinespace\empty
+% \setfontparameters,% just \setstrut, test first
+% \s!unknown=>\assignvalue{#1}\currentrelativeinterlinespace{1.00}{1.25}{1.50}%
+% \spacing\currentrelativeinterlinespace]}
+
+% \setupinterlinespace[big] \switchtobodyfont[11pt] -> forgotten
+% \setupinterlinespace[auto,big] \switchtobodyfont[11pt] -> remembered
+
+\let\currentrelativeinterlinespace\empty
+
\def\setuprelativeinterlinespace[#1]%
- {\processallactionsinset % \regelwit = dummy !
+ {\processallactionsinset
[#1]
[ \v!on=>\oninterlineskip,
\v!off=>\offinterlineskip,
- \v!reset=>\setfontparameters,% just \setstrut, test first
- \s!unknown=>\assignvalue{#1}\regelwit{1.00}{1.25}{1.50}%
- \spacing\regelwit]}
+ \v!reset=>\let\currentrelativeinterlinespace\empty
+ \let\setrelativeinterlinespace\relax
+ \setfontparameters,
+ \v!auto=>\let\setrelativeinterlinespace\dosetrelativeinterlinespace,
+ \s!unknown=>\assignvalue\commalistelement\currentrelativeinterlinespace{1.00}{1.25}{1.50}%
+ \spacing\currentrelativeinterlinespace]}
+
+\def\dosetrelativeinterlinespace
+ {\ifx\currentrelativeinterlinespace\empty\else
+ \spacing\currentrelativeinterlinespace
+ \fi}
+
+\let\setrelativeinterlinespace\relax
+
+% \appendtoks \setrelativeinterlinespace \to \everybodyfont
\def\complexsetupinterlinespace[#1]% \commalistelement ipv #1
{\doifassignmentelse{#1}\setupspecifiedinterlinespace\setuprelativeinterlinespace[#1]}
@@ -468,9 +499,21 @@
\defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi}
% happens often, so we speed this up:
+%
+% \defineblankmethod [2*\v!line] {\addblankskip+{2\openlineheight}{2\openlineheight}}
+% \defineblankmethod [2*\v!big] {\addblankskip+{2\bigskipamount }{2\openlineheight}}
+%
+% no, with 2\whatever we loose the stretch and shrink! Taco's alternative:
-\defineblankmethod [2*\v!line] {\addblankskip+{2\openlineheight}{2\openlineheight}}
-\defineblankmethod [2*\v!big] {\addblankskip+{2\bigskipamount }{2\openlineheight}}
+\defineblankmethod
+ [2*line]
+ {\addblankskip+\openlineheight\openlineheight
+ \addblankskip+\openlineheight\openlineheight}
+
+\defineblankmethod
+ [2*big]
+ {\addblankskip+\bigskipamount\openlineheight
+ \addblankskip+\bigskipamount\openlineheight}
% ETEX ! ! !
@@ -760,11 +803,14 @@
\def\noblankpsignal{1010101}
\def\inhibitgridblank % was doinhibitblank
- {\ifnum\lastpenalty<10000
- \kern-\noblanksignal % new
- \kern \noblanksignal
- \else
- \penalty\noblankpsignal
+ {\ifvmode\else\endgraf\fi
+ \ifvmode
+ \ifnum\lastpenalty<10000
+ \kern-\noblanksignal % new
+ \kern \noblanksignal
+ \else
+ \penalty\noblankpsignal
+ \fi
\fi}
\def\inhibittextblank % was inhibitblank
@@ -1206,29 +1252,58 @@
\definecomplexorsimple\setupindenting
+% \def\complexsetupindenting[#1]%
+% {\edef\currentindenting{#1}%
+% \indentfirstparagraphtrue
+% \parindent\ctxparindent
+% \chardef\indentingtoggle\zerocount
+% \processcommalist[#1]\docomplexsetupindenting
+% \ifindentfirstparagraph\else\noindentation\fi % added
+% \toggleindentation}
+
+\indentfirstparagraphtrue
+\parindent\ctxparindent
+\chardef\indentingtoggle\zerocount
+
+% \newtoks\savedeverypar \savedeverypar\everypar
+% \def\restoreeverypar{\everypar\savedeverypar}
+
+% we need a better everypar model: for each option a switch, which we
+% set to false with \forgetall and can enable when needed (context 4);
+% that way we can control the order of execution of options
+
+\def\checkeverypar % currently a hack
+ {\ifzeropt\parindent\else
+ \doifsometokselse\everypar\donothing{\appendtoks\checkindentation\to\everypar}%
+ \fi}
+
\def\complexsetupindenting[#1]%
{\edef\currentindenting{#1}%
- \indentfirstparagraphtrue
- \parindent\ctxparindent
- \chardef\indentingtoggle\zerocount
- \processcommalist[#1]\docomplexsetupindenting
- \ifindentfirstparagraph\else\noindentation\fi % added
- \toggleindentation}
-
-% \def\docomplexsetupindenting#1%
-% {\edef\!!stringa{#1}% catch #1=\somedimen
-% \convertcommand\!!stringa\to\!!stringa
-% \executeifdefined{\??in:\!!stringa}{\edef\currentindentation{#1}\simplesetupindenting}}
-
-\def\docomplexsetupindenting#1%
+ \doifsomething\currentindenting % handy when a parameter is passed
+ {% not here: \indentfirstparagraphtrue
+ % not here: \parindent\ctxparindent
+ % not here: \chardef\indentingtoggle\zerocount
+ % we use commacommand in order to catch #1 being a command (expanded parameter)
+ \processcommacommand[\currentindenting]\docomplexsetupindentingA % catch small, medium, etc
+ \processcommacommand[\currentindenting]\docomplexsetupindentingB % catch rest
+ \checkeverypar % only when non-empty #1
+ \ifindentfirstparagraph\else\noindentation\fi % added
+ \toggleindentation}}
+
+\def\docomplexsetupindentingA#1%
{\edef\!!stringa{#1}% catch #1=\somedimen
\convertcommand\!!stringa\to\!!stringa
- \executeifdefined{\??in:\!!stringa}
+ \doifundefined{\??in:\!!stringa}%
{\edef\currentindentation{#1}%
\let\normalindentation\currentindentation
\simplesetupindenting}}
-\def\simplesetupindenting % empty case
+\def\docomplexsetupindentingB#1%
+ {\edef\!!stringa{#1}% catch #1=\somedimen
+ \convertcommand\!!stringa\to\!!stringa
+ \executeifdefined{\??in:\!!stringa}\donothing}
+
+\def\simplesetupindenting % empty case, a it strange, needed this way?
{\assigndimension\currentindentation\ctxparindent{1em}{1.5em}{2em}}
\def\indenting % kind of obsolete
@@ -1248,7 +1323,8 @@
\defineindentingmethod [\v!yes] {\parindent\ctxparindent\relax} % no \indent !
\defineindentingmethod [\v!always] {\parindent\ctxparindent\relax} % no \indent !
-\defineindentingmethod [\v!never] {\parindent\zeropoint\relax} % no \indent !
+\defineindentingmethod [\v!never] {\parindent\zeropoint\relax % no \indent !
+ \chardef\indentingtoggle\zerocount}
\defineindentingmethod [\v!odd] {\chardef\indentingtoggle\plusone}
\defineindentingmethod [\v!even] {\chardef\indentingtoggle\plustwo}
@@ -1258,6 +1334,10 @@
\simplesetupindenting
\fi}
+\defineindentingmethod [\v!reset] {\indentfirstparagraphtrue
+ \parindent\zerocount
+ \chardef\indentingtoggle\zerocount}
+
\def\noindenting{\indenting[\v!no, \v!next ]}
\def\doindenting{\indenting[\v!yes,\v!first]}
@@ -1331,6 +1411,101 @@
\def\notoggleindentation
{\gdef\checkindentation{\global\indentationtrue\dotoggleindentation}}
+% we need to save the state if we want to adapt behaviour to empty lines
+%
+% \def\setlasthvmode
+% {\global\chardef\savedhvmode\ifhmode\plusone\else\ifvmode\plustwo\else\zerocount\fi\fi}
+%
+% \def\resetlasthvmode
+% {\global\chardef\savedhvmode\zerocount}
+%
+% \chardef\savedhvmode\zerocount
+
+% This is a user requested hack (using the auto-hook).
+
+\chardef\recheckindentationmode\zerocount
+
+\def\dontrechecknextindentation
+ {\global\chardef\recheckindentationmode\zerocount}
+
+\def\dorechecknextindentation
+ {\ifcase\recheckindentationmode
+ % nothing
+ \or
+ \dontrechecknextindentation
+ \expandafter\doautoindentation
+ \fi}
+
+\def\doautoindentation
+ {\doifnextcharelse\par\donothing\noindentation}
+
+\def\autoindentation
+ {\global\chardef\recheckindentationmode\plusone}
+
+%D An example of usage:
+%D
+%D \starttyping
+%D \setupindenting[small,yes]
+%D
+%D \setupitemize [indentnext=auto]
+%D \setuptyping [indentnext=auto]
+%D \setupformulas[indentnext=auto]
+%D
+%D \input tufte
+%D
+%D \startitemize
+%D \item itemize
+%D \stopitemize
+%D \input tufte
+%D
+%D \startitemize
+%D \item itemize
+%D \stopitemize
+%D
+%D \input tufte
+%D
+%D \startitemize
+%D \item itemize
+%D \stopitemize
+%D
+%D \page
+%D
+%D \input tufte
+%D
+%D \starttyping
+%D verbatim
+%D \stoptyping
+%D \input tufte
+%D
+%D \starttyping
+%D verbatim
+%D \stoptyping
+%D
+%D \input tufte
+%D
+%D \starttyping
+%D verbatim
+%D \stoptyping
+%D
+%D \page
+%D
+%D \input tufte
+%D
+%D \startformula
+%D a = b
+%D \stopformula
+%D \input tufte
+%D
+%D \startformula
+%D a = b
+%D \stopformula
+%D
+%D \input tufte
+%D
+%D \startformula
+%D a = b
+%D \stopformula
+
% \frenchspacing leidt soms tot afbreken tussen -, vandaar
% de variant \newfrenchspacing.
@@ -1431,7 +1606,7 @@
\def\godown[#1]%
{\relax
\ifhmode\endgraf\fi
- \ifvmode\nointerlineskip\vskip#1\relax}
+ \ifvmode\nointerlineskip\vskip#1\relax\fi}
%D A couple of plain macros:
@@ -1463,9 +1638,9 @@
\ifx\allowbreak\undefined
- \def\break {\penalty-\@M}
- \def\nobreak {\penalty \@M}
- \def\allowbreak{\penalty \z@}
+ \def\break {\penalty\ifhmode-\plustenthousand\else\ejectpenalty\fi}
+ \def\nobreak {\penalty \plustenthousand}
+ \def\allowbreak{\penalty \zeropoint}
\def\filbreak {\par\vfil\penalty-200\vfilneg}
\def\goodbreak {\par\penalty-500 }
@@ -1503,7 +1678,7 @@
\ifx\supereject\undefined
- \def\supereject{\par\penalty-\@MM}
+ \def\supereject{\par\penalty\superpenalty}
\fi
@@ -1796,8 +1971,8 @@
\stopbaselinecorrection}%
\vbox}
-\def\verticalstrut {\normalvbox{\hsize\zeropoint\strut}}
-\def\horizontalstrut{\normalhbox {\strut}}
+\def\verticalstrut {\normalvbox{\hsize\zeropoint\forgetall\strut}}
+\def\horizontalstrut{\normalhbox {\strut}}
% Hieronder volgen enkele instellingen en macro's ten behoeve
% van de interlinie en \strut. De waarden 2.8, 0.07, 0.72 en
@@ -2112,30 +2287,33 @@
% \edef\strutdepth{\the\strutdimen}%
% \dosetstrut}
+% interesting, strudepth is 4.05064pt vs 4.05066pt depending on grid
+% nasty rounding problem
+
\def\setstrut
{% height
\strutdimen\normallineheight
-\ifdim\minimumstrutheight>\zeropoint
- \strutdimen\minimumstrutheight
-\else
- \strutdimen\strutheightfactor\strutdimen
-\fi
+ \ifdim\minimumstrutheight>\zeropoint
+ \strutdimen\minimumstrutheight
+ \else
+ \strutdimen\strutheightfactor\strutdimen
+ \fi
\strutdimen\spacingfactor\strutdimen
\edef\strutheight{\the\strutdimen}%
% depth
\strutdimen\normallineheight
\ifgridsnapping
-\ifdim\minimumstrutdepth>\zeropoint
- \strutdimen\minimumstrutdepth
-\else
- \advance\strutdimen-\strutheight
-\fi
+ \ifdim\minimumstrutdepth>\zeropoint
+ \strutdimen\minimumstrutdepth
+ \else
+ \advance\strutdimen-\strutheight
+ \fi
\else
-\ifdim\minimumstrutdepth>\zeropoint
- \strutdimen\minimumstrutdepth
-\else
- \strutdimen\strutdepthfactor\strutdimen
-\fi
+ \ifdim\minimumstrutdepth>\zeropoint
+ \strutdimen\minimumstrutdepth
+ \else
+ \strutdimen\strutdepthfactor\strutdimen
+ \fi
\strutdimen\spacingfactor\strutdimen
\fi
\edef\strutdepth{\the\strutdimen}%
@@ -2159,6 +2337,20 @@
\def\setcapstrut% could be M, but Q has descender
{\setcharstrut{Q}}
+%D Handy for math (used in mathml):
+
+\def\charhtstrut
+ {\begingroup
+ \setcharstrut{GJY}%
+ \vrule\!!width\zeropoint\!!depth\zeropoint\!!height\strutht
+ \endgroup}
+
+\def\chardpstrut
+ {\begingroup
+ \setcharstrut{gjy}%
+ \vrule\!!width\zeropoint\!!depth\strutdp\!!height\zeropoint
+ \endgroup}
+
%D Centered looks nicer:
\def\dosetstrut
@@ -2226,7 +2418,7 @@
% \def\begstrut
% {\relax\ifcase\strutht\else
% \strut
-% \normalpenalty\@M % \!!tenthousand
+% \normalpenalty\plustenthousand
% \normalhskip\zeropoint
% \ignorespaces
% \fi}
@@ -2234,7 +2426,7 @@
% \def\endstrut
% {\relax\ifhmode\ifcase\strutht\else
% \removeunwantedspaces
-% \normalpenalty\@M % \!!tenthousand
+% \normalpenalty\plustenthousand
% \normalhskip\zeropoint
% \strut
% \fi\fi}
@@ -2248,15 +2440,15 @@
{\relax\ifcase\strutht\else
\ifconditional\sigstruts
\noindent\horizontalstrut
- \normalpenalty\@M % \!!tenthousand
+ \normalpenalty\plustenthousand
\normalhskip-\strutsignal
\normalhskip\strutsignal
\else
\strut
- \normalpenalty\@M % \!!tenthousand
+ \normalpenalty\plustenthousand
\normalhskip\zeropoint
\fi
- \ignorespaces
+ \expandafter \ignorespaces
\fi}
\def\endstrut
@@ -2265,13 +2457,13 @@
\ifdim\lastskip=\strutsignal
\unskip\unskip\unpenalty\setbox\scratchbox\lastbox
\else
- \normalpenalty\@M % \!!tenthousand
+ \normalpenalty\plustenthousand
\normalhskip\zeropoint
\strut
\fi
\else
\removeunwantedspaces
- \normalpenalty\@M % \!!tenthousand
+ \normalpenalty\plustenthousand
\normalhskip\zeropoint
\strut
\fi
@@ -2283,7 +2475,8 @@
{\setbox\strutbox\copy\nostrutbox
\let\strut\empty
\let\endstrut\empty
- \let\begstrut\empty}
+ \let\begstrut\empty
+ \let\crlfplaceholder\empty}
% unsave:
%
@@ -2420,7 +2613,7 @@
\def\keeplinestogether#1%
{\xdef\restoreinterlinepenalty{\global\resetpenalties\interlinepenalties}%
- \global\setpenalties\interlinepenalties{#1}\!!tenthousand}
+ \global\setpenalties\interlinepenalties{#1}\plustenthousand}
\endETEX
@@ -2430,17 +2623,21 @@
{\xdef\restoreinterlinepenalty
{\global\let\restoreinterlinepenalty\relax
\global\interlinepenalty=\the\interlinepenalty}% keep = here
- \global\interlinepenalty\!!tenthousand}
+ \global\interlinepenalty\plustenthousand}
\endTEX
\newif\ifgridsnapping % to be sure
-\def\defaultwidowpenalty {2000} % was: 1000
-\def\defaultclubpenalty {2000} % was: 800
+\def\defaultwidowpenalty {2000} % was: 1000
+\def\defaultclubpenalty {2000} % was: 800
+\def\defaultdisplaywidowpenalty {50}
+\def\defaultbrokenpenalty {100}
-\def\defaultgridwidowpenalty {0}
-\def\defaultgridclubpenalty {0}
+\def\defaultgridwidowpenalty {0}
+\def\defaultgridclubpenalty {0}
+\def\defaultgriddisplaywidowpenalty {0}
+\def\defaultgridbrokenpenalty {0}
% The original approach:
%
@@ -2466,29 +2663,35 @@
\adjdemerits \zerocount}
\def\setdefaultpenalties
- {\setups[\systemsetupsprefix\s!default]}
+ {\directsetup{\systemsetupsprefix\s!default}}
-\startsetups [\systemsetupsprefix\v!reset]
+\startsetups [\systemsetupsprefix\s!reset]
\resetpenalties\widowpenalties
\resetpenalties\clubpenalties
\resetpenalties\interlinepenalties
\stopsetups
+% we use \directsetup because it's faster and we know there is no csl
+
\startsetups [\systemsetupsprefix\s!default]
- \setups[\systemsetupsprefix\s!reset]
+ \directsetup{\systemsetupsprefix\s!reset}
- \widowpenalty\defaultwidowpenalty
- \clubpenalty \defaultclubpenalty
+ \widowpenalty \defaultwidowpenalty
+ \clubpenalty \defaultclubpenalty
+ \displaywidowpenalty\defaultdisplaywidowpenalty
+ \brokenpenalty \defaultbrokenpenalty
\stopsetups
\startsetups [\v!grid] [\systemsetupsprefix\s!default]
- \setups[\systemsetupsprefix\v!reset]
+ \directsetup{\systemsetupsprefix\s!reset}
- \widowpenalty\defaultgridwidowpenalty
- \clubpenalty \defaultgridclubpenalty
+ \widowpenalty \defaultgridwidowpenalty
+ \clubpenalty \defaultgridclubpenalty
+ \displaywidowpenalty\defaultgriddisplaywidowpenalty
+ \brokenpenalty \defaultgridbrokenpenalty
\stopsetups
@@ -2496,7 +2699,7 @@
\startsetups [\systemsetupsprefix\v!strict]
- \setups[\v!reset]
+ \directsetup{\systemsetupsprefix\s!reset}
\setpenalties\widowpenalties2\maxdimen
\setpenalties\clubpenalties 2\maxdimen
@@ -2639,8 +2842,21 @@
\def\dosetraggedcommand#1%
{\expanded{\dodosetraggedcommand{#1}}}
+% \def\dodosetraggedcommand#1% beware: #1=empty is ignored, keep that!
+% {\let\raggedcommand \relax
+% \let\raggedtopcommand \empty
+% \let\raggedbottomcommand\empty
+% \chardef\raggedoneliner\zerocount
+% \doifsomething{#1}
+% {\doifinsetelse\v!broad{#1}\!!doneatrue\!!doneafalse
+% \doifinsetelse\v!wide {#1}\!!donebtrue\!!donebfalse
+% \!!donectrue
+% \rawprocesscommalist[#1]\dododosetraggedcommand}}
+
+\newtoks\everyraggedcommand \def\raggedcommand{\the\everyraggedcommand}
+
\def\dodosetraggedcommand#1% beware: #1=empty is ignored, keep that!
- {\let\raggedcommand \relax
+ {\everyraggedcommand \emptytoks
\let\raggedtopcommand \empty
\let\raggedbottomcommand\empty
\chardef\raggedoneliner\zerocount
@@ -2655,23 +2871,38 @@
\def\@@ragged@@command{@@raggedcommand}
+\setvalue{\@@ragged@@command\v!hanging }{\appendtoks\enableprotruding \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!nothanging }{\appendtoks\disableprotruding \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!hz }{\appendtoks\enableadjusting \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!nohz }{\appendtoks\disableadjusting \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!spacing }{\appendtoks\enablespacehandling
+ \enablekernhandling \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!nospacing }{\appendtoks\disablespacehandling
+ \disablekernhandling \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!hyphenated }{\appendtoks\dohyphens \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!nothyphenated}{\appendtoks\nohyphens \to\everyraggedcommand}
+
+\setvalue{\@@ragged@@command\v!tolerant }{\appendtoks\tolerance3000\relax \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!verytolerant}{\appendtoks\tolerance4500\relax \to\everyraggedcommand}
+\setvalue{\@@ragged@@command\v!stretch }{\appendtoks\emergencystretch\bodyfontsize\to\everyraggedcommand}
+
\setvalue{\@@ragged@@command\v!left}%
- {\if!!donea \def\raggedcommand{\veryraggedleft}%
- \else \def\raggedcommand{\raggedleft}%
+ {\if!!donea \appendtoks\veryraggedleft\to\everyraggedcommand
+ \else \appendtoks\raggedleft \to\everyraggedcommand
\fi
\!!donecfalse}
\setvalue{\@@ragged@@command\v!right}%
- {\if!!donea \def\raggedcommand{\veryraggedright}%
- \else \def\raggedcommand{\raggedright}%
+ {\if!!donea \appendtoks\veryraggedright\to\everyraggedcommand
+ \else \appendtoks\raggedright \to\everyraggedcommand
\fi
\!!donecfalse}
\setvalue{\@@ragged@@command\v!middle}%
{\if!!donec
- \if!!doneb \def\raggedcommand{\raggedwidecenter}%
- \else\if!!donea \def\raggedcommand{\veryraggedcenter}%
- \else \def\raggedcommand{\raggedcenter}%
+ \if!!doneb \appendtoks\raggedwidecenter\to\everyraggedcommand
+ \else\if!!donea \appendtoks\veryraggedcenter\to\everyraggedcommand
+ \else \appendtoks\raggedcenter \to\everyraggedcommand
\fi\fi
\!!donecfalse
\else
@@ -2694,13 +2925,13 @@
\let\raggedtopcommand\vfilll} % ugly laho (lohi)
\setvalue{\@@ragged@@command\v!no}%
- {\def\raggedcommand{\raggedright}}
+ {\appendtoks\raggedright\to\everyraggedcommand}
\setvalue{\@@ragged@@command\v!yes}%
- {\let\raggedcommand\notragged}
+ {\appendtoks\notragged\to\everyraggedcommand}
\setvalue{\@@ragged@@command\v!normal}%
- {\let\raggedcommand\notragged}
+ {\appendtoks\notragged\to\everyraggedcommand}
\setvalue{\@@ragged@@command\v!inner}% not yet perfect
{\signalrightpage % may interfere
@@ -2714,33 +2945,44 @@
{\getvalue{\@@ragged@@command\v!left}}
{\getvalue{\@@ragged@@command\v!right}}}
+% compare:
+%
+% \framed[width=4cm,align=no] {\hfil xxx}
+% \framed[width=4cm,align=disable]{\hfil xxx}
+
+\setvalue{\@@ragged@@command\v!disable}% for one liners
+ {\appendtoks\raggedright\parfillskip\zeropoint\to\everyraggedcommand}
+
\chardef\raggedoneliner\zerocount
\setvalue{\@@ragged@@command\v!line}%
{\chardef\raggedoneliner\plusone}
-\def\@@startraggedoneliner
- {\ifcase\raggedoneliner\else
- \dontleavehmode\hbox\bgroup
- \ifcase\raggedstatus\or\hss\or\hss\fi
- \ignorespaces
- \bgroup
- \aftergroup\removeunwantedspaces
- \fi}
+%D Unofficial, may disappear. Now handled directly in the
+%D core-rul module.
-\def\@@stopraggedoneliner
- {\ifcase\raggedoneliner\else
- \egroup
- \ifcase\raggedstatus\or\hss\or\or\hss\fi
- \egroup
- \ignorespaces
- \fi}
+% \def\@@startraggedoneliner
+% {\ifcase\raggedoneliner\else
+% \dontleavehmode\hbox to \hsize \bgroup % hsize added, else useless
+% \ifcase\raggedstatus\or\hss\or\hss\fi
+% \ignorespaces
+% \bgroup
+% \aftergroup\removeunwantedspaces
+% \fi}
-\def\@@handleoneliner
- {\ifcase\raggedoneliner\else
- \@@startraggedoneliner
- \aftergroup\@@stopraggedoneliner
- \fi}
+% \def\@@stopraggedoneliner
+% {\ifcase\raggedoneliner\else
+% \egroup
+% \ifcase\raggedstatus\or\or\hss\or\hss\fi
+% \egroup
+% \ignorespaces % ? ? ?
+% \fi}
+
+% \def\@@handleoneliner
+% {\ifcase\raggedoneliner\else
+% \@@startraggedoneliner
+% \aftergroup\@@stopraggedoneliner
+% \fi}
% Nodig i.v.m. inspringen eerste alineas
@@ -2922,12 +3164,26 @@
\endETEX
+\newconditional \parbasedattributes
+
+\def\finishparbasedattributes
+ {\ifconditional\parbasedattributes
+ \setfalse\parbasedattributes
+ \par
+ \fi}
+
+\def\dostopparbasedattributes
+ {\settrue\parbasedattributes
+ \dostopattributes}
+
\unexpanded\def\@@dostopattributes
{\stopcolor
+ \finishparbasedattributes
\endgroup}
\unexpanded\def\@@nostopattributes
- {\endgroup}
+ {\finishparbasedattributes
+ \endgroup}
\unexpanded\def\doattributes#1#2#3#4%
{\dostartattributes{#1}{#2}{#3}{#4}\dostopattributes}
@@ -2950,10 +3206,12 @@
%
% \unexpanded\def\@@dostopattributes%
% {\stopcolor
+% \finishparbasedattributes
% \endgroup}
%
% \unexpanded\def\@@nostopattributes%
-% {\endgroup}
+% {\finishparbasedattributes
+% \endgroup}
\unexpanded\def\dostartattributes#1#2#3%
{\begingroup % geen \bgroup, anders in mathmode lege \hbox
@@ -2974,10 +3232,12 @@
\unexpanded\def\@@dostopattributes
{\doglobalstopcolor
+ \finishparbasedattributes
\endgroup}
\unexpanded\def\@@nostopattributes
- {\endgroup}
+ {\finishparbasedattributes
+ \endgroup}
\endETEX
@@ -3127,13 +3387,13 @@
%
% \def\setraggedparagraphmode#1#2% combineren met \ifrightpage
% {\ifinpagebody
-% \ifdubbelzijdig
+% \ifdoublesided
% \ifodd\realpageno\relax#1\else#2\fi
% \else
% #2\relax
% \fi
% \else\ifinner
-% \ifdubbelzijdig
+% \ifdoublesided
% \gettwopassdata\s!paragraph
% \iftwopassdatafound
% \ifodd\twopassdata\relax#1\else#2\fi
@@ -3151,7 +3411,7 @@
% \def\doifrightpageelse % watch out: other default ! ! !
% {\ifinpagebody
% % optimalisation ?
-% \ifdubbelzijdig
+% \ifdoublesided
% \ifodd\realpageno\relax
% \twopassdatafoundtrue \else \twopassdatafoundfalse
% \fi
@@ -3159,7 +3419,7 @@
% \twopassdatafoundtrue
% \fi
% \else
-% \ifdubbelzijdig
+% \ifdoublesided
% \gettwopassdata\s!paragraph
% \iftwopassdatafound
% \ifodd\twopassdata\relax
@@ -3181,7 +3441,7 @@
% \fi}
%
% \def\signalrightpage
-% {\ifdubbelzijdig \ifinpagebody \else
+% {\ifdoublesided \ifinpagebody \else
% \doparagraphreference
% \fi \fi}
@@ -3193,7 +3453,7 @@
\chardef \frozenpagestate \zerocount
\def\dotrackpagestate#1#2%
- {\ifdubbelzijdig \ifinpagebody \else
+ {\ifdoublesided \ifinpagebody \else
\doforcedtrackpagestate{#1}{#2}%
\fi \fi}
@@ -3213,14 +3473,14 @@
\pagestatemismatchfalse
\let\realpagestateno\realfolio
\ifinpagebody
- \ifdubbelzijdig
+ \ifdoublesided
\ifodd\realpageno\relax
\twopassdatafoundtrue \else \twopassdatafoundfalse
\fi
\else
\twopassdatafoundtrue
\fi
- \else\ifdubbelzijdig
+ \else\ifdoublesided
\findtwopassdata{#1}{#2:}%
\iftwopassdatafound
\let\realpagestateno\twopassdata
@@ -3435,7 +3695,7 @@
% \hyphenpenalty = ( 2.5 * \hsize ) / \raggedness
% \tolerance >= 1500 % was 200
-% \raggedness = 2 .. 6\korpsgrootte
+% \raggedness = 2 .. 6\bodyfontsize
\chardef\raggedstatus=0 % normal left center right
@@ -3443,6 +3703,8 @@
\def\rightraggedness {2\bodyfontsize}
\def\middleraggedness {6\bodyfontsize}
+\def\middleraggedness {.5\hsize} % was: 6\bodyfontsize, fails on: \placefigure{x $x=x$ x}{}
+
%D More hyphenation control, will be combined with align
%D setup.
@@ -3452,8 +3714,8 @@
{\hyphenpenalty\the\hyphenpenalty
\exhyphenpenalty\the\exhyphenpenalty\relax}%
\fi
- \hyphenpenalty\@M
- \exhyphenpenalty\@M}
+ \hyphenpenalty\plustenthousand
+ \exhyphenpenalty\plustenthousand}
\let\dohyphens\relax
@@ -3663,13 +3925,17 @@
\setvalue{@@align@@\v!nothanging }{\disableprotruding}
\setvalue{@@align@@\v!hz }{\enableadjusting}
\setvalue{@@align@@\v!nohz }{\disableadjusting}
-\setvalue{@@align@@\v!spacing }{\enablespacehandling}
-\setvalue{@@align@@\v!nospacing }{\disablespacehandling}
+\setvalue{@@align@@\v!spacing }{\enablespacehandling \enablekernhandling}
+\setvalue{@@align@@\v!nospacing }{\disablespacehandling\disablekernhandling}
\setvalue{@@align@@\v!hyphenated }{\dohyphens}
\setvalue{@@align@@\v!nothyphenated}{\nohyphens}
\setvalue{@@align@@\v!new }{\@@asraggedfalse} % so new will give you consistency
\setvalue{@@align@@\v!reset }{\notragged\normalbottom}
+\setvalue{@@align@@\v!tolerant }{\tolerance3000 \relax}
+\setvalue{@@align@@\v!verytolerant}{\tolerance4500 \relax}
+\setvalue{@@align@@\v!stretch }{\emergencystretch\bodyfontsize}
+
\setvalue{@@ngila@@\v!broad }{\!!doneatrue}
\setvalue{@@ngila@@\v!wide }{\!!donebtrue}
@@ -3707,14 +3973,14 @@
% see later for the real definition, which in the simple case is:
\def\doalignline#1#2% \\ == newline
- {\bgroup
+ {\begingroup
\setlocalhsize % new
\def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
\dowithnextbox
- {\noindent
+ {\noindentation % was \ noindent
\hbox to \localhsize
{\ifcase\alignstrutmode\or\strut\fi
- #1\unhbox\nextbox#2}\egroup}
+ #1\unhbox\nextbox#2}\endgroup}
\hbox}
% directe commando's
@@ -4248,6 +4514,22 @@
\doglobal\appendtoks#2\to\everyfirstparagraphintro
\doglobal\appendtoks#2\to\everynextparagraphintro]}
+%D We can say:
+%D
+%D \starttyping
+%D \setupparagraphintro[first][\index{Knuth}]
+%D \stoptyping
+%D
+%D Maybe more convenient is:
+%D
+%D \starttyping
+%D \flushatparagraph{\index{Zapf}}
+%D \stoptyping
+
+\def\flushatparagraph#1%
+ {\global\chardef\everyparagraphintro\plusone
+ \global\appendtoks{#1}\to\everyfirstparagraphintro}
+
% \def\doinsertparagraphintro
% {\ifcase\everyparagraphintro\relax
% % no data
@@ -4383,9 +4665,39 @@
\def\fixedspaceamount#1%
{#1\fontdimen2\font}
+%D This is a dangerous feature because it makes the \TEX\ source
+%D less portable, i.e. any parser now needs to apply exactly the
+%D same algorithm when it wants to interpret the source. We
+%D strongly recommend not to mention this feature in manuals! It's
+%D provided for users who are hooked to such a mechanism.
+%D
+%D \starttyping
+%D \setupsorting[logo][next=\autoinsertnextspace] \logo[TEX]{\TeX}
+%D
+%D bla bla \TEX bla bla \TEX (bla) bla (\TEX)
+%D \stoptyping
+
+\def\autoinsertnextspace{\futurelet\nexttoken\doautoinsertnextspace}
+
+\def\doautoinsertnextspace % slightly extended version of a user supplied macro
+ {\ifx\nexttoken \bgroup\else \ifx\nexttoken\begingroup\else
+ \ifx\nexttoken \egroup\else \ifx\nexttoken \endgroup\else
+ \ifx\nexttoken \/\else \ifx\nexttoken /\else \ifx\nexttoken ~\else
+ \ifx\nexttoken \ \else \ifx\nexttoken \blankspace\else \ifx\nexttoken \space\else
+ \ifx\nexttoken .\else \ifx\nexttoken ,\else
+ \ifx\nexttoken !\else \ifx\nexttoken ?\else
+ \ifx\nexttoken :\else \ifx\nexttoken ;\else
+ \ifx\nexttoken '\else \ifx\nexttoken "\else
+ \ifx\nexttoken )\else \ifx\nexttoken -\else \ifx\nexttoken |\else
+ \ifx\nexttoken \%\else \ifx\nexttoken \&\else
+ \space
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+
\setupwhitespace
[\v!none]
+% still old-fachioned
+
\indenting
[\v!never]
diff --git a/Master/texmf-dist/tex/context/base/core-syn.tex b/Master/texmf-dist/tex/context/base/core-syn.tex
index 0b6685a30ef..7e7974d3b29 100644
--- a/Master/texmf-dist/tex/context/base/core-syn.tex
+++ b/Master/texmf-dist/tex/context/base/core-syn.tex
@@ -55,6 +55,8 @@
{\setvalue{#1\s!entry}{\getvalue{\??sm#1\c!command}}} % 3 argumenten
{\setvalue{#1\s!entry}{\dohandlesynonymentry{#1}}}}
+\def\synonymparameter#1{\csname\??sm\currentsynonym#1\endcsname}
+
\def\doplacelistofsynonyms#1#2%
{\whitespace
\begingroup
@@ -110,15 +112,30 @@
\immediatewriteutility{s e {#1} {#2} {\asciisynonym} {\asciimeaning}}%
\endgroup}
+% \def\preexecutesynonym#1#2#3#4%
+% {\ifdoinpututilities \else
+% \dowritesynonym{#1}{#2}{#3}{#4}%
+% \unexpanded\setgvalue{#2}{\processsynonym{#1}{#3}{#4}}%
+% \fi}
+%
+% \def\executesynonym#1#2#3#4%
+% {\preexecutesynonym{#1}{#2}{#3}{#4}%
+% \processsynonym{#1}{#3}{#4}}
+
+\def\reprocesssynonym#1#2#3%
+ {\processsynonym{#1}{#2}{#3}%
+ \getvalue{\??sm#1\c!next}} % not formally documented
+
\def\preexecutesynonym#1#2#3#4%
{\ifdoinpututilities \else
\dowritesynonym{#1}{#2}{#3}{#4}%
- \unexpanded\setgvalue{#2}{\processsynonym{#1}{#3}{#4}}%
+ \unexpanded\setgvalue{#2}{\reprocesssynonym{#1}{#3}{#4}}%
\fi}
\def\executesynonym#1#2#3#4%
{\preexecutesynonym{#1}{#2}{#3}{#4}%
- \processsynonym{#1}{#3}{#4}}
+ \processsynonym{#1}{#3}{#4}%
+ \getvalue{\??sm#1\c!next}} % not formally documented
\def\expandsynonym#1#2#3#4%
{{\synonymmeaningtrue
@@ -161,6 +178,10 @@
\dodocomplexsynonym[#2][#1#4]{#4}{#5}%
\fi}
+\def\doregistersynonymlanguage#1%
+ {\savesortlanguage{\getvalue{\??sm#1\s!language}}%
+ \immediatewriteutility{s l {#1} {\getvalue{\??sm#1\s!language}}}}
+
\def\dodefinesynonyms[#1][#2][#3][#4]%
{\iffourthargument
\unexpanded\def#4##1{\getsynonymmeaning{#1}{\??sm:#1:}{##1}}%
@@ -182,7 +203,11 @@
\c!sample=,\c!hang=,\c!align=,
\c!before=,\c!inbetween=,\c!after=,
\c!indentnext=\v!no,
- \c!expansion=]%
+ \c!expansion=,
+ \s!language=\currentmainlanguage]%
+ \doglobal\appendtoksonce
+ \doregistersynonymlanguage{#1}%
+ \to \everysavesortkeys
\presetheadtext[#2=\Word{#2}]% changes the \if...argument
\addutilityreset{#1}%
\setvalue{\e!setup #2\e!endsetup}{\dodoubleargument\getparameters[\??sm#1]}% to be obsolete
@@ -234,16 +259,28 @@
\endgroup
\ifutilitydone\else\nowhitespace\fi}
+% to be tested
+%
+% \def\doplacelistofsorts#1% NOG EEN RUWE VERSIE MAKEN
+% {\startpacked
+% \doutilities{#1}\jobname{#1}\relax\par
+% \stoppacked}
+
\def\docompletelistofsorts#1#2%
{\expanded{\systemsuppliedchapter[#1]{\noexpand\headtext{#2}}}%
\doplacelistofsorts{#1}%
\page[\v!yes]}
+% todo:
+%
+% \def\placelistofsorts[#1]%
+% {\doplacelistofsorts{#1}}
+
\def\processsort#1#2#3%
{\explicithmode
- \bgroup
+ \begingroup % was \bgroup
\doattributes{\??so#1}\c!style\c!color{#2}%
- \egroup}
+ \endgroup} % was \egroup
\def\dowritesort#1#2#3%
{\bgroup
@@ -254,18 +291,36 @@
\def\synonymentry#1%
{\executeifdefined{#1\s!entry}\gobblethreearguments}
+% \def\preexecutesort#1#2#3%
+% {\ifdoinpututilities \else
+% \dowritesort{#1}{#2}{#3}%
+% \unexpanded\setgvalue{#2}{\processsort{#1}{#3}{#2}}%
+% \fi}
+%
+% \def\executesort#1#2#3%
+% {\begingroup
+% \let\executesort\thirdofthreearguments % Trick needed for nested logo's.
+% \preexecutesort{#1}{#2}{#3}%
+% \processsort{#1}{#3}{#2}%
+% \endgroup}
+
+\def\reprocesssort#1#2#3%
+ {\processsort{#1}{#2}{#3}%
+ \getvalue{\??so#1\c!next}}
+
\def\preexecutesort#1#2#3%
{\ifdoinpututilities \else
\dowritesort{#1}{#2}{#3}%
- \unexpanded\setgvalue{#2}{\processsort{#1}{#3}{#2}}%
+ \unexpanded\setgvalue{#2}{\reprocesssort{#1}{#3}{#2}}%
\fi}
\def\executesort#1#2#3%
- {\bgroup
- \def\executesort##1##2##3{##3}% Trick needed for nested logo's.
+ {\begingroup
+ \let\executesort\thirdofthreearguments % Trick needed for nested logo's.
\preexecutesort{#1}{#2}{#3}%
\processsort{#1}{#3}{#2}%
- \egroup}
+ \endgroup
+ \getvalue{\??so#1\c!next}} % not formally documented
\def\doloadsort#1%
{\setvalue{#1\s!entry}##1##2##3%
@@ -299,6 +354,10 @@
% if #3=\relax or \v!none, then no command but still protected
+\def\doregistersortinglanguage#1%
+ {\savesortlanguage{\getvalue{\??so#1\s!language}}%
+ \immediatewriteutility{s l {#1} {\getvalue{\??so#1\s!language}}}}
+
\def\dodefinesorting[#1][#2][#3]%
{\getparameters[\??so#1]
[%\c!command=, % we test for defined !
@@ -307,7 +366,11 @@
\c!style=,
\c!before=,
\c!after=\endgraf,
- \c!expansion=]%
+ \c!expansion=,
+ \s!language=\currentmainlanguage]%
+ \doglobal\appendtoksonce
+ \doregistersortinglanguage{#1}%
+ \to \everysavesortkeys
\ifthirdargument
\ConvertConstantAfter\doifnot{#3}\v!none
{\ifx#3\relax \else
@@ -330,6 +393,33 @@
\def\definesorting
{\dotripleempty\dodefinesorting}
+%D Here we define a support macro that can sort simple comma
+%D separated lists. It's a multi-list variant of a prototype
+%D written by Taco.
+
+\def\processlistofsorts[#1]%
+ {\doutilities{#1}\jobname{#1}\donothing\donothing}
+
+\newcounter\nofsortedalphalists
+
+\def\sortalphacommacommand#1%
+ {\begingroup
+ \doglobal\increment\nofsortedalphalists
+ \edef\currentsortedalphalist{alpha:\nofsortedalphalists}%
+ \definesorting[\currentsortedalphalist][\currentsortedalphalist]%
+ \processcommacommand[#1]{\getvalue\currentsortedalphalist}%
+ \global\let\sortedcommalist\empty
+ \def\makesortedlist##1{\doglobal\appendtocommalist{##1}\sortedcommalist}%
+ \setupsorting[\currentsortedalphalist][\c!criterium=\v!all,\c!command=\makesortedlist]%
+ \processlistofsorts[\currentsortedalphalist]%
+ \endgroup
+ \dodoglobal\let#1\sortedcommalist}
+
+% \starttext
+% \def\whatever{a,b,q,d,r,f} \sortalphacommacommand\whatever \whatever \endgraf
+% \def\whatever{ax,bx,qx,dx,rx,fx} \sortalphacommacommand\whatever \whatever \endgraf
+% \stoptext
+
\definesynonyms
[\v!abbreviation]
[\v!abbreviations]
diff --git a/Master/texmf-dist/tex/context/base/core-sys.tex b/Master/texmf-dist/tex/context/base/core-sys.tex
index b90f2305b26..1bbe97d01a0 100644
--- a/Master/texmf-dist/tex/context/base/core-sys.tex
+++ b/Master/texmf-dist/tex/context/base/core-sys.tex
@@ -15,8 +15,24 @@
\unprotect
-\def\outputfilename{\@@svfile}
-\def\inputfilename {\@@svinputfile}
+%D Version checking:
+
+\def\newcontextversion#1%
+ {\doifelse{#1}\contextversion
+ {\let\newcontextversion\gobbleoneargument}
+ {\writeline
+ \writestatus{Fatal Error}{Your format does not match the base files!}%
+ \writeline
+ \writestatus{Format Version}{\contextversion}%
+ \writestatus{Files Version}{#1}%
+ \batchmode
+ \normalend}}
+
+%D Job names.
+
+\def\outputfilename {\@@svfile}
+\def\inputfilename {\@@svinputfile}
+\def\operatingsystem{\@@svtype}
\let\jobfilesuffix\c!tex
@@ -60,13 +76,25 @@
\or
\setsystemmode\v!first % 3 : first and only run
\or
- \setsystemmode\v!last % 4 : extra last run
+ \setsystemmode\v!last % 4 : (extra) last run
\fi
+ \processaction
+ [\@@svtype]
+ %[ mswin=>\edef\@@svline{\rawcharacter{13}\rawcharacter{10}}, % crlf
+ [ mswin=>\edef\@@svline{\rawcharacter{13}}, % cr % crlf
+ darwin=>\edef\@@svline{\rawcharacter{13}}, % cr
+ \s!unknown=>\edef\@@svline{\rawcharacter{10}}]% % lf
\splitjobfilename}
+\edef\@@svline{\rawcharacter{10}} % unix is the most critical/sensitive system
+
+\def\systemendofline{\@@svline}
+
\def\setupsystem
{\dosingleargument\dosetupsystem}
+\def\systemparameter#1{\executeifdefined{\??sv#1}\empty}
+
%D The system modes set by the setup command can be used in
%D situations like:
%D
@@ -80,20 +108,36 @@
%D \stoptext
%D \stoptyping
+% \def\setuprandomize[#1]%
+% {\doifsomething{#1}
+% {\bgroup
+% \setrandomseed\minusone % signals thrd-ran to reseed
+% % tex's time is in minutes
+% \processaction
+% [#1]
+% [ \v!small=>\divide\normaltime 15, % 900,
+% \v!medium=>\divide\normaltime 30, % 1800,
+% \v!big=>\divide\normaltime 60, % 3600,
+% \v!normal=>,
+% \s!default=>,
+% \s!unknown=>\normaltime=#1]%
+% \nextrandom
+% \egroup}}
+
\def\setuprandomize[#1]%
{\doifsomething{#1}
{\bgroup
- \setrandomseed\minusone % signals thrd-ran to reseed
% tex's time is in minutes
+ \scratchcounter\normaltime
\processaction
[#1]
- [ \v!small=>\divide\normaltime 15, % 900,
- \v!medium=>\divide\normaltime 30, % 1800,
- \v!big=>\divide\normaltime 60, % 3600,
- \v!normal=>,
- \s!default=>,
- \s!unknown=>\normaltime=#1]%
- \nextrandom
+ [ \v!small=>\divide\scratchcounter 15, % 900,
+ \v!medium=>\divide\scratchcounter 30, % 1800,
+ \v!big=>\divide\scratchcounter 60, % 3600,
+ \v!normal=>\getnewrandomseed\scratchcounter,
+ \s!default=>\getnewrandomseed\scratchcounter,
+ \s!unknown=>\scratchcounter#1]%
+ \expanded{\setrandomseed{\the\scratchcounter}}%
\egroup}}
\setupsystem
@@ -103,8 +147,13 @@
\c!random=,
\c!file=\jobname,
\c!inputfile=\outputfilename,
+ \c!type=unix, % windows is normally less sensitive to handle
\c!bodyfont=\normalizedlocalbodyfontsize] % of iets anders
+%D Remark: windows programs normally handle \type {cr|lf|crlf} but unix
+%D is more picky, so we default to the \type {cr}. I never understood why
+%D \type {crlf} was not used in all systems, since it makes most sense.
+
%D
\def\dostartglobaldefs#1#2%
@@ -273,11 +322,13 @@
\installexpander\v!yes {\convertmeaning }
\installexpander\v!yes {\convertmeaning } % something lost ?
\installexpander\v!strict {\reduceargument }
+\installexpander {utf} {\reducetoutf}
+%installexpander {xml} {see xtag-ext}
\def\convertmeaning#1\to % watch the double expansion !
{\bgroup
\honorunexpanded
- \dontexpandencoding % new
+ \convertencodedtokens % can be overloaded
\xdef\@@globalexpanded{#1}%
\xdef\@@globalexpanded{\@@globalexpanded}%
\egroup
@@ -288,6 +339,16 @@
\reducetocoding[raw]%
\edef\ascii{#1}%
\expandafter\endgroup\expandafter\edef\expandafter#2\expandafter{\ascii}}
+
+% \setupindex[expansion=utf]\index{\eacute}
+
+\def\reducetoutf#1\to#2%
+ {\begingroup
+ \reducetocoding[uc]%
+ \let\uchar\uchartoutf
+ \let\unicodechar\numbertoutf
+ \edef\ascii{#1}%
+ \expandafter\endgroup\expandafter\edef\expandafter#2\expandafter{\ascii}}
% \setvalue{statevalue\v!stop }{0}
% \setvalue{statevalue\v!start }{1}
diff --git a/Master/texmf-dist/tex/context/base/core-tab.tex b/Master/texmf-dist/tex/context/base/core-tab.tex
index 51404e6897b..0bdc95814d2 100644
--- a/Master/texmf-dist/tex/context/base/core-tab.tex
+++ b/Master/texmf-dist/tex/context/base/core-tab.tex
@@ -305,16 +305,6 @@
\newif \ifTABLEgraydone % gray line executed
\newtoks \TABLEgraytoks % gray line specification
-%D A third major extension, besides spacing and color support,
-%D concerns splitting tables over pages. We don't give
-%D examples here, because its a waste of space.
-
-\newdimen\TABLEheight % These can be \newskimens
-\newdimen\TABLEmaxheight % given a few \relax's when
-\newdimen\TABLEheadheight % testing them with \ifdim.
-\newdimen\TABLEtailheight
-\newdimen\TABLEcaptionheight
-
\newif\ifTABLEinbreak
%D Nog vervangen:
@@ -371,39 +361,6 @@
\newif\ifForgetTableBarAndQuote \ForgetTableBarAndQuotetrue
-% Old crappy code (live has changed):
-%
-% \bgroup
-%
-% \catcode`\|=\@@active
-% \catcode`\"=\@@active
-%
-% \gdef\pushouterbarandquote
-% {\ifForgetTableBarAndQuote
-% \ifnum\catcode`\|=\@@active \else
-% \catcode`\|=\@@active
-% \def|{\ifmmode\vert\else\char`\|\fi}%
-% \fi
-% \let\outertablebar=|%
-% \ifnum\catcode`\"=\@@active \else
-% \catcode`\"=\@@active
-% \def"{\char`\"}%
-% \fi
-% \let\outertablequote="%
-% \fi}
-%
-% \gdef\popouterbarandquote
-% {\ifForgetTableBarAndQuote
-% \let|\outertablebar
-% \let"\outertablequote
-% \else
-% \redefinetablebarandquote
-% \fi}
-%
-% \egroup
-%
-% probably better (untested):
-
\bgroup
\catcode`\|=\@@active
@@ -500,7 +457,7 @@
%D \ReadFormatKeys}
%D \stoptyping
-\newdimen\TABLEparheight
+% \newdimen\TABLEparheight
\def\BeginTableParBox#1%
{\setbox\scratchbox\vtop\bgroup % \setbox added
@@ -526,10 +483,10 @@
\else % of paragraphs
\egroup
\fi
- \getboxheight\scratchdimen\of\box\scratchbox\relax% compensate for
- \ifdim\scratchdimen>\TABLEparheight % funny depth of
- \global\TABLEparheight\scratchdimen % multi-line box
- \fi % i.e. vtop
+% \getboxheight\scratchdimen\of\box\scratchbox\relax% compensate for
+% \ifdim\scratchdimen>\TABLEparheight % funny depth of
+% \global\TABLEparheight\scratchdimen % multi-line box
+% \fi % i.e. vtop
\box\scratchbox}
% We also need to patch away the interfering math switch:
@@ -852,26 +809,6 @@
\let\TABLEbeforebar\empty
\let\TABLEafterbar \empty
-% \def\!ttInsertVrule
-% {\hfil
-% \TABLEbeforebar % added
-% \startglobalTABLEcolor % added
-% \vrule \!thWidth
-% \ifnum\!tgCode=\plusone
-% \ifx\!tgValue\empty
-% \LineThicknessFactor
-% \else
-% \!tgValue
-% \fi
-% \LineThicknessUnit
-% \else
-% \!tgValue
-% \fi
-% \stopglobalTABLEcolor % added
-% \TABLEafterbar % added
-% \hfil
-% &}
-
\def\@VLn{1}
\def\@VLd{.125em}
@@ -957,7 +894,7 @@
\def\!ttuse#1%
{\ifnum#1>\plusone
\omit
-\global\TABLEdivisionfalse
+ \global\TABLEdivisionfalse
\scratchcounter\currentTABLEcolumn % added
\advance\scratchcounter #1% % added
\advance\scratchcounter \minusone % added
@@ -1025,18 +962,34 @@
%D
%D \showsetup{starttable}
+\newconditional\tablerepeathead
+\newconditional\tablerepeattail
+
\def\starttable
{\bgroup
- \doifelsenothing\@@tiframe
- {\ifinsidefloat\else\startbaselinecorrection\fi}
- {\startframedcontent[\@@tiframe]}%
- \postponefootnotes
- \firststagestartTABLE}
+ \doif\@@tisplit\v!auto
+ {\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}%
+ \doifelse\@@tisplit\v!yes
+ {\def\stoptable{\stoptables}%
+ \setfalse\tablerepeathead
+ \setfalse\tablerepeattail
+ \starttables}
+ {\doifelse\@@tisplit\v!repeat
+ {\def\stoptable{\stoptables}%
+ \settrue\tablerepeathead
+ \settrue\tablerepeattail
+ \starttables}
+ {\doifelsenothing\@@tiframe
+ {\ifinsidefloat\else\startbaselinecorrection\fi}
+ {\startframedcontent[\@@tiframe]}%
+ \postponefootnotes
+ \firststagestartTABLE}}}
\def\stoptable
- {\TABLEtail
- \globalletempty\@@TABLEhead
- \globalletempty\@@TABLEtail
+ {\chuckTABLEautorow % before the tail, else noalign problem
+ \insertTABLEtail
+ \TABLEnoalign{\globalletempty\@@TABLEhead}%
+ \TABLEnoalign{\globalletempty\@@TABLEtail}%
\finishTABLE
\doifelsenothing\@@tiframe
{\ifinsidefloat\else
@@ -1078,18 +1031,6 @@
%D The implementation of the definition macro is not that
%D complicated:
-%\def\dodefinetabletemplate[#1][#2]%
-% {\setgvalue{\c!Table#1}{\complexsecondstagestartTABLE[#2]}%
-% \egroup}
-%
-%\def\definetabletemplate%
-% {\bgroup
-% \catcode`\|=\@@other
-% \dodoubleargument\dodefinetabletemplate}
-
-
-% \TABLEnoalign{\page}\TABLEhead is valid
-
\def\douseTABLEtemplate#1#2#3%
{\gdef\TABLEhead{\getvalue{@@TABLEhead#2}}%
\gdef\TABLEtail{\getvalue{@@TABLEtail#3}}%
@@ -1130,35 +1071,36 @@
%D The second half of the next macro prepares table
%D splitting.
-% \def\complexsecondstagestartTABLE#1[#2]%
-% {\convertargument|\to\asciiA
-% \convertargument#2\to\asciiB
-% \doifinstringelse{\asciiA}{\asciiB}
-% {\gdef\restartTABLE{\thirdstagestartTABLE{#2}}}
-% {\doifdefinedelse{\c!Table#2}
-% {\gdef\restartTABLE{\getvalue{\c!Table#2}}}
-% {\gdef\restartTABLE{\getvalue{#2}}}}%
-% \prepareTABLEsplitting
-% \restartTABLE
-% \TABLEhead}
+\def\insertTABLEhead
+ {\TABLEnoalign{\global\settrue \preventTABLEbreak \global\setfalse\someTABLEhead}%
+ \TABLEhead
+ \TABLEnoalign{\global\setfalse\preventTABLEbreak}}
+
+\def\insertTABLEtail
+ {\TABLEnoalign{\global\settrue \preventTABLEbreak \global\setfalse\someTABLEtail}%
+ \TABLEtail
+ \TABLEnoalign{\global\setfalse\preventTABLEbreak}}
+
+\def\dorestartTABLE#1%
+ {\gdef\restartTABLE{#1}%
+ \restartTABLE
+ \insertTABLEhead
+ \ifsplittables \ifconditional \tablerepeattail
+ \TABLEnoalign{\goodbreak}%
+ \insertTABLEtail
+ \TABLEnoalign{\goodbreak}%
+ \fi \fi}
\def\complexsecondstagestartTABLE#1[#2]%
{\convertargument|\to\asciiA
\convertargument#2\to\asciiB
+ \global\setfalse\someTABLEhead
+ \global\setfalse\someTABLEtail
\doifinstringelse\asciiA\asciiB
- {\gdef\restartTABLE
- {\gdef\restartTABLE{\thirdstagestartTABLE{#2}}%
- \prepareTABLEsplitting
- \restartTABLE
- \TABLEhead}}
+ {\gdef\restartTABLE{\dorestartTABLE{\thirdstagestartTABLE{#2}}}}
{\doifdefinedelse{\c!Table#2}
- {\gdef\restartTABLE
- {\getvalue{\c!Table#2}}}
- {\gdef\restartTABLE
- {\gdef\restartTABLE{\getvalue{#2}}%
- \prepareTABLEsplitting
- \restartTABLE
- \TABLEhead}}}%
+ {\gdef\restartTABLE{\getvalue{\c!Table#2}}}
+ {\gdef\restartTABLE{\dorestartTABLE{\getvalue{#2}}}}}%
\restartTABLE}
%D The third stage involves a lot of (re)sets, which we will
@@ -1171,7 +1113,10 @@
%D We immediately use this register:
-\appendtoks \fixedspaces \to \everytable
+\appendtoks
+ \fixedspaces
+ \let\_\normalunderscore
+\to \everytable
%D Now we can start the table.
@@ -1210,45 +1155,6 @@
\global\intablefalse
\egroup}
-%D The preparation for split columns concerns some
-%D calculations. Although not explicitly needed, one can
-%D predefine a tablehead as well as a tail. Each table fragment
-%D is preceded by such a head and ends with a tail. This means
-%D that, in order to determine the available height, we have to
-%D take the head and tail into account. Because we want to
-%D support captions too, we will also reserve some space for
-%D those later on.
-
-\def\prepareTABLEsplitting
- {\global\TABLEheight\zeropoint
- \ifsplittables
- \ifx\TABLEhead\empty
- \global\TABLEheadheight\zeropoint
- \else
- \setbox0\vbox
- \bgroup
- \def\doEndOfTableLine##1##2##3{\normalTABLElineformat##2##3}%
- \restartTABLE\TABLEhead
- \finishTABLE
- \global\TABLEheadheight\ht0
- \fi
- \ifx\TABLEtail\empty
- \global\TABLEtailheight\zeropoint
- \else
- \setbox0\vbox
- \bgroup
- \def\doEndOfTableLine##1##2##3{\normalTABLElineformat##2##3}%
- \restartTABLE\TABLEtail
- \finishTABLE
- \global\TABLEtailheight\ht0
- \fi
- \else
- \global\TABLEheadheight\zeropoint
- \global\TABLEtailheight\zeropoint
- \fi
- \global\TABLEheight\zeropoint
- \calculatemaxTABLEheight\docalculatemaxTABLEheight}
-
%D \macros
%D {starttables}
%D
@@ -1270,27 +1176,45 @@
%D \stoptables
%D \stoptyping
+\newbox\tablecontentbox
+
\def\starttables
{\bgroup
- \ifinsidefloat\else
- \baselinecorrection
- \flushnotes
- \topbaselinecorrection
- \fi
- \forgetall
- \globallet\absmaxTABLEheight\zeropoint
\splittablestrue
+ \flushnotes
+ \setbox\tablecontentbox\vbox\bgroup
+ \forgetall
\global\TABLEinbreakfalse
\firststagestartTABLE}
\def\stoptables
- {\TABLEtail
+ {\ifconditional\tablerepeattail\else\insertTABLEtail\fi
\finishTABLE
+ \egroup
+ \dosplittablebox\tablecontentbox
+ \flushnotes
+ \egroup}
+
+\newdimen\TABLEcaptionheight % obsolete
+
+\def\dosplittablebox#1%
+ {\resettsplit
+ \def\tsplitminimumfreelines{2}%
+ \def\tsplitminimumfreespace{\TABLEcaptionheight}%
+ \setbox\tsplitcontent\box#1%
+ \ifconditional\tablerepeathead \ifconditional\someTABLEhead
+ \setbox\tsplithead\vsplit\tsplitcontent to \lineheight
+ \setbox\tsplithead\vbox{\unvbox\tsplithead}%
+ \fi \fi
+ \ifconditional\tablerepeattail \ifconditional\someTABLEtail
+ \setbox\tsplittail\vsplit\tsplitcontent to \lineheight
+ \setbox\tsplittail\vbox{\unvbox\tsplittail}%
+ \fi \fi
\ifinsidefloat\else
- \flushnotes
- \botbaselinecorrection
+ \def\tsplitbeforeresult{\startbaselinecorrection}%
+ \def\tsplitafterresult {\stopbaselinecorrection}%
\fi
- \egroup}
+ \handletsplit}
%D When the table in the previous example is split across
%D pages, only the first gets a head. We could have said
@@ -1342,90 +1266,21 @@
\def\setTABLEhead{\dodoubleempty\dosetTABLEhead}
\def\setTABLEtail{\dodoubleempty\dosetTABLEtail}
-\def\dosetTABLEhead[#1][#2]#3\end{\setvalue{@@TABLEhead#1}{#3}}
-\def\dosetTABLEtail[#1][#2]#3\end{\setvalue{@@TABLEtail#1}{#3}}
+\newconditional\preventTABLEbreak
+\newconditional\someTABLEhead
+
+\def\dosetTABLEhead[#1][#2]#3\end{\setvalue{@@TABLEhead#1}{\TABLEnoalign{\global\settrue\someTABLEhead}#3}}
+\def\dosetTABLEtail[#1][#2]#3\end{\setvalue{@@TABLEtail#1}{\TABLEnoalign{\global\settrue\someTABLEtail}#3}}
%D Redudant \type{\HL}'s are removed automatically, so
%D mid||lines can be used without problems.
-%D When calculating the available height of a split table, we
-%D try to handle multi||column mode as good as possible. This
-%D algoritm evolved during the development of the split option
-%D and will probably be improved bit by bit.
-
-\def\docalculatemaxTABLEheight
- {\ifinsidecolumns
- \getcolumnstatus\column\scratchcounter\total\dimen0\goal\dimen2\\%
- \else
- \ifdim\pagegoal<\maxdimen
- \dimen0\pagetotal
- \dimen2\pagegoal
- \else
- \dimen0\zeropoint
- \dimen2\textheight
- \fi
- \fi
- \advance\dimen2 -\dimen0
- \global\TABLEmaxheight\dimen2
- \global\advance\TABLEmaxheight -\strutdp
- \ifdim\prevdepth<\maxdimen\ifdim\prevdepth>\zeropoint
- \global\advance\TABLEmaxheight -\strutdp
- \global\advance\TABLEmaxheight -\parskip
- \fi\fi}
-
-\def\nocalculatemaxTABLEheight
- {\ifinsidecolumns
- \getcolumnstatus\column\scratchcounter\total\dimen0\goal\dimen2\\%
- \else
- \dimen0\zeropoint
- \dimen2\textheight
- \fi
- \advance\dimen2 -\dimen0
- \global\TABLEmaxheight\dimen2
- \global\advance\TABLEmaxheight -\strutdp}
-
-\def\calculatemaxTABLEheight#1%
- {\ifsplittables
- #1\relax
- \ifdim\TABLEmaxheight<3\baselineskip \relax % instelbaar maken
- \ifinsidecolumns
- \nobreak
- \kern\dimen2
- \goodbreak
- \else
- \goodbreak % \page
- \fi
- \removeTABLEtopskip
- \nocalculatemaxTABLEheight
- \fi
- \ifdim\TABLEmaxheight<\absmaxTABLEheight % forces equal columns
- \global\TABLEmaxheight\absmaxTABLEheight
- \else
- \xdef\absmaxTABLEheight{\the\TABLEmaxheight}%
- \fi
- \global\TABLEheight\zeropoint
- \else
- \global\TABLEmaxheight\maxdimen
- \fi}
-
-%D When splitting tables, we have to remove the top skip when
-%D we're in the main vertical list, else we remove whatever
-%D skip \TEX\ adds.
-
-\def\removeTABLEtopskip
- {\ifinsidefloat
- \verticalstrut\kern-\struttotal
- \else
- \hbox{}\kern-\topskip
- \fi}
-
%D We need an alternative for the normal complex or simple
%D commands, because assignments in these system commands
%D conflict with \type{\noalign}. This alternative is about
%D as efficient as possible.
\def\complexorsimpleTable#1#2%
-% {\getvalue{\if[\noexpand#2\s!complex\else\s!simple\fi\c!Table#1}#2}
{\csname\if[\noexpand#2\s!complex\else\s!simple\fi\c!Table#1\endcsname#2}
%D The next one is used in \type{\VL} cum suis and honours
@@ -1700,57 +1555,8 @@
%D we repeat the table head.
\def\handleTABLEbreak#1#2%
- {\ifsplittables
- \setbox0\hbox{\AugmentedTableStrut{#1}{#2}}%
- \getboxheight\dimen0\of\box0\relax
- \ifdim\TABLEparheight>\dimen0 % new
- \advance\dimen0-\lineheight % newer
- \ifdim\dimen0<\zeropoint % newer
- \dimen2\zeropoint % newer
- \fi % newer
- \advance\dimen0 \TABLEparheight % new
- \global\TABLEparheight\zeropoint % new
- \fi % new
- \ifTABLEgrayline \else
- \global\advance\TABLEheight\dimen0
- \fi
- \ifTABLEinbreak
- \globalletempty\beforeTABLEline
- \gdef\afterTABLEline{\TABLEnoalign{\nobreak}}%
- \else
- \dimen2=\TABLEheight
- \advance\dimen2 \strutdp
- \advance\dimen2 \TABLEtailheight
- \advance\dimen2 \TABLEcaptionheight
- \advance\dimen2 \lineheight % we're ahead
- \ifdim\dimen2>\TABLEmaxheight
- \gdef\beforeTABLEline
- {\setTABLEforce\TABLEforcelastrow}%
- \gdef\afterTABLEline
- {\TABLEnoalign
- {\nobreak
- \global\TABLEinbreaktrue}%
- \TABLEtail
- \TABLEnoalign
- {\goodbreak
- \calculatemaxTABLEheight\nocalculatemaxTABLEheight
- \removeTABLEtopskip
- \setTABLEaction\TABLEunknown
- \setTABLEforce \TABLEunknown}%
- \TABLEhead
- \TABLEnoalign
- {\nobreak
- \global\TABLEinbreakfalse
- \setTABLEforce\TABLEforcefirstrow}}%
- \else
- \globalletempty\beforeTABLEline
- \gdef\afterTABLEline{\TABLEnoalign{\nobreak}}%
- \fi
- \fi
- \else
- \globalletempty\beforeTABLEline
- \gdef\afterTABLEline{\TABLEnoalign{\nobreak}}%
- \fi}
+ {\globalletempty\beforeTABLEline
+ \gdef\afterTABLEline{\TABLEnoalign{\ifconditional\preventTABLEbreak\nobreak\else\goodbreak\fi}}}
%D When tables are split, the spacing before and after a
%D horizontal rule is corrected according to what we expect.
@@ -1768,7 +1574,6 @@
->%
\fi
\color[#1]{\string#3}%
- \ifsplittables\space\the\TABLEmaxheight/\the\TABLEheight\fi
\ifx\TABLEgraylineerror\empty
\space\TABLEgraylinestatus
\else
@@ -2025,7 +1830,6 @@
{\TABLEnoalign
{\nobreak
\setbox0\vbox{\blank[\@@tiNL]}%
- \global\advance\TABLEheight \ht0
\vskip\ht0
\nobreak}}
@@ -2165,8 +1969,7 @@
\setTABLEaction\TABLErule}}
\def\accountTABLElinewidth
- {\scratchdimen\LineThicknessUnit
- \global\advance\TABLEheight \@@tiHLheight\scratchdimen}
+ {\scratchdimen\LineThicknessUnit}
%D \startitemize[3*ruim]
%D \sym{\type{\BC}}
@@ -2647,7 +2450,8 @@
\c!commands=,
\c!background=\v!screen,
\c!backgroundscreen=\@@rsscreen,
- \c!backgroundcolor=]
+ \c!backgroundcolor=,
+ \c!split=\v!auto]
\def\ifintabel{\ifintable} % upward compatible
diff --git a/Master/texmf-dist/tex/context/base/core-tbl.tex b/Master/texmf-dist/tex/context/base/core-tbl.tex
index b33302da4bd..edead8e07c0 100644
--- a/Master/texmf-dist/tex/context/base/core-tbl.tex
+++ b/Master/texmf-dist/tex/context/base/core-tbl.tex
@@ -748,33 +748,40 @@
% An example of its usage:
-\appendtoks \optimizeverbatimfalse \to \everytabulate
+\appendtoks \optimizeverbatimfalse \to \everytabulate
+\appendtoks \chardef\recodeverbatimmode\plustwo \to \everytabulate
% A status variable:
\chardef\tabulatepass=0
+\def\tabulateparameter#1{\csname\??tt\currenttabulate#1\endcsname}
+
\def\dofinalstarttabulate[#1][#2][#3]% identifier sub preamble
{\edef\currenttabulate{#1::#2}%
\ifinsidefloat \else
\whitespace
- \getvalue{\??tt\currenttabulate\c!before}%
+ \tabulateparameter\c!before
\fi
\bgroup
\resetcharacteralign
% todo: spacing around tabulate when bodyfont is set
% expansion en test needed ?
- \doifelsevalue{\??tt\currenttabulate\c!split}\v!yes
- \splittabulatetrue\splittabulatefalse
+ \splittabulatefalse
+ \processaction
+ [\tabulateparameter\c!split]
+ [ \v!yes=>\splittabulatetrue,
+ % \v!repeat=>\splittabulatetrue, % todo, default yes
+ \v!auto=>\ifinsidesplitfloat\splittabulatetrue\fi]%
\doifvaluesomething{\??tt\currenttabulate\c!bodyfont}
{\expanded{\switchtobodyfont
- [\getvalue{\??tt\currenttabulate\c!bodyfont}]}}%
+ [\tabulateparameter\c!bodyfont]}}%
\postponefootnotes % new, to be tested / will be configurable
\chardef\tabulatepass\plusone
\widowpenalty\zerocount % otherwise lines are not broken
\clubpenalty \zerocount % but overlap in funny ways
\the\everytabulate
- \getvalue{\??tt\currenttabulate\c!inner}%
+ \tabulateparameter\c!inner
\scratchdimen\leftskip
\advance\scratchdimen \hangindent
\doifvalue{\??tt\currenttabulate\c!indenting}\v!yes
@@ -816,7 +823,7 @@
\newif\iftabulatefirstflushed
\def\tabulateEQ
- {\iftabulatefirstflushed\else\getvalue{\??tt\currenttabulate EQ}\fi
+ {\iftabulatefirstflushed\else\tabulateparameter{EQ}\fi
\global\tabulateequalfalse}
% \def\tabulatenormalcolumn#1%
@@ -855,7 +862,7 @@
\let\factor\!!plusone
\scratchskip\strutdp
\ExpandFirstAfter\processallactionsinset
- [\getvalue{\??tt\currenttabulate\c!distance}]
+ [\tabulateparameter\c!distance]
[ \v!blank=>\scratchskip\bigskipamount,
\v!depth=>\scratchskip\strutdp,
\v!small=>\def\factor{.25},
@@ -868,18 +875,10 @@
\ifconditional\tabulatesomeamble\kern\else\vskip\fi\scratchdimen % new
\egroup}
-% \def\dotabulaterule
-% {\color
-% [\getvalue{\??tt\currenttabulate\c!lijnkleur}]
-% {\scratchdimen\getvalue{\??tt\currenttabulate\c!lijndikte}%
-% \hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax
-% \doifvalue{\??tt\currenttabulate\c!afstand}\v!grid
-% {\kern-\scratchdimen}}} % experimental tm-prikkels
-
\def\dodotabulaterule#1%
{\color
- [\getvalue{\??tt\currenttabulate\c!rulecolor}]
- {\scratchdimen\getvalue{\??tt\currenttabulate\c!rulethickness}#1}}
+ [\tabulateparameter\c!rulecolor]
+ {\scratchdimen\tabulateparameter\c!rulethickness#1}}
\def\dotabulaterule
{\dodotabulaterule
@@ -890,7 +889,7 @@
\def\dotabulatelinerule
{\multispan\totaltabulatecolumns % \multispan is a plain macro
% for the moment this one
- \strut\hskip\getvalue{\??tt\currenttabulate\c!margin}%
+ \strut\hskip\tabulateparameter\c!margin
% neg values are ok !
\hskip\tabulateindent % new august 2003
\dodotabulaterule
@@ -954,15 +953,15 @@
\chardef\tabulaterepeathead\zerocount
\def\processtabulate[|#1|]% in the process of optimizing
- {\tabulateunit\getvalue{\??tt\currenttabulate\c!unit}%
+ {\tabulateunit\tabulateparameter\c!unit
\checkfulltabulatecontent
\globallet\tabulateruledepth \!!zeropoint
\globallet\tabulateruleheight\!!zeropoint
\ExpandFirstAfter\processaction % use \setalignmentswitch instead
- [\getvalue{\??tt\currenttabulate\c!align}]
- [\v!normal=>\def\@@tabulatealign{0},% = default value
- \v!right=>\def\@@tabulatealign{1},% chardefs gebruiken
- \v!left=>\def\@@tabulatealign{2},%
+ [\tabulateparameter\c!align]
+ [ \v!normal=>\def\@@tabulatealign{0},% = default value
+ \v!right=>\def\@@tabulatealign{1},% chardefs gebruiken
+ \v!left=>\def\@@tabulatealign{2},%
\v!middle=>\def\@@tabulatealign{3},%
\s!default=>\def\@@tabulatealign{0},%
\s!unknown=>\def\@@tabulatealign{0}]%
@@ -976,9 +975,16 @@
\global\tabulatepwidth\zeropoint
\global\tabulateequalfalse
\resettabulatepheight
- \ifinsidefloat \else
+ \ifinsidesplitfloat
+ \donetrue
+ \else\ifinsidefloat
+ \donefalse
+ \else
+ \donetrue
+ \fi\fi
+ \ifdone
\processaction
- [\getvalue{\??tt\currenttabulate\c!header}]
+ [\tabulateparameter\c!header]
[\v!repeat=>\chardef\tabulaterepeathead\plusone,
\v!text=>\chardef\tabulaterepeathead\plustwo]%
\fi
@@ -1032,9 +1038,9 @@
\global\let\flushtabulated\empty
\let\savedbar|\let|\nexttabulate
\tabskip\zeropoint
- \ifdim\getvalue{\??tt\currenttabulate\c!margin}>\zeropoint
+ \ifdim\tabulateparameter\c!margin>\zeropoint
\!!toksa{&\flushtabulateindent\strut##%
- \tabskip\getvalue{\??tt\currenttabulate\c!margin}\strut
+ \tabskip\tabulateparameter\c!margin\strut
&##\tabskip\zeropoint}%
\else
\!!toksa{&\flushtabulateindent\strut##%
@@ -1247,7 +1253,7 @@
\ifnum\noftabulatelines>\plusone
\ifnum\noftabulatelines<\minusnoftabulatelines
\vskip\topskip\allowbreak\vskip-\topskip
- \vskip-\getvalue{\??tt\currenttabulate\c!rulethickness}%
+ \vskip-\tabulateparameter\c!rulethickness
\dotabulaterule
\fi
\fi
@@ -1266,7 +1272,11 @@
\chardef\tabulatepass\plustwo
%
\ifcase\tabulaterepeathead
- \startframedcontent[\getvalue{\??tt\currenttabulate\c!frame}]%
+ \ifinsidesplitfloat
+ \setbox\tabulatebox\vbox \bgroup
+ \else
+ \startframedcontent[\tabulateparameter\c!frame]%
+ \fi
\else
\setbox\tabulatebox\vbox \bgroup
\fi
@@ -1277,14 +1287,18 @@
{\vskip-\strutdp}% experimental tm-prikkels
%
\ifcase\tabulaterepeathead
- \stopframedcontent
+ \ifinsidesplitfloat
+ \egroup \splittabulatebox\tabulatebox
+ \else
+ \stopframedcontent
+ \fi
\else
\egroup \splittabulatebox\tabulatebox
\fi
%
\egroup
\ifinsidefloat \else
- \getvalue{\??tt\currenttabulate\c!after}%
+ \tabulateparameter\c!after
\fi
\egroup}
@@ -1303,47 +1317,69 @@
% \NC test \NC \input tufte \relax \NC \NR
% \stoptabulate
+% \def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex
+% {\ifinsidefloat
+% \unvbox#1%
+% \else
+% \ifcase\tabulaterepeathead\or
+% \setbox2\copy#1%
+% \setbox2\vsplit2 to \lineheight
+% \setbox2\vbox{\unvbox2}%
+% \fi
+% \doloop
+% {\setbox0\vsplit#1 to \onepoint % \lineheight
+% \ifdim\pagegoal<\maxdimen
+% \donetrue
+% \else\ifdim\pagetotal=\zeropoint
+% \donetrue
+% \else
+% \donefalse
+% \fi\fi
+% \ifdone
+% \setbox0\vbox{\unvbox0}%
+% \dimen0\pagetotal
+% \advance\dimen0\dp0
+% \advance\dimen0\ht0
+% \ifdim\dimen0>\pagegoal
+% \bgroup \page \egroup % make sure that local vars are kept
+% \ifcase\tabulaterepeathead\or
+% \unvcopy2
+% \or
+% \hbox{\strut\tabulateparameter\c!title}%
+% \fi
+% \fi
+% \fi
+% % test this on icare checklists / quite hacky ! ! !
+% \ifdim\ht0>\tabulateparameter\c!rulethickness\else
+% \kern-2\ht0 % brrrr
+% \fi
+% %
+% \unvbox0
+% \allowbreak
+% \ifvoid#1 \exitloop \fi}%
+% \fi}
+
\def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex
- {\ifinsidefloat
+ {\ifinsidesplitfloat
+ \dosplittabulatebox#1%
+ \else\ifinsidefloat
\unvbox#1%
\else
- \ifcase\tabulaterepeathead\or
- \setbox2\copy#1%
- \setbox2\vsplit2 to \lineheight
- \setbox2\vbox{\unvbox2}%
- \fi
- \doloop
- {\setbox0\vsplit#1 to \onepoint % \lineheight
- \ifdim\pagegoal<\maxdimen
- \donetrue
- \else\ifdim\pagetotal=\zeropoint
- \donetrue
- \else
- \donefalse
- \fi\fi
- \ifdone
- \setbox0\vbox{\unvbox0}%
- \dimen0\pagetotal
- \advance\dimen0\dp0
- \advance\dimen0\ht0
- \ifdim\dimen0>\pagegoal
- \bgroup \page \egroup % make sure that local vars are kept
- \ifcase\tabulaterepeathead\or
- \unvcopy2
- \or
- \hbox{\strut\getvalue{\??tt\currenttabulate\c!title}}%
- \fi
- \fi
- \fi
- % test this on icare checklists / quite hacky ! ! !
- \ifdim\ht0>\getvalue{\??tt\currenttabulate\c!rulethickness}\else
- \kern-2\ht0 % brrrr
- \fi
- %
- \unvbox0
- \allowbreak
- \ifvoid#1 \exitloop \fi}%
- \fi}
+ \dosplittabulatebox#1%
+ \fi\fi}
+
+\def\dosplittabulatebox#1%
+ {\resettsplit
+ \def\tsplitminimumfreelines{2}%
+ \def\tsplitminimumfreespace{0pt}%
+ \setbox\tsplitcontent\box#1%
+ \ifcase\tabulaterepeathead\or
+ \setbox\tsplithead\vsplit\tsplitcontent to \lineheight
+ \setbox\tsplithead\vbox{\unvbox\tsplithead}%
+ \or
+ \setbox\tsplithead\vbox{\hbox{\strut\tabulateparameter\c!title}}%
+ \fi
+ \handletsplit}
%D \starttyping
%D \setuptabulate[split=no,rule=line]
@@ -1424,7 +1460,7 @@
\c!distance={\v!depth,\v!medium},
\c!align=\v!normal,
\c!margin=\!!zeropoint,
- \c!split=\v!yes,
+ \c!split=\v!auto,
\c!header=\v!yes,
\c!title=,
\c!indenting=\v!no]
diff --git a/Master/texmf-dist/tex/context/base/core-tsp.tex b/Master/texmf-dist/tex/context/base/core-tsp.tex
new file mode 100644
index 00000000000..dd2b42f61e6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/core-tsp.tex
@@ -0,0 +1,463 @@
+%D \module
+%D [ file=core-tsp,
+%D version=2000.10.20,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Splitting Tables,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context OTR Macros / Floating Bodies}
+
+\beginTEX
+ \expandafter \endinput
+\endTEX
+
+%D The code in this file is move here from other places.
+
+\unprotect
+
+% only to be used with single tokens (will be prim)
+
+\ifx\htdp\undefined
+ \def\htdp#1{\dimexpr\ht#1+\dp#1\relax}
+\fi
+
+%D Although the name resembles floats, and therefore this should be
+%D a page module, we decided to make it core functionality because the
+%D table code depends on it. Othrwise there would be too much
+%D overloading afterwards involved. Actually, the float part is rather
+%D generic and not that related to floats.
+
+% \splitfloat [settings] {\placetable[optional args]{test}} {content}
+
+\definenumber
+ [\??si]
+ [\c!way=\v!by\v!text,
+ \c!conversion=\@@siconversion]
+
+\def\setupfloatsplitting
+ {\dodoubleargument\getparameters[\??si]}
+
+\newif\ifinsidesplitfloat % will become chardef
+
+\newtoks \everysplitfloatsetup
+
+\def\splitfloat
+ {\dosingleempty\dosplitfloat}
+
+% \def\dosplitfloat[#1]#2% nog dubbele refs
+% {\ifinsidecolumns % tzt ook nog figuren splitten
+% % not yet supported
+% \else
+% \bgroup
+% \insidefloattrue
+% \insidesplitfloattrue
+% \getparameters[\??si][#1]%
+% \resetnumber[\??si]%
+% \def\floatcaptionsuffix{\convertednumber[\??si]}%
+% % \TABLEcaptionheight\@@silines\lineheight% brrr
+% % todo: auto == \getnoflines\captionheight
+% \let\extrasplitfloatlines\@@silines
+% \the\everysplitfloatsetup
+% \simplifypagebreak % \page becomes \goodbreak, no fails misserably
+% % todo: a preceding float does not count yet
+% % so we need a better predictor
+% \dowithnextbox
+% {\forgetall
+% \dontcomplain
+% \chardef\nodelocationmode\zerocount
+% \doloop
+% {\setbox2\vsplit\nextbox to \lineheight
+% \setbox2\vbox{\unvbox2}
+% \ifdim\ht2>\lineheight
+% \incrementnumber[\??si]%
+% \ifcase\rawnumber[\??si]\or \ifdim\nextboxht=\zeropoint
+% \let\floatcaptionsuffix\empty
+% \fi \fi
+% \bgroup
+% #2{\unvbox2}
+% \egroup
+% \ifdim\nextboxht>\zeropoint
+% \page
+% \decrementnumber[\floatcaptionnumber]%
+% \fi
+% \fi
+% \ifdim\nextboxht>\zeropoint
+% \page
+% \else
+% \expandafter\exitloop
+% \fi}%
+% \egroup}
+% \vbox
+% \fi}
+
+\ifx\floatcaptionsuffix\undefined \else
+ \let\floatcaptionsuffix\empty % will become \splitfloatcaptionsuffix
+\fi
+
+\def\extrasplitfloatlines{0}
+
+\def\dosplitfloat[#1]#2% nog dubbele refs
+ {\bgroup
+ \global\setfalse\splitfloatdone
+ \aftergroup\checksplitfloat
+ \insidefloattrue
+ \insidesplitfloattrue
+ \getparameters[\??si][#1]%
+ \resetnumber[\??si]%
+ \def\floatcaptionsuffix{\convertednumber[\??si]}%
+ \let\extrasplitfloatlines\@@silines
+ \the\everysplitfloatsetup
+ \def\splitfloatcommand{#2}%
+ \global\settrue \onlyonesplitofffloat
+ \global\setfalse\somenextplitofffloat
+ \dopushsavedfloats
+ \@@sibefore
+ \let\next} % \bgroup
+
+
+\def\checksplitfloat
+ {\ifconditional\splitfloatdone\else
+ \blank{\tttf \getmessage\m!floatblocks{13}\empty}\blank
+ \showmessage\m!floatblocks{13}\empty
+ \fi}
+
+\settrue \onlyonesplitofffloat
+\setfalse\somenextplitofffloat
+
+%D When \type {inbetween} is made empty instead of the
+%D default \type {\page}, we will get delayed flushing
+%D and text may continue below the graphic.
+%D
+%D \starttyping
+%D \dorecurse{2}{\input tufte }
+%D
+%D \splitfloat[lines=auto,inbetween=]
+%D {\placetable{\dorecurse{5}{test\recurselevel\endgraf}}}
+%D {\bTABLE[split=yes]
+%D \bTR \bTD 11 \eTD \bTD \input tufte \eTD \eTR
+%D \bTR \bTD 12 \eTD \bTD \input zapf \eTD \eTR
+%D \bTR \bTD 13 \eTD \bTD \input bryson \eTD \eTR
+%D \bTR \bTD 14 \eTD \bTD test \eTD \eTR
+%D \bTR \bTD 21 \eTD \bTD \input tufte \eTD \eTR
+%D \bTR \bTD 22 \eTD \bTD \input zapf \eTD \eTR
+%D \bTR \bTD 23 \eTD \bTD \input bryson \eTD \eTR
+%D \bTR \bTD 24 \eTD \bTD test \eTD \eTR
+%D \bTR \bTD 31 \eTD \bTD \input tufte \eTD \eTR
+%D \bTR \bTD 32 \eTD \bTD \input zapf \eTD \eTR
+%D \bTR \bTD 33 \eTD \bTD \input bryson \eTD \eTR
+%D \bTR \bTD 34 \eTD \bTD test \eTD \eTR
+%D \eTABLE}
+%D
+%D \dorecurse{10}{\input tufte }
+%D \stoptyping
+
+\newconditional\splitfloatdone
+
+\def\dodowithsplitofffloat
+ {\dowithnextbox
+ {\forgetall
+ \dontcomplain
+ \global\settrue\splitfloatdone
+ \chardef\nodelocationmode\zerocount % bypass auto-renumbering
+ \incrementnumber[\??si]%
+ \ifcase\rawnumber[\??si]\or \ifconditional\onlyonesplitofffloat
+ \let\floatcaptionsuffix\empty
+ \fi \fi
+ \bgroup
+ \ifconditional\somenextplitofffloat
+ \settrue\retainfloatnumber
+ \else
+ \setfalse\retainfloatnumber
+ \fi
+ \splitfloatcommand{\box\nextbox}%
+ \egroup
+ \ifconditional\somenextplitofffloat
+ \doifelsenothing\@@siinbetween
+ {\ifconditional\tsplitfirstdone\else\page\fi}
+ \@@siinbetween
+ \else
+ \@@siafter
+ \dopopsavedfloats
+ \doflushsavedfloats
+ \fi
+ \global\settrue\tsplitfirstdone}%
+ \vbox}
+
+\def\nodowithsplitofffloat
+ {\dowithnextbox
+ {\forgetall
+ \dontcomplain
+ \box\nextbox % maybe an option to unvbox
+ \global\settrue\tsplitfirstdone}%
+ \vbox}
+
+\def\dochecksplitofffloat#1% box
+ {\ifinsidesplitfloat
+ \ifdim\ht#1=\zeropoint
+ \global\setfalse\somenextplitofffloat
+ \else
+ \global\settrue \somenextplitofffloat
+ \global\setfalse\onlyonesplitofffloat
+ \fi
+ \fi}
+
+\def\analyzesplitfloatcaption#1% depend son page-flt
+ {\doif\extrasplitfloatlines\v!auto
+ {\bgroup
+ \settrue\retainfloatnumber
+ \chardef\nodelocationmode\zerocount
+ \forcelocalfloats
+ \setuplocalfloats[\c!before=,\c!after=,\c!inbetween=]%
+ \splitfloatcommand{\hbox to \wd#1{\strut}}% dummy line
+ \setbox\scratchbox\vbox{\flushlocalfloats}%
+ \getnoflines{\ht\scratchbox}%
+ \resetlocalfloats
+ \advance\noflines\minusone % compensate dummy line
+ \expanded{\egroup\noexpand\edef\noexpand\extrasplitfloatlines{\the\noflines}}}}
+
+% \def\analyzesplitfloatcaption#1%
+% {\edef\extrasplitfloatlines{11}}
+
+\def\dowithsplitofffloat % nextbox
+ {\ifinsidesplitfloat
+ \expandafter\dodowithsplitofffloat
+ \else
+ \expandafter\nodowithsplitofffloat
+ \fi}
+
+\def\doifnotinsidesplitfloat
+ {\ifinsidesplitfloat\expandafter\gobbleoneargument\fi}
+
+%D Some defaults:
+
+\setupfloatsplitting
+ [\c!conversion=\v!character, % \v!romannumerals
+ \c!lines=3,
+ \c!before=,
+ \c!inbetween=\page,
+ \c!after=]
+
+%D Table splitter, on top of previous code:
+
+\newbox\tsplitcontent
+\newbox\tsplitresult
+\newbox\tsplithead
+\newbox\tsplitnext
+\newbox\tsplittail
+
+\def\resettsplit
+ {\def\tsplitminimumfreelines{0}%
+ \def\tsplitminimumfreespace{0pt}%
+ \setbox\tsplitcontent \vbox{}%
+ \setbox\tsplitresult \vbox{}%
+ \setbox\tsplithead \vbox{}%
+ \setbox\tsplitnext \vbox{}%
+ \setbox\tsplittail \vbox{}%
+ \let\tsplitbeforeresult\donothing
+ \let\tsplitafterresult \donothing
+ \let\tsplitinbetween \donothing
+ \let\tsplitbefore \donothing
+ \let\tsplitafter \donothing
+ \let\postprocesstsplit \donothing}
+
+\resettsplit
+
+% todo: keep tail to rest, so we need a lookahead
+
+\newconditional\tsplitfirstdone
+
+\def\handletsplit
+ {\analyzesplitfloatcaption\tsplitcontent
+ \global\setfalse\tsplitfirstdone
+ \testpage
+ [\tsplitminimumfreelines]
+ [\dimexpr\tsplitminimumfreespace+\extrasplitfloatlines\lineheight\relax]%
+ \setbox\scratchbox\vbox{\tsplitinbetween}%
+ \edef\tsplitinbetweenheight{\the\htdp\scratchbox}% etex
+ \!!doneafalse
+ \doloop
+ {\ifinsidecolumns
+ % brrr, assumes empty columns
+ \global\setfalse\tsplitfirstdone
+ \scratchdimen\textheight
+ \!!donectrue
+ \else
+ \ifconditional\tsplitfirstdone
+ \scratchdimen\textheight
+ \!!donectrue
+ \else\ifdim\pagegoal<\maxdimen
+ \scratchdimen\dimexpr\pagegoal-\pagetotal\relax
+ \!!donecfalse
+ \else
+ \scratchdimen\textheight
+ \!!donectrue
+ \fi\fi
+ \fi
+ \scratchdimen\dimexpr\scratchdimen-\tsplitinbetweenheight-\tsplitminimumfreespace-\extrasplitfloatlines\lineheight\relax
+ \ifdim\htdp\tsplittail>\zeropoint
+ \advance\scratchdimen-\htdp\tsplittail
+ \fi
+ \setbox\tsplitresult\vbox
+ {\ifdim\ht\tsplithead>\zeropoint
+ \unvcopy\tsplithead
+ \tsplitinbetween
+ \fi}%
+ \if!!donea\else\ifdim\ht\tsplitnext>\zeropoint
+ \setbox\tsplithead\box\tsplitnext
+ \fi\fi
+ \!!doneatrue
+ \ifdim\ht\tsplitresult>\zeropoint
+ \!!donedtrue % table head
+ \else
+ \!!donedfalse % no tablehead
+ \fi
+ \doloop
+ {\setbox\scratchbox\vsplit\tsplitcontent to \onepoint % \lineheight
+ \setbox\scratchbox\vbox{\unvbox\scratchbox}%
+ \ifdim\dimexpr\scratchdimen-\htdp\scratchbox-\htdp\tsplitresult\relax>\zeropoint
+ \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}%
+ \ifvoid\tsplitcontent \exitloop \fi
+ \else\if!!doned
+ % we only have a tablehead so far
+ \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}%
+ \exitloop
+ \else\if!!donec
+ % we have text height available, but the (one) cell is too
+ % large to fit, so, in order to avoid loops/deadcycles we do:
+ \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvbox\scratchbox}%
+ \exitloop
+ \else
+ \setbox\tsplitcontent\vbox
+ {\unvbox\scratchbox
+ \ifvoid\tsplitcontent\else\unvbox\tsplitcontent\fi}%
+ \exitloop
+ \fi\fi\fi
+ \!!donedfalse
+ \!!donecfalse}%
+ \postprocesstsplit
+ \dochecksplitofffloat\tsplitcontent
+ \ifvoid\tsplitcontent
+ \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvcopy\tsplittail}%
+ \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}%
+ \doifnotinsidesplitfloat\tsplitafter
+ \endgraf
+ \exitloop
+ \else
+ % hack
+ \ifdim\pagegoal<\maxdimen
+ \global\pagegoal\dimexpr\pagegoal+\lineheight\relax % etex
+ \fi
+ % brrr
+ \ifdim\ht\tsplitresult>\zeropoint
+ \setbox\tsplitresult\vbox{\unvbox\tsplitresult\unvcopy\tsplittail}%
+ \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}%
+ \doifnotinsidesplitfloat\tsplitafter
+ \endgraf
+ \fi
+ \ifinsidecolumns
+ \doifnotinsidesplitfloat\goodbreak
+ \else
+ \doifnotinsidesplitfloat\page
+ \fi
+ \fi}}
+
+\protect \endinput
+
+% test cases
+
+% \setupTABLE[split=repeat]
+%
+% \input tufte \endgraf
+% \splitfloat[lines=11]
+% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}}
+% {\bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE}
+% \input tufte \page
+%
+% \input tufte \endgraf
+% \splitfloat[lines=0]
+% {}
+% {\bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE}
+% \input tufte \endgraf \page
+%
+% \input tufte \endgraf
+% \bTABLE\dorecurse{100}{\bTR \bTD test \eTD \eTR}\eTABLE
+% \input tufte \page
+
+% \setuptabulate[split=yes]
+%
+% \input tufte \endgraf
+% \splitfloat[lines=11]
+% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}}
+% {\starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate}
+% \input tufte \page
+%
+% \input tufte \endgraf
+% \splitfloat[lines=0]
+% {}
+% {\starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate}
+% \input tufte \page
+%
+% \input tufte \endgraf
+% \starttabulate\dorecurse{200}{\NC test \NC test \NC \NR}\stoptabulate
+% \input tufte \page
+
+% \setuptables[split=yes]
+%
+% \newtoks\TestToks
+%
+% \TestToks\emptytoks
+% \appendtoks\starttablehead\to\TestToks
+% \dorecurse{3}{\appendtoks\VL head \VL head \VL \SR\to\TestToks}
+% \appendtoks\stoptablehead\to\TestToks
+% \appendtoks\starttabletail\to\TestToks
+% \dorecurse{3}{\appendtoks\VL tail \VL tail \VL \SR\to\TestToks}
+% \appendtoks\stoptabletail\to\TestToks
+% \appendtoks\starttables[|c|c|]\to\TestToks
+% \dorecurse{100}{\appendtoks\VL test \VL test \VL \SR\to\TestToks}
+% \appendtoks\stoptables\to\TestToks
+%
+% \input tufte \endgraf
+% \splitfloat[lines=auto] % [lines=11]
+% {\placetable{\dorecurse{10}{test\recurselevel\endgraf}}}
+% {\the\TestToks}
+% \input tufte \page
+%
+% \input tufte \endgraf
+% \splitfloat[lines=0]
+% {}
+% {\the\TestToks}
+% \input tufte \page
+%
+% \input tufte \endgraf
+% \the\TestToks
+% \input tufte \page
+%
+% multiple floats
+%
+% \starttext
+% \dorecurse{3}{\input tufte } \endgraf
+% \dorecurse{5}{\placefigure{}{\framed[height=.5\textheight]{}}}
+% \splitfloat[lines=auto,inbetween=]
+% {\placetable{\dorecurse{5}{test\recurselevel\endgraf}}}
+% {\bTABLE[split=yes]
+% \bTR \bTD 11 \eTD \bTD \input tufte \eTD \eTR
+% \bTR \bTD 12 \eTD \bTD \input zapf \eTD \eTR
+% \bTR \bTD 13 \eTD \bTD \input bryson \eTD \eTR
+% \bTR \bTD 14 \eTD \bTD test \eTD \eTR
+% \bTR \bTD 21 \eTD \bTD \input tufte \eTD \eTR
+% \bTR \bTD 22 \eTD \bTD \input zapf \eTD \eTR
+% \bTR \bTD 23 \eTD \bTD \input bryson \eTD \eTR
+% \bTR \bTD 24 \eTD \bTD test \eTD \eTR
+% \bTR \bTD 31 \eTD \bTD \input tufte \eTD \eTR
+% \bTR \bTD 32 \eTD \bTD \input zapf \eTD \eTR
+% \bTR \bTD 33 \eTD \bTD \input bryson \eTD \eTR
+% \bTR \bTD 34 \eTD \bTD test \eTD \eTR
+% \eTABLE}
+% \dorecurse{10}{\input tufte }
+% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/core-uti.tex b/Master/texmf-dist/tex/context/base/core-uti.tex
index a8dd993f6ca..f1f499a75be 100644
--- a/Master/texmf-dist/tex/context/base/core-uti.tex
+++ b/Master/texmf-dist/tex/context/base/core-uti.tex
@@ -31,6 +31,7 @@
\edef\utilityversion{1998.07.07} % was: 1996.03.15 % status variables
\edef\utilityversion{1998.12.20} % was: 1998.07.07 % index attributes
\edef\utilityversion{2003.07.19} % was: 1998.12.20 % object pages
+\edef\utilityversion{2006.06.23} % was: 2003.07.19 % -- instead of :
% Bepaalde commando's worden als string weggeschreven. Deze
% zijn aan het eind van deze file gedefinieerd.
@@ -56,10 +57,10 @@
{\checksectionseparator}
{\@@utilityerrormessage\resetutilities\endinput}}
-\def\checksectionseparator % catches backward compatibility conflict
- {\doifnot\sectionseparator:\endinput} % this dependency may go in a few years
+\def\checksectionseparator % catches backward compatibility conflict
+ {}% \doifnot\sectionseparator:\endinput} % this dependency may go in a few years
-\def\dosplitofffoliopart[#1::#2::#3]{#3}
+\def\dosplitofffoliopart[#1--#2--#3]{#3}
\def\thisissectionseparator#1%
{\bgroup
@@ -98,12 +99,6 @@
\def\cwriteutilitycommand#1%
{\write\uti{\noexpand\checkedutility{\number\nofshipouts}{c \string#1}}}
-% \def\cimmediatewriteutility
-% {\immediate\write\uti}
-%
-% \def\cimmediatewriteutilitycommand#1%
-% {\immediate\write\uti{c \string#1}}
-
\let\checkedutility\secondoftwoarguments
\def\docheckedutility#1#2{\ifnum#1=\nofshipouts#2\else\letterpercent\fi}
@@ -112,7 +107,11 @@
\let\checkedutility\docheckedutility
\to \everybeforeshipout
-\edef\testbytesequence{\rawcharacter{7}\rawcharacter{27}\rawcharacter{227}}
+\edef\testbytesequence
+ {\rawcharacter{7}%
+ \rawcharacter{27}%
+ %rawcharacter{227}% invalid in xetex, which expects utf
+ \rawcharacter{195}\rawcharacter{128}} % valid utf code
\def\thisisbytesequence#1%
{\ifx\testbytesequence\empty\else
@@ -124,6 +123,10 @@
\fi
\global\let\thisisbytesequence\gobbleoneargument}
+\beginXETEX
+ \let\testbytesequence\empty
+\endXETEX
+
% Better use marks.
\def\checkutilities
@@ -242,7 +245,7 @@
% {\doiflocfileelse{\jobname.\f!inputextension}
% {\bgroup
% \showmessage\m!systems{11}{}%
-% \openout\scratchwrite=\jobname.\f!outputextension
+% \openout\scratchwrite\jobname.\f!outputextension
% \openlocin\scratchread{\jobname.\f!inputextension}%
% \def\doprocessline%
% {\ifeof\scratchread
diff --git a/Master/texmf-dist/tex/context/base/core-var.tex b/Master/texmf-dist/tex/context/base/core-var.tex
index 1fe89af0e39..54c9c52df5d 100644
--- a/Master/texmf-dist/tex/context/base/core-var.tex
+++ b/Master/texmf-dist/tex/context/base/core-var.tex
@@ -15,6 +15,233 @@
\unprotect
+%D Modes:
+%D
+%D \starttyping
+%D \enablemode[screen,paper,bound]
+%D
+%D \doifmodeelse {paper} {this} {that}
+%D \doifmode {paper,screen} {this}
+%D \doifnotmode {paper,bound} {that}
+%D
+%D \startmode [list]
+%D \stopmode
+%D
+%D \startnotmode [list]
+%D \stopnotmode
+%D \stoptyping
+%D
+%D system modes have a * as prefix
+%D
+%D Sometimes, we want to prevent a mode for being set. Think
+%D of situations where a style enables a mode, but an outer
+%D level style does not want that. Preventing can be
+%D considered a permanent disabling on forehand.
+
+% \def\systemmodeprefix{*}
+%
+% \let\currentmode \empty
+% \let\preventedmodes\empty
+%
+% \def\preventmode[#1]%
+% {\expanded{\addtocommalist{#1}\noexpand\preventedmodes}}
+%
+% \def\enablemode[#1]%
+% {\expanded
+% {\doifnotinset{#1}{\preventedmodes}
+% {\noexpand\addtocommalist{#1}\noexpand\currentmode}}}
+%
+% \def\disablemode[#1]%
+% {\expanded{\removefromcommalist{#1}\noexpand\currentmode}}
+%
+% \def\doifmodeelse{\unprotect\dodoifmodeelse}
+% \def\doifmode {\unprotect\dodoifmode }
+% \def\doifnotmode {\unprotect\dodoifnotmode }
+% \def\startmode {\unprotect\dostartmode }
+% \def\startnotmode{\unprotect\dostartnotmode}
+%
+% \long\def\dodoifmodeelse#1%
+% {\protect\expanded{\doifcommonelse{#1}{\currentmode}}}
+%
+% \long\def\dodoifmode#1%
+% {\protect\expanded{\doifcommon {#1}{\currentmode}}}
+%
+% \long\def\dodoifnotmode#1%
+% {\protect\expanded{\doifnotcommon {#1}{\currentmode}}}
+%
+% \let\stopmode \relax
+% \let\stopnotmode\relax
+%
+% \long\def\dostartmode[#1]%
+% {\protect
+% \expanded{\doifnotcommon{#1}{\currentmode}}{\gobbleuntil\stopmode}}
+%
+% \long\def\dostartnotmode[#1]%
+% {\protect
+% \expanded{\doifcommon {#1}{\currentmode}}{\gobbleuntil\stopnotmode}}
+%
+% \def\doifallmodeselse{\unprotect\dodoifallmodeselse}
+% \def\doifallmodes {\unprotect\dodoifallmodes}
+% \def\doifnotallmodes {\unprotect\dodoifnotallmodes}
+% \def\startallmodes {\unprotect\dostartallmodes}
+% \def\startnotallmodes{\unprotect\dostartnotallmodes}
+%
+% \long\def\dodoifallmodeselse#1%
+% {\protect\expanded{\doifallcommonelse{#1}{\currentmode}}}
+%
+% \long\def\dodoifallmodes#1%
+% {\protect\expanded{\doifallcommon {#1}{\currentmode}}}
+%
+% \long\def\dodoifnotallmodes#1%
+% {\protect\expanded{\doifnotallcommon {#1}{\currentmode}}}
+%
+% \let\stopallmodes \relax
+% \let\stopnotallmodes\relax
+%
+% \long\def\dostartallmodes[#1]%
+% {\protect
+% \expanded{\doifnotallcommon{#1}{\currentmode}}{\gobbleuntil\stopallmodes}}
+%
+% \long\def\dostartnotallmodes[#1]%
+% {\protect
+% \expanded{\doifallcommon {#1}{\currentmode}}{\gobbleuntil\stopnotallmodes}}
+
+% faster
+
+\def\@mode@{@md@}
+
+\def\systemmodeprefix{*}
+
+\def\disabledmode {0}
+\def\enabledmode {1}
+\def\preventedmode {2}
+
+% fast internal ones
+
+\def\setmode #1{\@EA\let\csname\@mode@#1\endcsname\enabledmode }
+\def\resetmode#1{\@EA\let\csname\@mode@#1\endcsname\disabledmode}
+
+\def\setsystemmode #1{\@EA\let\csname\@mode@\systemmodeprefix#1\endcsname\enabledmode }
+\def\resetsystemmode#1{\@EA\let\csname\@mode@\systemmodeprefix#1\endcsname\disabledmode}
+
+% user ones
+
+\def\preventmode{\unprotect\dopreventmode}
+\def\enablemode {\unprotect\doenablemode }
+\def\disablemode{\unprotect\dodisablemode}
+
+% \def\dopreventmode[#1]{\protect\rawprocesscommalist[#1]\dodopreventmode}
+% \def\doenablemode [#1]{\protect\rawprocesscommalist[#1]\dodoenablemode }
+% \def\dodisablemode[#1]{\protect\rawprocesscommalist[#1]\dododisablemode}
+%
+% better:
+
+\def\dopreventmode[#1]{\protect\cleanuplabel{#1}\rawprocesscommalist[\cleanlabel]\dodopreventmode}
+\def\doenablemode [#1]{\protect\cleanuplabel{#1}\rawprocesscommalist[\cleanlabel]\dodoenablemode }
+\def\dodisablemode[#1]{\protect\cleanuplabel{#1}\rawprocesscommalist[\cleanlabel]\dododisablemode}
+
+\def\dodopreventmode#1%
+ {\@EA\let\csname\@mode@#1\endcsname\preventedmode}
+
+\def\dodoenablemode#1%
+ {\ifcase0\csname\@mode@#1\endcsname\relax
+ \@EA\let\csname\@mode@#1\endcsname\enabledmode
+ \fi}
+
+\def\dododisablemode#1%
+ {\ifcase0\csname\@mode@#1\endcsname\or
+ \@EA\let\csname\@mode@#1\endcsname\disabledmode
+ \fi}
+
+% check macros
+
+\newif\ifcheckedmode
+
+\def\dodocheckformode#1%
+ {\ifcase0\csname\@mode@#1\endcsname\or\checkedmodetrue\fi}
+
+% \def\docheckformode#1#2#3% will be sped up with a quit
+% {\protect\checkedmodefalse\rawprocesscommalist[#3]\dodocheckformode
+% \ifcheckedmode\@EA#1\else\@EA#2\fi}
+%
+% better:
+
+\def\docheckformode#1#2#3% will be sped up with a quit
+ {\cleanuplabel{#3}%
+ \protect\checkedmodefalse\rawprocesscommacommand[\cleanlabel]\dodocheckformode
+ \ifcheckedmode\@EA#1\else\@EA#2\fi}
+
+\def\dodocheckforallmodes#1%
+ {\ifcase0\csname\@mode@#1\endcsname\relax
+ \checkedmodefalse\or\or\checkedmodefalse\fi}
+
+% \def\docheckforallmodes#1#2#3% will be sped up with a quit
+% {\protect\checkedmodetrue\rawprocesscommalist[#3]\dodocheckforallmodes
+% \ifcheckedmode\@EA#1\else\@EA#2\fi}
+%
+% better:
+
+\def\docheckforallmodes#1#2#3% will be sped up with a quit
+ {\cleanuplabel{#3}%
+ \protect\checkedmodetrue\rawprocesscommacommand[\cleanlabel]\dodocheckforallmodes
+ \ifcheckedmode\@EA#1\else\@EA#2\fi}
+
+% simple ones
+
+\def\doifmodeelse{\unprotect\dodoifmodeelse}
+\def\doifmode {\unprotect\dodoifmode}
+\def\doifnotmode {\unprotect\dodoifnotmode}
+\def\startmode {\unprotect\dostartmode}
+\def\startnotmode{\unprotect\dostartnotmode}
+
+\def\dodoifmodeelse
+ {\docheckformode\firstoftwoarguments\secondoftwoarguments}
+
+\def\dodoifmode
+ {\docheckformode\firstofoneargument\gobbleoneargument}
+
+\def\dodoifnotmode
+ {\docheckformode\gobbleoneargument\firstofoneargument}
+
+\long\def\dostartmode[#1]%
+ {\docheckformode\donothing\dostopmode{#1}}
+
+\long\def\dostartnotmode[#1]%
+ {\docheckformode\dostopnotmode\donothing{#1}}
+
+\let\stopmode \donothing
+\let\stopnotmode\donothing
+
+\long\def\dostopmode #1\stopmode {}
+\long\def\dostopnotmode#1\stopnotmode{}
+
+\def\doifallmodeselse{\unprotect\dodoifallmodeselse}
+\def\doifallmodes {\unprotect\dodoifallmodes}
+\def\doifnotallmodes {\unprotect\dodoifnotallmodes}
+\def\startallmodes {\unprotect\dostartallmodes}
+\def\startnotallmodes{\unprotect\dostartnotallmodes}
+
+\def\doifallmodeselse
+ {\docheckforallmodes\firstoftwoarguments\secondoftwoarguments}
+
+\def\doifallmodes
+ {\docheckforallmodes\firstofoneargument\gobbleoneargument}
+
+\def\doifnotallmodes
+ {\docheckforallmodes\gobbleoneargument\firstofoneargument}
+
+\long\def\dostartallmodes[#1]%
+ {\docheckforallmodes\donothing\dostopallmodes{#1}}
+
+\long\def\dostartnotallmodes[#1]%
+ {\docheckforallmodes\dostopallmodes\donothing{#1}}
+
+\let\stopallmodes \donothing
+\let\stopnotallmodes\donothing
+
+\long\def\dostopallmodes #1\stopallmodes {}
+\long\def\dostopnotallmodes#1\stopnotallmodes{}
+
%D \macros
%D {every...}
%D
@@ -44,6 +271,8 @@
\newevery \everybeginofpar \relax
\newevery \everyendofpar \relax
\newevery \everylistentry \relax
+\newevery \everymarking \relax
+\newevery \everysavesortkeys \relax
%D For shared \type {\everymath} and \type {\everydisplay}:
@@ -268,6 +497,35 @@
{\executeifdefined{\??vars:#1:#2}}% {#3}
%D \macros
+%D {defineselector,setupselector}
+%D
+%D \starttyping
+%D \defineselector[caption][max=2,n=2]
+%D
+%D \start
+%D \setupselector[caption][n=1]
+%D \placelist[figure][criterium=all]
+%D \stop
+%D
+%D \starttext
+%D \placefigure
+%D {\select{caption}{zapf}{\input zapf \relax}}
+%D {}
+%D \stoptext
+%D \stoptyping
+
+\def\defineselector{\dodoubleargument\dodefineselector}
+\def\setupselector {\dodoubleargument\dosetupselector}
+
+\def\dodefineselector[#1][#2]{\getparameters[\??sx#1][\c!max=2,\c!n=1,#2]}
+\def\dosetupselector [#1][#2]{\getparameters[\??sx#1][#2]}
+
+\unexpanded\def\select#1%
+ {\filterfromnext
+ {\executeifdefined{\??sx#1\c!max}1}
+ {\executeifdefined{\??sx#1\c!n }1}}
+
+%D \macros
%D {checkvariables}
%D
%D I'll probably forget that this on exists.
diff --git a/Master/texmf-dist/tex/context/base/core-ver.tex b/Master/texmf-dist/tex/context/base/core-ver.tex
index eb8363cf098..5713e0cb36d 100644
--- a/Master/texmf-dist/tex/context/base/core-ver.tex
+++ b/Master/texmf-dist/tex/context/base/core-ver.tex
@@ -48,6 +48,11 @@
1: fisierul -- nu exista
\stopmessages
+\startmessages french library: verbatims
+ title: verbatim
+ 1: le fichier -- n'existe pas
+\stopmessages
+
\unprotect
% \type{ <crlf> char} geeft bagger
@@ -130,55 +135,60 @@
\installnewpretty I {\setupprettiesintype{EIF}\setupprettytype} % E taken
\installnewpretty X {\setupprettiesintype{XML}\setupprettytype}
-\def\setupcommonverbatim#1%
+\def\setupcommonverbatim
{\eightbitcharactersfalse % obey regime / encoding
%
\def\prettyidentifier{TEX}%
%
- \doifelsevalue{#1\c!text}\v!yes
+ \doifelse{\typingparameter\c!text}\v!yes
\naturaltextexttrue
\naturaltextextfalse
- \def\prettyidentifierfont{\getvalue{#1\c!icommand}}%
- \def\prettyvariablefont {\getvalue{#1\c!vcommand}}%
- \def\prettynaturalfont {\getvalue{#1\c!ccommand}}%
+ \def\prettyidentifierfont{\typingparameter\c!icommand}%
+ \def\prettyvariablefont {\typingparameter\c!vcommand}%
+ \def\prettynaturalfont {\typingparameter\c!ccommand}%
%
- \doifvalue{#1\c!space}\v!on
+ \doif{\typingparameter\c!space}\v!on
{\def\obeyspaces{\setcontrolspaces}}%
- \doifvalue{#1\c!page }\v!no
+ \doif{\typingparameter\c!page }\v!no
{\def\obeypages {\ignorepages}}%
%
- \doifelsevalue{#1\c!tab}\v!yes
+ \doifelse{\typingparameter\c!tab}\v!yes
{\def\obeytabs{\settabskips}}%
- {\doifvalue{#1\c!tab}\s!ascii
+ {\doif{\typingparameter\c!tab}\s!ascii
{\chardef\tabskipmode\plustwo % quit on >127
- \def\obeytabs{\settabskips}}%
- {}}%
+ \def\obeytabs{\settabskips}}}%
%
\ignorehyphens % default
\ExpandFirstAfter\processaction
- [\getvalue{#1\c!lines}]
+ [\typingparameter\c!lines]
[ \v!yes=>\obeybreakpoints,
\v!hyphenated=>\obeyhyphens]%
+ \processaction
+ [\typingparameter\c!empty]
+ [\v!yes=>\obeyemptylines,
+ \v!all=>\obeyallemptylines]%
%
\ExpandFirstAfter\processaction
- [\getvalue{#1\c!option}]
+ [\typingparameter\c!option]
[ \v!none=>\let\obeycharacters\relax,
\v!color=>\setupprettiesintype{TEX}%
\let\obeycharacters\setupprettytype
\let\obeytabs\ignoretabs,
\v!normal=>\let\obeycharacters\setupgroupedtype,
- \v!commands=>\def\obeycharacters{\setupcommandsintype{#1}}%
+ \v!commands=>\def\obeycharacters{\setupcommandsintype}% \let
\let\obeytabs\ignoretabs,
\v!slanted=>\let\obeycharacters\setupslantedtype
\let\obeytabs\ignoretabs,
- \s!unknown=>\setupprettiesintype{\getvalue{#1\c!option}}%
+ \s!unknown=>\setupprettiesintype{\typingparameter\c!option}%
\let\obeycharacters\setupprettytype
\let\obeytabs\ignoretabs]%
- \doifnumberelse{\getvalue{#1\c!tab}}
- {\def\obeytabs{\setfixedtabskips{\getvalue{#1\c!tab}}}}%
+ \doifnumberelse{\typingparameter\c!tab}
+ {\def\obeytabs{\setfixedtabskips{\typingparameter\c!tab}}}%
\donothing
- \def\verbatimfont{\getvalue{#1\c!style}\normalnoligatures\font}%
- \setupverbatimcolor{#1}}
+ %\def\verbatimfont{\typingparameter\c!style\normalnoligatures\font}%
+ % more generic, but beware of the \redoconvertfont (else no typing in titles and such)
+ \def\verbatimfont{\redoconvertfont\dosetfontattribute{\currenttypingclass\currenttyping}\c!style\normalnoligatures\font}%
+ \setupverbatimcolor}
\ifx\normalnoligatures\undefined \let\normalnoligatures\gobbleoneargument \fi
@@ -242,7 +252,8 @@
\def\dotype#1%
{\bgroup
\strut % new, enables leading space in \type { abc } at par start
- \edef\@@currenttype{#1}%
+ \let\currenttypingclass\??ty
+ \edef\currenttyping{#1}%
\catcode`\<=\@@other
\catcode`\>=\@@other
\futurelet\next\dodotype}
@@ -280,29 +291,79 @@
{\ifx\next\bgroup
\@EA\dodotypeA
\else\if\next<%
- \doifelsevalue{\??ty\@@currenttype\c!option}\v!none
+ \doifelse{\typingparameter\c!option}\v!none
{\@EAEAEA\dodotypeB}{\@EAEAEA\dodotypeC}%
\else
\@EAEAEA\dodotypeD
\fi\fi}
+% Verbatim does not work when passed as an argument, so here is a
+% workaround. Beware, spaces are introduced after a \type {\csname}.
+
+\chardef\recodeverbatimmode\zerocount % 0=nothing 1=rescan 2=autorescan
+
+% \appendtoks \chardef\recodeverbatimmode\plustwo \to \everytabulate
+% \appendtoks \chardef\recodeverbatimmode\plustwo \to \everytable
+
+\def\dodotypeA
+ {\initializetype
+ \initializetypegrouping
+ \verbatimcolor
+ \ifcase\recodeverbatimmode
+ \@EA\dodotypeAA
+ \or
+ \@EA\dodotypeAB
+ \or
+ \ifnum\catcode`\{=\@@active
+ \@EAEAEA\dodotypeAB
+ \else
+ \@EAEAEA\dodotypeAA
+ \fi
+ \else
+ \@EA\dodotypeAA
+ \fi}
+
+\def\dodotypeAA
+ {\afterassignment\protectfirsttype\let\next=}
+
+\def\dodotypeAB
+ {\bgroup
+ \catcode`\}=\@@endgroup
+ \catcode`\{=\@@begingroup
+ \afterassignment\redotypeAB\global\globalscratchtoks}
+
+\def\redotypeAB
+ {\egroup
+ \expandafter\convertargument\the\globalscratchtoks\to\ascii
+ \ifx\scantokens\undefined\ascii\else\everyeof{\hskip-\spaceskip}\scantokens\expandafter{\ascii}\fi
+ \egroup}
+
\bgroup
\catcode`\[=\@@begingroup
\catcode`\]=\@@endgroup
\catcode`\{=\@@active
\catcode`\}=\@@active
-\gdef\initializetypegrouping%
- [\catcode`\{=\@@active
- \catcode`\}=\@@endgroup % otherwise things go wrong ...
- \def\activerightargument%
- [\rightargument
- \egroup]%
- \def\activeleftargument%
+\gdef\initializetypegrouping
+ [\ifnum\catcode`\{=\@@active
+ \let\normalactivebgroup{%
+ \let\normalactiveegroup}%
+ \else
+ \catcode`\{=\@@active
+ \catcode`\}=\@@active
+ \let\normalactivebgroup\leftargument
+ \let\normalactiveegroup\rightargument
+ \fi
+ \def\activeleftargument
[\bgroup
- \leftargument %% this way TeXEdit can check: {
- \catcode`\}=\@@active % ... in alignments (tables)
- \let}=\activerightargument]%
- \let{=\activeleftargument]% %% this way TeXEdit can check: }
+ \catcode`\}=\@@active
+ \let}\activerightargument
+ \normalactivebgroup]%
+ \def\activerightargument
+ [\normalactiveegroup
+ \egroup]%
+ \let{=\activeleftargument
+ % not \let}=\egroup, otherwise things go wrong in alignments (???)
+ \catcode`\}=\@@endgroup]
\egroup
\bgroup
@@ -433,9 +494,9 @@
\fi
\fi}
-\def\setupcommandsintype#1% can also be \string\
+\def\setupcommandsintype% can also be \string\
{\setupgroupedtype
- \edef\\{\getvalue{#1\c!escape}}%
+ \edef\\{\typingparameter\c!escape}%
\letvalue{\\}=\\% for instance \/=/
\@EA\catcode\@EA`\\=\@@escape
\def\BTEX##1\ETEX##2% ##2 gobbles active space
@@ -463,41 +524,62 @@
{\setupgroupedtype
\slantedtypepermittedtrue}
-% the next one was \string, but this prevents coloring, one can make
-% it \string again if needed
-
-\let\protectedfirsttype\relax
+\let\protectedfirsttype\string % \relax for special cases
+
+% \bgroup
+% \catcode`\<=\active
+% \catcode`\>=\active
+% \gdef\doprotectfirsttype
+% {\ifx\next<%
+% \let\next\relax
+% \else\ifx\next\bgroup
+% \let\next\relax
+% \else\ifx\next\egroup % takes care of \type{}
+% \let\next\relax
+% \else\ifx\next\activeleftargument
+% \let\next\relax
+% \else
+% \let\next\protectedfirsttype
+% \fi\fi\fi\fi
+% \next}
+% \egroup
+%
+% \def\protectfirsttype
+% {\futurelet\next\doprotectfirsttype}
+%
+% The next one is safe for:
+%
+% \def\xx#1{\type{#1}} \xx{\ifx}
\bgroup
\catcode`\<=\active
\catcode`\>=\active
\gdef\doprotectfirsttype
- {\ifx\next<%
- \let\next\relax
- \else\ifx\next\bgroup
- \let\next\relax
- \else\ifx\next\egroup % takes care of \type{}
- \let\next\relax
- \else\ifx\next\activeleftargument
- \let\next\relax
- \else
- \let\next\protectedfirsttype
- \fi\fi\fi\fi
+ {\normalifx\next<%
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\bgroup
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\egroup % takes care of \type{}
+ \endrobusttest \let\next\relax
+ \normalelse\normalifx\next\activeleftargument
+ \endrobusttest \let\next\relax
+ \normalelse
+ \endrobusttest \let\next\protectedfirsttype
+ \normalfi\normalfi\normalfi\normalfi
\next}
\egroup
\def\protectfirsttype
- {\futurelet\next\doprotectfirsttype}
+ {\beginrobusttest
+ \futurelet\next\doprotectfirsttype}
%D The neccessary initializations are done by calling
%D \type{\initializetype} which in return calls for the support
%D macro \type{\setupinlineverbatim}.
-\let\@@currenttype\empty
-
\def\initializetype
{\let\obeylines\ignorelines
- \setupcommonverbatim{\??ty\@@currenttype}%
+ \setupcommonverbatim
\setupinlineverbatim}
%D \macros
@@ -505,9 +587,6 @@
%D
%D Some characteristics of \type{\type} can be set up by:
-%\def\setuptype%
-% {\dodoubleargument\getparameters[\??ty]}
-
\def\setuptype
{\dodoubleempty\dosetuptype}
@@ -646,7 +725,8 @@
%D however
\def\setgroupedtype
- {\initializetype
+ {\let\currenttypingclass\??ty
+ \initializetype
\catcode`\{=\@@begingroup
\catcode`\}=\@@endgroup}
@@ -664,36 +744,49 @@
%D support of linenumbering, which can best be studied in the
%D documented support module.
-\def\initializetyping#1%
+\let\currenttyping \empty
+\let\currenttypingclass\??ty % saveguard
+
+\def\typingparameter#1%
+ {\executeifdefined
+ {\currenttypingclass\currenttyping#1}%
+ {\executeifdefined{\currenttypingclass#1}\empty}}
+
+\def\settypingparameter#1#2%
+ {\setvalue{\currenttypingclass\currenttyping#1}{#2}}
+\def\setxtypingparameter#1#2%
+ {\setxvalue{\currenttypingclass\currenttyping#1}{#2}}
+
+\def\initializetyping
{%\donefalse
- \switchtobodyfont[\getvalue{\??tp#1\c!bodyfont}]%
+ \switchtobodyfont[\typingparameter\c!bodyfont]%
\donefalse
- \scratchskip\getvalue{\??tp#1\c!oddmargin}\relax
+ \scratchskip\typingparameter\c!oddmargin\relax
\ifzeropt\scratchskip\else\donetrue\fi
- \scratchskip\getvalue{\??tp#1\c!evenmargin}\relax
+ \scratchskip\typingparameter\c!evenmargin\relax
\ifzeropt\scratchskip\else\donetrue\fi
\ifdone
\def\doopenupverbatimline
{\getpagestatus
\ifrightpage
- \hskip\getvalue{\??tp#1\c!oddmargin}\relax
+ \hskip\typingparameter\c!oddmargin\relax
\else
- \hskip\getvalue{\??tp#1\c!evenmargin}\relax
+ \hskip\typingparameter\c!evenmargin\relax
\fi}%
\else
- \doadaptleftskip{\getvalue{\??tp#1\c!margin}}%
+ \doadaptleftskip{\typingparameter\c!margin}%
\fi
- \doifdefinedelse{\??bo\getvalue{\??tp#1\c!blank}}
- {\edef\!!stringa{\csname\??bo\csname\??tp#1\c!blank\endcsname\endcsname}}
- {\edef\!!stringa{\csname\??tp#1\c!blank\endcsname}}%
+ \doifdefinedelse{\??bo\typingparameter\c!blank}
+ {\edef\!!stringa{\csname\??bo\typingparameter\c!blank\endcsname}}
+ {\edef\!!stringa{\typingparameter\c!blank}}%
\processaction
[\!!stringa]
- [\v!standard=>\scratchskip\ctxparskip,
+ [ \v!standard=>\scratchskip\ctxparskip,
\v!small=>\scratchskip\blankokleinmaat,
\v!medium=>\scratchskip\blankomiddelmaat,
- \v!big=>\scratchskip\blankogrootmaat,
- \v!halfline=>\scratchskip.5\baselineskip,
- \v!line=>\scratchskip\baselineskip,
+ \v!big=>\scratchskip\blankogrootmaat,
+ \v!halfline=>\scratchskip.5\baselineskip,
+ \v!line=>\scratchskip\baselineskip,
\v!none=>\scratchskip\zeropoint,
\s!unknown=>\scratchskip\commalistelement]%
\ifgridsnapping
@@ -705,24 +798,83 @@
\else
\edef\verbatimbaselineskip{\the\scratchskip}%
\fi
- \setupcommonverbatim{\??tp#1}}
+ \setupcommonverbatim}
%D The basic display verbatim commands are defined in an
%D indirect way. As we will see, they are a specific case of a
%D more general mechanism.
-\def\dostarttyping#1%
- {\getvalue{\??tp#1\c!before}%
+% formal version
+%
+% \def\dostarttyping#1%
+% {\let\currenttypingclass\??tp
+% \edef\currenttyping{#1}%
+% \typingparameter\c!before
+% \startpacked % includes \bgroup
+% \dosetuptypelinenumbering{}%
+% \initializetyping
+% \startverbatimcolor
+% \expandafter\processdisplayverbatim\expandafter{\s!stop#1}}
+
+% we need this hack because otherwise verbatim skips
+% the first line (everything after the initial command)
+
+\def\dostarttyping#1% tricky non standard lookahead
+ {\bgroup
+ \let\currenttypingclass\??tp
+ \edef\currenttyping{#1}%
+ \obeylines
+ \futurelet\nexttoken\dodostarttyping}
+
+\def\dodostarttyping
+ {\ifx\nexttoken[%
+ \expandafter\dododostarttyping
+ \else
+ \expandafter\nododostarttyping
+ \fi}
+
+\def\nododostarttyping
+ {\dododostarttyping[]}
+
+\def\dododostarttyping[#1]%
+ {\typingparameter\c!before
\startpacked % includes \bgroup
- \initializetyping{#1}%
+ \dosetuptypelinenumbering{#1}%
+ \initializetyping
\startverbatimcolor
- \expandafter\processdisplayverbatim\expandafter{\s!stop#1}}
+ \expanded{\processdisplayverbatim{\s!stop\currenttyping}}}
\def\dostoptyping#1%
{\stopverbatimcolor
\stoppacked % includes \egroup
- \getvalue{\??tp#1\c!after}%
- \dochecknextindentation{\??tp#1}}
+ \typingparameter\c!after
+ \egroup
+ \dochecknextindentation{\??tp#1}%
+ \dorechecknextindentation}
+
+%D Line numbering for files is combined with filtering, while
+%D display verbatim has the ability to continue.
+%D
+%D \starttyping
+%D \typefile[numbering=file,start=10,stop=12]{test.tex}
+%D
+%D \definetyping[code][numbering=line]
+%D
+%D \starttext
+%D \startcode
+%D ...
+%D ...
+%D \stopcode
+%D
+%D \startcode[continue]
+%D ...
+%D ...
+%D \stopcode
+%D
+%D \startcode[start=10]
+%D ...
+%D \stopcode
+%D \stoptyping
%D \macros
%D {setuptyping}
@@ -783,7 +935,8 @@
\c!blank=\v!line,
\c!escape=/, % beware \string\ , should also be accepted
\c!numbering=\v!no,
- \c!lines=]
+ \c!lines=,
+ \c!empty=]
%D \macros
%D {definetype}
@@ -796,9 +949,9 @@
\def\dodefinetype[#1][#2]%
{\unexpanded\setvalue{#1}{\dotype{#1}}%
- \copyparameters
- [\??ty#1][\??ty]
- [\c!space,\c!palet,\c!color,\c!style,\c!page,\c!tab,\c!option]%
+% \copyparameters % maybe no longer needed, implicit inheritance now
+% [\??ty#1][\??ty]
+% [\c!space,\c!palet,\c!color,\c!style,\c!page,\c!tab,\c!option]%
\getparameters[\??ty#1][#2]}
%D \macros
@@ -821,10 +974,7 @@
\def\presettyping[#1][#2]%
{\copyparameters
[\??tp#1][\??tp]
- [\c!before,\c!after,\c!space,\c!page,\c!tab,\c!color,\c!style,
- \c!text,\c!icommand,\c!vcommand,\c!ccommand,\c!bodyfont,
- \c!option,\c!palet,\c!margin,\c!evenmargin,\c!oddmargin,
- \c!indentnext,\c!blank,\c!escape,\c!lines,\c!numbering]%
+ [\c!color,\c!style]%
\getparameters
[\??tp#1]
[#2]}
@@ -912,8 +1062,8 @@
%D line basis.
%D
%D \starttyping
-%D \def\setupverbatimcolor#1%
-%D {\edef\prettypalet{\prettyidentifier\getvalue{#1\c!palet}}%
+%D \def\setupverbatimcolor%
+%D {\edef\prettypalet{\prettyidentifier\typingparameter\c!palet}%
%D \def\beginofpretty[##1]{\startcolormode{\prettypalet:##1}}%
%D \def\endofpretty {\stopcolormode}}
%D \stoptyping
@@ -921,8 +1071,8 @@
%D Since we support a global color too, the folowing
%D definition is better:
-\def\setupverbatimcolor#1% fast and local versus slow and global
- {\doifelsevaluenothing{#1\c!color}
+\def\setupverbatimcolor% fast and local versus slow and global
+ {\doifelsenothing{\typingparameter\c!color}
{\def\beginofpretty[##1]{\startcolormode{\prettypalet:##1}}%
\let\endofpretty \restorecolormode % \stopcolormode
\let\startverbatimcolor \relax
@@ -930,14 +1080,14 @@
\let\verbatimcolor \relax}
{\def\beginofpretty[##1]{\startcolor[\prettypalet:##1]}%
\let\endofpretty \stopcolor
- \def\startverbatimcolor{\startcolor[\getvalue{#1\c!color}]}%
+ \def\startverbatimcolor{\startcolor[\typingparameter\c!color]}%
\let\stopverbatimcolor \stopcolor
- \def\verbatimcolor {\getvalue{\getvalue{#1\c!color}}}}%
- \doifelsevaluenothing{#1\c!palet}
+ \def\verbatimcolor {\getvalue{\typingparameter\c!color}}}% command !
+ \doifelsenothing{\typingparameter\c!palet}
{\let\prettypalet\empty
\let\endofpretty\relax
\def\beginofpretty[##1]{}}
- {\edef\prettypalet{\prettyidentifier\getvalue{#1\c!palet}}}}
+ {\edef\prettypalet{\prettyidentifier\typingparameter\c!palet}}}
\let\prettypalet \empty
\let\startverbatimcolor\relax
@@ -1080,79 +1230,132 @@
\dodotypefile[\v!file][]{#3}%
\fi\fi}
-\unprotected \def\dosetuptypelinenumbering#1#2%
- {\doifundefined{\??tp#1\c!start}{\setuptyping[#1][\c!start=1,\c!stop=,\c!step=1,\c!nlines=,#2]}%
- \doifelsevalue{\??tp#1\c!numbering}\v!file
- {\setuplinenumbering[\c!method=\v!file]%
+% \def\dosetuptypelinenumbering#1% fuzzy
+% {\doifundefined{\currenttypingclass\currenttyping\c!start}
+% {\setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=,#1]}%
+% \doifelse{\typingparameter\c!numbering}\v!file
+% {\setuplinenumbering[\c!method=\v!file]%
+% \donetrue}
+% {\doifelse{\typingparameter\c!numbering}\v!line
+% {% \setuplinenumbering defaults start/step to 1/1, so we need
+% \doifnothing{\typingparameter\c!start }{\settypingparameter\c!start {1}}%
+% \doifnothing{\typingparameter\c!step }{\settypingparameter\c!step {1}}%
+% \doifnothing{\typingparameter\c!continue}{\settypingparameter\c!continue{}}%
+% \setuplinenumbering
+% [\c!method=\v!type,
+% \c!continue=\typingparameter\c!continue,
+% \c!start=\typingparameter\c!start,
+% \c!step=\typingparameter\c!step]%
+% \donetrue}
+% {\donefalse}}%
+% \ifdone
+% \ifx\startlinenumbering\undefined \let\startlinenumbering\relax \fi
+% \ifx\stoplinenumbering \undefined \let\stoplinenumbering \relax \fi
+% \def\beginofverbatimlines{\startlinenumbering}%
+% \def\endofverbatimlines {\stoplinenumbering }%
+% \fi}
+
+\def\dosetuptypelinenumbering#1% fuzzy
+ {\doifundefined{\currenttypingclass\currenttyping\c!start}
+ {\setuptyping[\currenttyping][\c!start=1,\c!stop=,\c!step=1,\c!nlines=]}%
+ \setuptyping[\currenttyping][#1]%
+ \doifelse{\typingparameter\c!numbering}\v!file
+ {% kind of special: filters lines !
+ \setuplinenumbering[\c!method=\v!file]%
\donetrue}
- {\doifelsevalue{\??tp#1\c!numbering}\v!line
+ {\doifelse{\typingparameter\c!numbering}\v!line
{% \setuplinenumbering defaults start/step to 1/1, so we need
- \doifvaluenothing{\??tp#1\c!start}{\setvalue{\??tp#1\c!start}{1}}%
- \doifvaluenothing{\??tp#1\c!step }{\setvalue{\??tp#1\c!step }{1}}%
+ \doifinsetelse\v!continue{#1,\typingparameter\c!start}
+ {\scratchcounter0\typingparameter\c!n
+ \setxtypingparameter\c!start{\ifnum\scratchcounter=0 1\else\number\scratchcounter\fi}}%
+ {\doifnothing{\typingparameter\c!start}{\settypingparameter\c!start{1}}}%
+ \doifnothing{\typingparameter\c!step}{\settypingparameter\c!step{1}}%
\setuplinenumbering
[\c!method=\v!type,
- \c!start=\getvalue{\??tp#1\c!start},
- \c!step=\getvalue{\??tp#1\c!step}]%
+ \c!start=\typingparameter\c!start,
+ \c!stop=\typingparameter\c!stop,
+ \c!step=\typingparameter\c!step]%
\donetrue}
{\donefalse}}%
\ifdone
+ \ifx\startlinenumbering\undefined \let\startlinenumbering\relax \fi
+ \ifx\stoplinenumbering \undefined \let\stoplinenumbering \relax \fi
\def\beginofverbatimlines{\startlinenumbering}%
- \def\endofverbatimlines {\stoplinenumbering }%
+ \def\endofverbatimlines {\stoplinenumbering\setxtypingparameter\c!n{\number\linenumber}}%
\fi}
+% \setuptyping % not needed
+% [\v!file]
+% [\c!start=1,
+% \c!stop=,
+% \c!step=1,
+% \c!continue=,
+% \c!nlines=]
+
\setuptyping
- [\v!file]
[\c!start=1,
\c!stop=,
\c!step=1,
+ \c!continue=,
\c!nlines=]
\def\dodotypefile[#1][#2]#3%
- {\getvalue{\??tp#1\c!before}%
+ {\bgroup
+ \let\currenttypingclass\??tp
+ \edef\currenttyping{#1}%
+ \typingparameter\c!before
\doiflocfileelse{#3}
- {\startpacked % includes \bgroup
- \dosetuptypelinenumbering{#1}{#2}%
- \doifinset{\getvalue{\??tp#1\c!option}}{\v!commands,\v!slanted,\v!normal}
+ \donetrue % sets \readfilename
+ {\doifinputfileelse{#3}
+ {\donetrue
+ \def\readfilename{\pathplusfile\filepath{#3}}}
+ \donefalse}%
+ \ifdone
+ \startpacked % includes \bgroup
+ \dosetuptypelinenumbering{#2}%
+ \doifinset{\typingparameter\c!option}{\v!commands,\v!slanted,\v!normal}
{\setuptyping[#1][\c!option=\v!none]}%
- \doifvalue{\??tp#1\c!option}\v!color
+ \doif{\typingparameter\c!option}\v!color
{\expandafter\aftersplitstring#3\at.\to\prettyidentifier
- \letvalue{\??tp#1\c!option}\prettyidentifier}%
- \initializetyping{#1}%
+ \settypingparameter\c!option{\prettyidentifier}}%
+ \initializetyping
\startverbatimcolor
- \makelocreadfilename{#3}%
- \doifundefinedelse{\??tp#3\v!global\c!start}
+ \doifundefinedelse{\currenttypingclass#3\v!global\c!start}
{\scratchcounter\zerocount}
- {\scratchcounter\getvalue{\??tp#3\v!global\c!start}}%
+ {\scratchcounter\getvalue{\currenttypingclass#3\v!global\c!start}}%
\advance\scratchcounter\plusone
- \setxvalue{\??tp#3\v!global\c!start}{\the\scratchcounter}%
- \doifelsevaluenothing{\??tp#1\c!start}
+ \setxvalue{\currenttypingclass#3\v!global\c!start}{\the\scratchcounter}%
+ \doifelsenothing{\typingparameter\c!start}
{\processfileverbatim\readfilename}
- {\doifvalue{\??tp#1\c!start}\v!continue
- {\setevalue{\??tp#1\c!start}%
- {\getvalue{\??tp#3\v!global\c!start}}}%
- \doifelsevaluenothing{\??tp#1\c!stop}
- {\doifelsevaluenothing{\??tp#1\c!nlines}
+ {\doif{\typingparameter\c!start}\v!continue
+ {\setevalue{\currenttypingclass#1\c!start}%
+ {\getvalue{\currenttypingclass#3\v!global\c!start}}}%
+ \doifelsenothing{\typingparameter\c!stop}
+ {\doifelsenothing{\typingparameter\c!nlines}
{\processfileverbatim\readfilename}
- {\scratchcounter\getvalue{\??tp#1\c!start}%
- \advance\scratchcounter\getvalue{\??tp#1\c!nlines}%
+ {\scratchcounter\typingparameter\c!start
+ \advance\scratchcounter\typingparameter\c!nlines
\advance\scratchcounter\minusone
- \setxvalue{\??tp#3\v!global\c!start}%
+ \setxvalue{\currenttypingclass#3\v!global\c!start}%
{\the\scratchcounter}%
\processfilelinesverbatim\readfilename
- {\getvalue{\??tp#1\c!start}}
- {\getvalue{\??tp#3\v!global\c!start}}}}%
+ {\typingparameter\c!start}
+ {\getvalue{\currenttypingclass#3\v!global\c!start}}}}%
{\processfilelinesverbatim\readfilename
- {\getvalue{\??tp#1\c!start}}
- {\getvalue{\??tp#1\c!stop }}}}%
+ {\typingparameter\c!start}
+ {\typingparameter\c!stop }}}%
\stopverbatimcolor
- \stoppacked} % includes \egroup
- {\ifmmode\hbox\fi\bgroup
+ \stoppacked % includes \egroup
+ \else
+ \ifmmode\hbox\fi\bgroup
\expanded{\convertargument#3}\to\ascii
\tttf[\makemessage\m!verbatims1\ascii]%
\showmessage\m!verbatims1\ascii
- \egroup}%
- \getvalue{\??tp#1\c!after}}
-
+ \egroup
+ \fi
+ \typingparameter\c!after
+ \egroup}
+
%D \macros
%D {filename}
%D
diff --git a/Master/texmf-dist/tex/context/base/enco-032.tex b/Master/texmf-dist/tex/context/base/enco-032.tex
new file mode 100644
index 00000000000..5c8f5fe68ee
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/enco-032.tex
@@ -0,0 +1,82 @@
+%D \module
+%D [ file=enco-032,
+%D version=2006.03.30,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=Unicode Goodies,
+%D author={Taco Hoekwater},
+%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
+
+% unicode table 32 (= hex 20)
+
+\startencoding [default]
+
+ \definecommand unic@threeperemspace {\hskip .33333em }
+ \definecommand unic@fourperemspace {\hskip .25em }
+ \definecommand unic@sixperemspace {\hskip .16667em }
+ \definecommand unic@figurespace {\hphantom{0}}
+ \definecommand unic@punctuationspace {\hphantom{,}}
+ \definecommand unic@hairspace {\hskip .08333em }
+ \definecommand unic@zerowidthspace {\hskip 0em plus 1sp }
+ \definecommand unic@zerowidthjoiner {\kern 0em }
+ \definecommand unic@zerowidthnonjoiner {\hskip 0em }
+
+ \definecommand unic@quotedblleftreversed {\mirror{\quotedblright}}
+ \definecommand unic@quoteleftreversed {\mirror{\quoteright}}
+
+ \definecommand unic@onedotleader {{\periods[1]}}
+ \definecommand unic@twodotleader {{\periods[2]}}
+ \definecommand unic@hyphenationpoint {.\allowbreak }
+
+ \definecommand unic@doubleexclamationmark {!!}
+ \definecommand unic@exclamationquestionmark {!?}
+ \definecommand unic@questionexclamationmark {?!}
+ \definecommand unic@doublequestionmark {??}
+
+ \definecommand unic@reversedpilcrowsign {\mirror{\P}}
+ \definecommand unic@reversedsemicolon {\mirror{;}}
+
+ \definecommand unic@superscriptzero {\high{0}}
+ \definecommand unic@superscripti {\high{i}}
+ \definecommand unic@superscriptfour {\high{4}}
+ \definecommand unic@superscriptfive {\high{5}}
+ \definecommand unic@superscriptsix {\high{6}}
+ \definecommand unic@superscriptseven {\high{7}}
+ \definecommand unic@superscripteight {\high{8}}
+ \definecommand unic@superscriptnine {\high{9}}
+ \definecommand unic@superscriptplus {\high{+}}
+ \definecommand unic@superscriptminus {\high{\textminus}}
+ \definecommand unic@superscriptequals {\high{=}}
+ \definecommand unic@superscriptleft {\high{(}}
+ \definecommand unic@superscriptright {\high{)}}
+ \definecommand unic@superscriptn {\high{n}}
+ \definecommand unic@subscriptzero {\low{0}}
+ \definecommand unic@subscriptone {\low{1}}
+ \definecommand unic@subscripttwo {\low{2}}
+ \definecommand unic@subscriptthree {\low{3}}
+ \definecommand unic@subscriptfour {\low{4}}
+ \definecommand unic@subscriptfive {\low{5}}
+ \definecommand unic@subscriptsix {\low{6}}
+ \definecommand unic@subscriptseven {\low{7}}
+ \definecommand unic@subscripteight {\low{8}}
+ \definecommand unic@subscriptnine {\low{9}}
+ \definecommand unic@subscriptplus {\low{+}}
+ \definecommand unic@subscriptminus {\low{\textminus}}
+ \definecommand unic@subscriptequals {\low{=}}
+ \definecommand unic@subscriptleft {\low{(}}
+ \definecommand unic@subscriptright {\low{)}}
+ \definecommand unic@subscripta {\low{a}}
+ \definecommand unic@subscripte {\low{e}}
+ \definecommand unic@subscripto {\low{o}}
+ \definecommand unic@subscriptx {\low{x}}
+ \definecommand unic@subscriptschwa {\low{\schwa}}
+
+\stopencoding
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/enco-037.tex b/Master/texmf-dist/tex/context/base/enco-037.tex
new file mode 100644
index 00000000000..d9fc653b2c5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/enco-037.tex
@@ -0,0 +1,276 @@
+%D \module
+%D [ file=enco-037,
+%D version=2006.02.13,
+%D title=\CONTEXT\ \UNICODE\ Macros,
+%D subtitle=Encoding for vector 37,
+%D author=Luigi Scarso,
+%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.
+
+\startencoding[default]
+
+\definecharacter UnicodeLightHorizontal {\uchar{37}{000}} %%BOX DRAWINGS LIGHT HORIZONTAL
+\definecharacter UnicodeHeavyHorizontal {\uchar{37}{001}} %%BOX DRAWINGS HEAVY HORIZONTAL
+\definecharacter UnicodeLightVertical {\uchar{37}{002}} %%BOX DRAWINGS LIGHT VERTICAL
+\definecharacter UnicodeHeavyVertical {\uchar{37}{003}} %%BOX DRAWINGS HEAVY VERTICAL
+\definecharacter UnicodeLightTripleDashHorizontal {\uchar{37}{004}} %%BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL
+\definecharacter UnicodeHeavyTripleDashHorizontal {\uchar{37}{005}} %%BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL
+\definecharacter UnicodeLightTripleDashVertical {\uchar{37}{006}} %%BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL
+\definecharacter UnicodeHeavyTripleDashVertical {\uchar{37}{007}} %%BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL
+\definecharacter UnicodeLightQuadrupleDashHorizontal {\uchar{37}{008}} %%BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL
+\definecharacter UnicodeHeavyQuadrupleDashHorizontal {\uchar{37}{009}} %%BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL
+\definecharacter UnicodeLightQuadrupleDashVertical {\uchar{37}{010}} %%BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL
+\definecharacter UnicodeHeavyQuadrupleDashVertical {\uchar{37}{011}} %%BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL
+\definecharacter UnicodeLightDownAndRight {\uchar{37}{012}} %%BOX DRAWINGS LIGHT DOWN AND RIGHT
+\definecharacter UnicodeDownLightAndRightHeavy {\uchar{37}{013}} %%BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY
+\definecharacter UnicodeDownHeavyAndRightLight {\uchar{37}{014}} %%BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT
+\definecharacter UnicodeHeavyDownAndRight {\uchar{37}{015}} %%BOX DRAWINGS HEAVY DOWN AND RIGHT
+\definecharacter UnicodeLightDownAndLeft {\uchar{37}{016}} %%BOX DRAWINGS LIGHT DOWN AND LEFT
+\definecharacter UnicodeDownLightAndLeftHeavy {\uchar{37}{017}} %%BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY
+\definecharacter UnicodeDownHeavyAndLeftLight {\uchar{37}{018}} %%BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT
+\definecharacter UnicodeHeavyDownAndLeft {\uchar{37}{019}} %%BOX DRAWINGS HEAVY DOWN AND LEFT
+\definecharacter UnicodeLightUpAndRight {\uchar{37}{020}} %%BOX DRAWINGS LIGHT UP AND RIGHT
+\definecharacter UnicodeUpLightAndRightHeavy {\uchar{37}{021}} %%BOX DRAWINGS UP LIGHT AND RIGHT HEAVY
+\definecharacter UnicodeUpHeavyAndRightLight {\uchar{37}{022}} %%BOX DRAWINGS UP HEAVY AND RIGHT LIGHT
+\definecharacter UnicodeHeavyUpAndRight {\uchar{37}{023}} %%BOX DRAWINGS HEAVY UP AND RIGHT
+\definecharacter UnicodeLightUpAndLeft {\uchar{37}{024}} %%BOX DRAWINGS LIGHT UP AND LEFT
+\definecharacter UnicodeUpLightAndLeftHeavy {\uchar{37}{025}} %%BOX DRAWINGS UP LIGHT AND LEFT HEAVY
+\definecharacter UnicodeUpHeavyAndLeftLight {\uchar{37}{026}} %%BOX DRAWINGS UP HEAVY AND LEFT LIGHT
+\definecharacter UnicodeHeavyUpAndLeft {\uchar{37}{027}} %%BOX DRAWINGS HEAVY UP AND LEFT
+\definecharacter UnicodeLightVerticalAndRight {\uchar{37}{028}} %%BOX DRAWINGS LIGHT VERTICAL AND RIGHT
+\definecharacter UnicodeVerticalLightAndRightHeavy {\uchar{37}{029}} %%BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY
+\definecharacter UnicodeUpHeavyAndRightDownLight {\uchar{37}{030}} %%BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT
+\definecharacter UnicodeDownHeavyAndRightUpLight {\uchar{37}{031}} %%BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT
+\definecharacter UnicodeVerticalHeavyAndRightLight {\uchar{37}{032}} %%BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT
+\definecharacter UnicodeDownLightAndRightUpHeavy {\uchar{37}{033}} %%BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY
+\definecharacter UnicodeUpLightAndRightDownHeavy {\uchar{37}{034}} %%BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY
+\definecharacter UnicodeHeavyVerticalAndRight {\uchar{37}{035}} %%BOX DRAWINGS HEAVY VERTICAL AND RIGHT
+\definecharacter UnicodeLightVerticalAndLeft {\uchar{37}{036}} %%BOX DRAWINGS LIGHT VERTICAL AND LEFT
+\definecharacter UnicodeVerticalLightAndLeftHeavy {\uchar{37}{037}} %%BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY
+\definecharacter UnicodeUpHeavyAndLeftDownLight {\uchar{37}{038}} %%BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT
+\definecharacter UnicodeDownHeavyAndLeftUpLight {\uchar{37}{039}} %%BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT
+\definecharacter UnicodeVerticalHeavyAndLeftLight {\uchar{37}{040}} %%BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT
+\definecharacter UnicodeDownLightAndLeftUpHeavy {\uchar{37}{041}} %%BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY
+\definecharacter UnicodeUpLightAndLeftDownHeavy {\uchar{37}{042}} %%BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY
+\definecharacter UnicodeHeavyVerticalAndLeft {\uchar{37}{043}} %%BOX DRAWINGS HEAVY VERTICAL AND LEFT
+\definecharacter UnicodeLightDownAndHorizontal {\uchar{37}{044}} %%BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
+\definecharacter UnicodeLeftHeavyAndRightDownLight {\uchar{37}{045}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT
+\definecharacter UnicodeRightHeavyAndLeftDownLight {\uchar{37}{046}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT
+\definecharacter UnicodeDownLightAndHorizontalHeavy {\uchar{37}{047}} %%BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY
+\definecharacter UnicodeDownHeavyAndHorizontalLight {\uchar{37}{048}} %%BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT
+\definecharacter UnicodeRightLightAndLeftDownHeavy {\uchar{37}{049}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY
+\definecharacter UnicodeLeftLightAndRightDownHeavy {\uchar{37}{050}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY
+\definecharacter UnicodeHeavyDownAndHorizontal {\uchar{37}{051}} %%BOX DRAWINGS HEAVY DOWN AND HORIZONTAL
+\definecharacter UnicodeLightUpAndHorizontal {\uchar{37}{052}} %%BOX DRAWINGS LIGHT UP AND HORIZONTAL
+\definecharacter UnicodeLeftHeavyAndRightUpLight {\uchar{37}{053}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT
+\definecharacter UnicodeRightHeavyAndLeftUpLight {\uchar{37}{054}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT
+\definecharacter UnicodeUpLightAndHorizontalHeavy {\uchar{37}{055}} %%BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY
+\definecharacter UnicodeUpHeavyAndHorizontalLight {\uchar{37}{056}} %%BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT
+\definecharacter UnicodeRightLightAndLeftUpHeavy {\uchar{37}{057}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY
+\definecharacter UnicodeLeftLightAndRightUpHeavy {\uchar{37}{058}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY
+\definecharacter UnicodeHeavyUpAndHorizontal {\uchar{37}{059}} %%BOX DRAWINGS HEAVY UP AND HORIZONTAL
+\definecharacter UnicodeLightVerticalAndHorizontal {\uchar{37}{060}} %%BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
+\definecharacter UnicodeLeftHeavyAndRightVerticalLight {\uchar{37}{061}} %%BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT
+\definecharacter UnicodeRightHeavyAndLeftVerticalLight {\uchar{37}{062}} %%BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT
+\definecharacter UnicodeVerticalLightAndHorizontalHeavy {\uchar{37}{063}} %%BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY
+\definecharacter UnicodeUpHeavyAndDownHorizontalLight {\uchar{37}{064}} %%BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT
+\definecharacter UnicodeDownHeavyAndUpHorizontalLight {\uchar{37}{065}} %%BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT
+\definecharacter UnicodeVerticalHeavyAndHorizontalLight {\uchar{37}{066}} %%BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT
+\definecharacter UnicodeLeftUpHeavyAndRightDownLight {\uchar{37}{067}} %%BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT
+\definecharacter UnicodeRightUpHeavyAndLeftDownLight {\uchar{37}{068}} %%BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT
+\definecharacter UnicodeLeftDownHeavyAndRightUpLight {\uchar{37}{069}} %%BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT
+\definecharacter UnicodeRightDownHeavyAndLeftUpLight {\uchar{37}{070}} %%BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT
+\definecharacter UnicodeDownLightAndUpHorizontalHeavy {\uchar{37}{071}} %%BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY
+\definecharacter UnicodeUpLightAndDownHorizontalHeavy {\uchar{37}{072}} %%BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY
+\definecharacter UnicodeRightLightAndLeftVerticalHeavy {\uchar{37}{073}} %%BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY
+\definecharacter UnicodeLeftLightAndRightVerticalHeavy {\uchar{37}{074}} %%BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY
+\definecharacter UnicodeHeavyVerticalAndHorizontal {\uchar{37}{075}} %%BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL
+\definecharacter UnicodeLightDoubleDashHorizontal {\uchar{37}{076}} %%BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL
+\definecharacter UnicodeHeavyDoubleDashHorizontal {\uchar{37}{077}} %%BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL
+\definecharacter UnicodeLightDoubleDashVertical {\uchar{37}{078}} %%BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL
+\definecharacter UnicodeHeavyDoubleDashVertical {\uchar{37}{079}} %%BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL
+\definecharacter UnicodeDoubleHorizontal {\uchar{37}{080}} %%BOX DRAWINGS DOUBLE HORIZONTAL
+\definecharacter UnicodeDoubleVertical {\uchar{37}{081}} %%BOX DRAWINGS DOUBLE VERTICAL
+\definecharacter UnicodeDownSingleAndRightDouble {\uchar{37}{082}} %%BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
+\definecharacter UnicodeDownDoubleAndRightSingle {\uchar{37}{083}} %%BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
+\definecharacter UnicodeDoubleDownAndRight {\uchar{37}{084}} %%BOX DRAWINGS DOUBLE DOWN AND RIGHT
+\definecharacter UnicodeDownSingleAndLeftDouble {\uchar{37}{085}} %%BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
+\definecharacter UnicodeDownDoubleAndLeftSingle {\uchar{37}{086}} %%BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
+\definecharacter UnicodeDoubleDownAndLeft {\uchar{37}{087}} %%BOX DRAWINGS DOUBLE DOWN AND LEFT
+\definecharacter UnicodeUpSingleAndRightDouble {\uchar{37}{088}} %%BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
+\definecharacter UnicodeUpDoubleAndRightSingle {\uchar{37}{089}} %%BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
+\definecharacter UnicodeDoubleUpAndRight {\uchar{37}{090}} %%BOX DRAWINGS DOUBLE UP AND RIGHT
+\definecharacter UnicodeUpSingleAndLeftDouble {\uchar{37}{091}} %%BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
+\definecharacter UnicodeUpDoubleAndLeftSingle {\uchar{37}{092}} %%BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
+\definecharacter UnicodeDoubleUpAndLeft {\uchar{37}{093}} %%BOX DRAWINGS DOUBLE UP AND LEFT
+\definecharacter UnicodeVerticalSingleAndRightDouble {\uchar{37}{094}} %%BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
+\definecharacter UnicodeVerticalDoubleAndRightSingle {\uchar{37}{095}} %%BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
+\definecharacter UnicodeDoubleVerticalAndRight {\uchar{37}{096}} %%BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
+\definecharacter UnicodeVerticalSingleAndLeftDouble {\uchar{37}{097}} %%BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
+\definecharacter UnicodeVerticalDoubleAndLeftSingle {\uchar{37}{098}} %%BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
+\definecharacter UnicodeDoubleVerticalAndLeft {\uchar{37}{099}} %%BOX DRAWINGS DOUBLE VERTICAL AND LEFT
+\definecharacter UnicodeDownSingleAndHorizontalDouble {\uchar{37}{100}} %%BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
+\definecharacter UnicodeDownDoubleAndHorizontalSingle {\uchar{37}{101}} %%BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
+\definecharacter UnicodeDoubleDownAndHorizontal {\uchar{37}{102}} %%BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
+\definecharacter UnicodeUpSingleAndHorizontalDouble {\uchar{37}{103}} %%BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
+\definecharacter UnicodeUpDoubleAndHorizontalSingle {\uchar{37}{104}} %%BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
+\definecharacter UnicodeDoubleUpAndHorizontal {\uchar{37}{105}} %%BOX DRAWINGS DOUBLE UP AND HORIZONTAL
+\definecharacter UnicodeVerticalSingleAndHorizontalDouble {\uchar{37}{106}} %%BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
+\definecharacter UnicodeVerticalDoubleAndHorizontalSingle {\uchar{37}{107}} %%BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
+\definecharacter UnicodeDoubleVerticalAndHorizontal {\uchar{37}{108}} %%BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
+\definecharacter UnicodeLightArcDownAndRight {\uchar{37}{109}} %%BOX DRAWINGS LIGHT ARC DOWN AND RIGHT
+\definecharacter UnicodeLightArcDownAndLeft {\uchar{37}{110}} %%BOX DRAWINGS LIGHT ARC DOWN AND LEFT
+\definecharacter UnicodeLightArcUpAndLeft {\uchar{37}{111}} %%BOX DRAWINGS LIGHT ARC UP AND LEFT
+\definecharacter UnicodeLightArcUpAndRight {\uchar{37}{112}} %%BOX DRAWINGS LIGHT ARC UP AND RIGHT
+\definecharacter UnicodeLightDiagonalUpperRightToLowerLeft {\uchar{37}{113}} %%BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
+\definecharacter UnicodeLightDiagonalUpperLeftToLowerRight {\uchar{37}{114}} %%BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
+\definecharacter UnicodeLightDiagonalCross {\uchar{37}{115}} %%BOX DRAWINGS LIGHT DIAGONAL CROSS
+\definecharacter UnicodeLightLeft {\uchar{37}{116}} %%BOX DRAWINGS LIGHT LEFT
+\definecharacter UnicodeLightUp {\uchar{37}{117}} %%BOX DRAWINGS LIGHT UP
+\definecharacter UnicodeLightRight {\uchar{37}{118}} %%BOX DRAWINGS LIGHT RIGHT
+\definecharacter UnicodeLightDown {\uchar{37}{119}} %%BOX DRAWINGS LIGHT DOWN
+\definecharacter UnicodeHeavyLeft {\uchar{37}{120}} %%BOX DRAWINGS HEAVY LEFT
+\definecharacter UnicodeHeavyUp {\uchar{37}{121}} %%BOX DRAWINGS HEAVY UP
+\definecharacter UnicodeHeavyRight {\uchar{37}{122}} %%BOX DRAWINGS HEAVY RIGHT
+\definecharacter UnicodeHeavyDown {\uchar{37}{123}} %%BOX DRAWINGS HEAVY DOWN
+\definecharacter UnicodeLightLeftAndHeavyRight {\uchar{37}{124}} %%BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT
+\definecharacter UnicodeLightUpAndHeavyDown {\uchar{37}{125}} %%BOX DRAWINGS LIGHT UP AND HEAVY DOWN
+\definecharacter UnicodeHeavyLeftAndLightRight {\uchar{37}{126}} %%BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT
+\definecharacter UnicodeHeavyUpAndLightDown {\uchar{37}{127}} %%BOX DRAWINGS HEAVY UP AND LIGHT DOWN
+\definecharacter UnicodeUpperHalfBlock {\uchar{37}{128}} %%UPPER HALF BLOCK
+\definecharacter UnicodeLowerOneEighthBlock {\uchar{37}{129}} %%LOWER ONE EIGHTH BLOCK
+\definecharacter UnicodeLowerOneQuarterBlock {\uchar{37}{130}} %%LOWER ONE QUARTER BLOCK
+\definecharacter UnicodeLowerThreeEighthsBlock {\uchar{37}{131}} %%LOWER THREE EIGHTHS BLOCK
+\definecharacter UnicodeLowerHalfBlock {\uchar{37}{132}} %%LOWER HALF BLOCK
+\definecharacter UnicodeLowerFiveEighthsBlock {\uchar{37}{133}} %%LOWER FIVE EIGHTHS BLOCK
+\definecharacter UnicodeLowerThreeQuartersBlock {\uchar{37}{134}} %%LOWER THREE QUARTERS BLOCK
+\definecharacter UnicodeLowerSevenEighthsBlock {\uchar{37}{135}} %%LOWER SEVEN EIGHTHS BLOCK
+\definecharacter UnicodeFullBlock {\uchar{37}{136}} %%FULL BLOCK
+\definecharacter UnicodeLeftSevenEighthsBlock {\uchar{37}{137}} %%LEFT SEVEN EIGHTHS BLOCK
+\definecharacter UnicodeLeftThreeQuartersBlock {\uchar{37}{138}} %%LEFT THREE QUARTERS BLOCK
+\definecharacter UnicodeLeftFiveEighthsBlock {\uchar{37}{139}} %%LEFT FIVE EIGHTHS BLOCK
+\definecharacter UnicodeLeftHalfBlock {\uchar{37}{140}} %%LEFT HALF BLOCK
+\definecharacter UnicodeLeftThreeEighthsBlock {\uchar{37}{141}} %%LEFT THREE EIGHTHS BLOCK
+\definecharacter UnicodeLeftOneQuarterBlock {\uchar{37}{142}} %%LEFT ONE QUARTER BLOCK
+\definecharacter UnicodeLeftOneEighthBlock {\uchar{37}{143}} %%LEFT ONE EIGHTH BLOCK
+\definecharacter UnicodeRightHalfBlock {\uchar{37}{144}} %%RIGHT HALF BLOCK
+\definecharacter UnicodeLightShade {\uchar{37}{145}} %%LIGHT SHADE
+\definecharacter UnicodeMediumShade {\uchar{37}{146}} %%MEDIUM SHADE
+\definecharacter UnicodeDarkShade {\uchar{37}{147}} %%DARK SHADE
+\definecharacter UnicodeUpperOneEighthBlock {\uchar{37}{148}} %%UPPER ONE EIGHTH BLOCK
+\definecharacter UnicodeRightOneEighthBlock {\uchar{37}{149}} %%RIGHT ONE EIGHTH BLOCK
+\definecharacter UnicodeQuadrantLowerLeft {\uchar{37}{150}} %%[Unassigned U+2596]
+\definecharacter UnicodeQuadrantLowerRight {\uchar{37}{151}} %%[Unassigned U+2597]
+\definecharacter UnicodeQuadrantUpperLeft {\uchar{37}{152}} %%[Unassigned U+2598]
+\definecharacter UnicodeQuadrantUpperLeftAndLowerLeftAndLowerRight {\uchar{37}{153}} %%[Unassigned U+2599]
+\definecharacter UnicodeQuadrantUpperLeftAndLowerRight {\uchar{37}{154}} %%[Unassigned U+259A]
+\definecharacter UnicodeQuadrantUpperLeftAndUpperRightandLowerLeft {\uchar{37}{155}} %%[Unassigned U+259B]
+\definecharacter UnicodeQuadrantUpperLeftAndUpperRightAndLowerRight {\uchar{37}{156}} %%[Unassigned U+259C]
+\definecharacter UnicodeQuadrantUpperRight {\uchar{37}{157}} %%[Unassigned U+259D]
+\definecharacter UnicodeQuadrantUpperRightAndLowerLeft {\uchar{37}{158}} %%[Unassigned U+259E]
+\definecharacter UnicodeQuadrantUpperRightAndLowerLeftAndLowerRight {\uchar{37}{159}} %%[Unassigned U+259F]
+\definecharacter UnicodeBlackSquare {\uchar{37}{160}} %%BLACK SQUARE
+\definecharacter UnicodeWhiteSquare {\uchar{37}{161}} %%WHITE SQUARE
+\definecharacter UnicodeWhiteSquareWithRoundedCorners {\uchar{37}{162}} %%WHITE SQUARE WITH ROUNDED CORNERS
+\definecharacter UnicodeWhiteSquareContainingBlackSmallSquare {\uchar{37}{163}} %%WHITE SQUARE CONTAINING BLACK SMALL SQUARE
+\definecharacter UnicodeSquareWithHorizontalFill {\uchar{37}{164}} %%SQUARE WITH HORIZONTAL FILL
+\definecharacter UnicodeSquareWithVerticalFill {\uchar{37}{165}} %%SQUARE WITH VERTICAL FILL
+\definecharacter UnicodeSquareWithOrthogonalCrosshatchFill {\uchar{37}{166}} %%SQUARE WITH ORTHOGONAL CROSSHATCH FILL
+\definecharacter UnicodeSquareWithUpperLeftToLowerRightFill {\uchar{37}{167}} %%SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL
+\definecharacter UnicodeSquareWithUpperRightToLowerLeftFill {\uchar{37}{168}} %%SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL
+\definecharacter UnicodeSquareWithDiagonalCrosshatchFill {\uchar{37}{169}} %%SQUARE WITH DIAGONAL CROSSHATCH FILL
+\definecharacter UnicodeBlackSmallSquare {\uchar{37}{170}} %%BLACK SMALL SQUARE
+\definecharacter UnicodeWhiteSmallSquare {\uchar{37}{171}} %%WHITE SMALL SQUARE
+\definecharacter UnicodeBlackRectangle {\uchar{37}{172}} %%BLACK RECTANGLE
+\definecharacter UnicodeWhiteRectangle {\uchar{37}{173}} %%WHITE RECTANGLE
+\definecharacter UnicodeBlackVerticalRectangle {\uchar{37}{174}} %%BLACK VERTICAL RECTANGLE
+\definecharacter UnicodeWhiteVerticalRectangle {\uchar{37}{175}} %%WHITE VERTICAL RECTANGLE
+\definecharacter UnicodeBlackParallelogram {\uchar{37}{176}} %%BLACK PARALLELOGRAM
+\definecharacter UnicodeWhiteParallelogram {\uchar{37}{177}} %%WHITE PARALLELOGRAM
+\definecharacter UnicodeBlackUpPointingTriangle {\uchar{37}{178}} %%BLACK UP-POINTING TRIANGLE
+\definecharacter UnicodeWhiteUpPointingTriangle {\uchar{37}{179}} %%WHITE UP-POINTING TRIANGLE
+\definecharacter UnicodeBlackUpPointingSmallTriangle {\uchar{37}{180}} %%BLACK UP-POINTING SMALL TRIANGLE
+\definecharacter UnicodeWhiteUpPointingSmallTriangle {\uchar{37}{181}} %%WHITE UP-POINTING SMALL TRIANGLE
+\definecharacter UnicodeBlackRightPointingTriangle {\uchar{37}{182}} %%BLACK RIGHT-POINTING TRIANGLE
+\definecharacter UnicodeWhiteRightPointingTriangle {\uchar{37}{183}} %%WHITE RIGHT-POINTING TRIANGLE
+\definecharacter UnicodeBlackRightPointingSmallTriangle {\uchar{37}{184}} %%BLACK RIGHT-POINTING SMALL TRIANGLE
+\definecharacter UnicodeWhiteRightPointingSmallTriangle {\uchar{37}{185}} %%WHITE RIGHT-POINTING SMALL TRIANGLE
+\definecharacter UnicodeBlackRightPointingPointer {\uchar{37}{186}} %%BLACK RIGHT-POINTING POINTER
+\definecharacter UnicodeWhiteRightPointingPointer {\uchar{37}{187}} %%WHITE RIGHT-POINTING POINTER
+\definecharacter UnicodeBlackDownPointingTriangle {\uchar{37}{188}} %%BLACK DOWN-POINTING TRIANGLE
+\definecharacter UnicodeWhiteDownPointingTriangle {\uchar{37}{189}} %%WHITE DOWN-POINTING TRIANGLE
+\definecharacter UnicodeBlackDownPointingSmallTriangle {\uchar{37}{190}} %%BLACK DOWN-POINTING SMALL TRIANGLE
+\definecharacter UnicodeWhiteDownPointingSmallTriangle {\uchar{37}{191}} %%WHITE DOWN-POINTING SMALL TRIANGLE
+\definecharacter UnicodeBlackLeftPointingTriangle {\uchar{37}{192}} %%BLACK LEFT-POINTING TRIANGLE
+\definecharacter UnicodeWhiteLeftPointingTriangle {\uchar{37}{193}} %%WHITE LEFT-POINTING TRIANGLE
+\definecharacter UnicodeBlackLeftPointingSmallTriangle {\uchar{37}{194}} %%BLACK LEFT-POINTING SMALL TRIANGLE
+\definecharacter UnicodeWhiteLeftPointingSmallTriangle {\uchar{37}{195}} %%WHITE LEFT-POINTING SMALL TRIANGLE
+\definecharacter UnicodeBlackLeftPointingPointer {\uchar{37}{196}} %%BLACK LEFT-POINTING POINTER
+\definecharacter UnicodeWhiteLeftPointingPointer {\uchar{37}{197}} %%WHITE LEFT-POINTING POINTER
+\definecharacter UnicodeBlackDiamond {\uchar{37}{198}} %%BLACK DIAMOND
+\definecharacter UnicodeWhiteDiamond {\uchar{37}{199}} %%WHITE DIAMOND
+\definecharacter UnicodeWhiteDiamondContainingBlackSmallDiamond {\uchar{37}{200}} %%WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND
+\definecharacter UnicodeFisheye {\uchar{37}{201}} %%FISHEYE
+\definecharacter UnicodeLozenge {\uchar{37}{202}} %%LOZENGE
+\definecharacter UnicodeWhiteCircle {\uchar{37}{203}} %%WHITE CIRCLE
+\definecharacter UnicodeDottedCircle {\uchar{37}{204}} %%DOTTED CIRCLE
+\definecharacter UnicodeCircleWithVerticalFill {\uchar{37}{205}} %%CIRCLE WITH VERTICAL FILL
+\definecharacter UnicodeBullseye {\uchar{37}{206}} %%BULLSEYE
+\definecharacter UnicodeBlackCircle {\uchar{37}{207}} %%BLACK CIRCLE
+\definecharacter UnicodeCircleWithLeftHalfBlack {\uchar{37}{208}} %%CIRCLE WITH LEFT HALF BLACK
+\definecharacter UnicodeCircleWithRightHalfBlack {\uchar{37}{209}} %%CIRCLE WITH RIGHT HALF BLACK
+\definecharacter UnicodeCircleWithLowerHalfBlack {\uchar{37}{210}} %%CIRCLE WITH LOWER HALF BLACK
+\definecharacter UnicodeCircleWithUpperHalfBlack {\uchar{37}{211}} %%CIRCLE WITH UPPER HALF BLACK
+\definecharacter UnicodeCircleWithUpperRightQuadrantBlack {\uchar{37}{212}} %%CIRCLE WITH UPPER RIGHT QUADRANT BLACK
+\definecharacter UnicodeCircleWithAllButUpperLeftQuadrantBlack {\uchar{37}{213}} %%CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK
+\definecharacter UnicodeLeftHalfBlackCircle {\uchar{37}{214}} %%LEFT HALF BLACK CIRCLE
+\definecharacter UnicodeRightHalfBlackCircle {\uchar{37}{215}} %%RIGHT HALF BLACK CIRCLE
+\definecharacter UnicodeInverseBullet {\uchar{37}{216}} %%INVERSE BULLET
+\definecharacter UnicodeInverseWhiteCircle {\uchar{37}{217}} %%INVERSE WHITE CIRCLE
+\definecharacter UnicodeUpperHalfInverseWhiteCircle {\uchar{37}{218}} %%UPPER HALF INVERSE WHITE CIRCLE
+\definecharacter UnicodeLowerHalfInverseWhiteCircle {\uchar{37}{219}} %%LOWER HALF INVERSE WHITE CIRCLE
+\definecharacter UnicodeUpperLeftQuadrantCircularArc {\uchar{37}{220}} %%UPPER LEFT QUADRANT CIRCULAR ARC
+\definecharacter UnicodeUpperRightQuadrantCircularArc {\uchar{37}{221}} %%UPPER RIGHT QUADRANT CIRCULAR ARC
+\definecharacter UnicodeLowerRightQuadrantCircularArc {\uchar{37}{222}} %%LOWER RIGHT QUADRANT CIRCULAR ARC
+\definecharacter UnicodeLowerLeftQuadrantCircularArc {\uchar{37}{223}} %%LOWER LEFT QUADRANT CIRCULAR ARC
+\definecharacter UnicodeUpperHalfCircle {\uchar{37}{224}} %%UPPER HALF CIRCLE
+\definecharacter UnicodeLowerHalfCircle {\uchar{37}{225}} %%LOWER HALF CIRCLE
+\definecharacter UnicodeBlackLowerRightTriangle {\uchar{37}{226}} %%BLACK LOWER RIGHT TRIANGLE
+\definecharacter UnicodeBlackLowerLeftTriangle {\uchar{37}{227}} %%BLACK LOWER LEFT TRIANGLE
+\definecharacter UnicodeBlackUpperLeftTriangle {\uchar{37}{228}} %%BLACK UPPER LEFT TRIANGLE
+\definecharacter UnicodeBlackUpperRightTriangle {\uchar{37}{229}} %%BLACK UPPER RIGHT TRIANGLE
+\definecharacter UnicodeWhiteBullet {\uchar{37}{230}} %%WHITE BULLET
+\definecharacter UnicodeSquareWithLeftHalfBlack {\uchar{37}{231}} %%SQUARE WITH LEFT HALF BLACK
+\definecharacter UnicodeSquareWithRightHalfBlack {\uchar{37}{232}} %%SQUARE WITH RIGHT HALF BLACK
+\definecharacter UnicodeSquareWithUpperLeftDiagonalHalfBlack {\uchar{37}{233}} %%SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK
+\definecharacter UnicodeSquareWithLowerRightDiagonalHalfBlack {\uchar{37}{234}} %%SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK
+\definecharacter UnicodeWhiteSquareWithVerticalBisectingLine {\uchar{37}{235}} %%WHITE SQUARE WITH VERTICAL BISECTING LINE
+\definecharacter UnicodeWhiteUpPointingTriangleWithDot {\uchar{37}{236}} %%WHITE UP-POINTING TRIANGLE WITH DOT
+\definecharacter UnicodeUpPointingTriangleWithLeftHalfBlack {\uchar{37}{237}} %%UP-POINTING TRIANGLE WITH LEFT HALF BLACK
+\definecharacter UnicodeUpPointingTriangleWithRightHalfBlack {\uchar{37}{238}} %%UP-POINTING TRIANGLE WITH RIGHT HALF BLACK
+\definecharacter UnicodeLargeCircle {\uchar{37}{239}} %%LARGE CIRCLE
+\definecharacter UnicodeWhiteSquareWithUpperLeftQuadrant {\uchar{37}{240}} %%WHITE SQUARE WITH UPPER LEFT QUADRANT
+\definecharacter UnicodeWhiteSquareWithLowerLeftQuadrant {\uchar{37}{241}} %%WHITE SQUARE WITH LOWER LEFT QUADRANT
+\definecharacter UnicodeWhiteSquareWithLowerRightQuadrant {\uchar{37}{242}} %%WHITE SQUARE WITH LOWER RIGHT QUADRANT
+\definecharacter UnicodeWhiteSquareWithUpperRightQuadrant {\uchar{37}{243}} %%WHITE SQUARE WITH UPPER RIGHT QUADRANT
+\definecharacter UnicodeWhiteCircleWithUpperLeftQuadrant {\uchar{37}{244}} %%WHITE CIRCLE WITH UPPER LEFT QUADRANT
+\definecharacter UnicodeWhiteCircleWithLowerLeftQuadrant {\uchar{37}{245}} %%WHITE CIRCLE WITH LOWER LEFT QUADRANT
+\definecharacter UnicodeWhiteCircleWithLowerRightQuadrant {\uchar{37}{246}} %%WHITE CIRCLE WITH LOWER RIGHT QUADRANT
+\definecharacter UnicodeWhiteCircleWithUpperRightQuadrant {\uchar{37}{247}} %%WHITE CIRCLE WITH UPPER RIGHT QUADRANT
+\definecharacter UnicodeUpperLeftTriangle {\uchar{37}{248}} %%[Unassigned U+25F8]
+\definecharacter UnicodeUpperRightTriangle {\uchar{37}{249}} %%[Unassigned U+25F9]
+\definecharacter UnicodeLowerLeftTriangle {\uchar{37}{250}} %%[Unassigned U+25FA]
+\definecharacter UnicodeWhiteMediumSquare {\uchar{37}{251}} %%[Unassigned U+25FB]
+\definecharacter UnicodeBlackMediumSquare {\uchar{37}{252}} %%[Unassigned U+25FC]
+\definecharacter UnicodeWhiteMediumSmallSquare {\uchar{37}{253}} %%[Unassigned U+25FD]
+\definecharacter UnicodeBlackMediumSmallSquare {\uchar{37}{254}} %%[Unassigned U+25FE]
+\definecharacter UnicodeLowerRightTriangle {\uchar{37}{255}} %%[Unassigned U+25FF]
+
+\stopencoding
+
+\endinput
+
diff --git a/Master/texmf-dist/tex/context/base/enco-agr.tex b/Master/texmf-dist/tex/context/base/enco-agr.tex
index ff53e02ded1..c50f97e518a 100644
--- a/Master/texmf-dist/tex/context/base/enco-agr.tex
+++ b/Master/texmf-dist/tex/context/base/enco-agr.tex
@@ -6,12 +6,26 @@
%D author=Thomas A. Schmitz,
%D date=\currentdate]
+\startmapping[agr]
+
+ \definecasemaps 13 to 64 lc 0 uc 0
+ \definecasemaps 65 to 66 lc +32 uc 0
+ \definecasemaps 67 to 67 lc 0 uc 0
+ \definecasemaps 68 to 85 lc +32 uc 0
+ \definecasemaps 86 to 86 lc 0 uc 0
+ \definecasemaps 87 to 90 lc +32 uc 0
+ \definecasemaps 91 to 255 lc 0 uc 0
+
+\stopmapping
+
\startencoding[agr]
\definecharacter greeksigmalunate 1
\definecharacter endash 2
\definecharacter emdash 3
\definecharacter apostrophe 4
+\definecharacter greekaltbeta 5
+\definecharacter epih 6
\definecharacter textbraceleft 8
\definecharacter textbraceright 9
diff --git a/Master/texmf-dist/tex/context/base/enco-cas.tex b/Master/texmf-dist/tex/context/base/enco-cas.tex
index 61155ee5c3d..38d12f9fa83 100644
--- a/Master/texmf-dist/tex/context/base/enco-cas.tex
+++ b/Master/texmf-dist/tex/context/base/enco-cas.tex
@@ -67,7 +67,7 @@
\defineULcharacter Dstroke dstroke
\defineULcharacter Hstroke hstroke
\defineULcharacter Lstroke lstroke
-\defineULcharacter Lslash lslash % = lstroke
+\defineULcharacter Lslash lslash
\defineULcharacter Ostroke ostroke
\defineULcharacter Tstroke tstroke
@@ -84,11 +84,11 @@
\defineULcharacter Umacron umacron
\defineULcharacter Ccedilla ccedilla
-\defineULcharacter Gcedilla gcedilla % = gcommaaccent
-\defineULcharacter Kcedilla kcedilla % = kcommaaccent
-\defineULcharacter Lcedilla lcedilla % = lcommaaccent
-\defineULcharacter Ncedilla ncedilla % = ncommaaccent
-\defineULcharacter Rcedilla rcedilla % = rcommaaccent
+\defineULcharacter Gcedilla gcedilla
+\defineULcharacter Kcedilla kcedilla
+\defineULcharacter Lcedilla lcedilla
+\defineULcharacter Ncedilla ncedilla
+\defineULcharacter Rcedilla rcedilla
\defineULcharacter Scedilla scedilla
\defineULcharacter Tcedilla tcedilla
diff --git a/Master/texmf-dist/tex/context/base/enco-chi.tex b/Master/texmf-dist/tex/context/base/enco-chi.tex
index 5addd57e93c..9d77893a01a 100644
--- a/Master/texmf-dist/tex/context/base/enco-chi.tex
+++ b/Master/texmf-dist/tex/context/base/enco-chi.tex
@@ -13,13 +13,123 @@
% actually this is also a filter -> enco-fcn.tex
-%D This is an experimental definition. Since we are dealing
-%D with unicode's, the registered values are not saved, so
-%D actually we're dealing with an pseudo encoding. The digits
-%D on the other hand are encoding specific.
+%D This is an experimental definition. Since we are dealing
+%D with unicode's, the registered values are not saved, so
+%D actually we're dealing with an pseudo encoding. The digits
+%D on the other hand are encoding specific.
% chinese classes: left=1|right=2|center=3
-
+
+% untested, probably wrong
+
+\startencoding[cjk-uni]
+
+\defineuclass 1 32 24
+\defineuclass 1 32 28
+\defineuclass 1 48 20
+\defineuclass 1 48 8
+\defineuclass 1 48 10
+\defineuclass 1 48 12
+\defineuclass 1 48 14
+\defineuclass 1 48 22
+\defineuclass 1 48 16
+\defineuclass 1 255 8
+\defineuclass 1 255 59
+\defineuclass 1 255 64
+\defineuclass 1 255 91
+
+\defineuclass 3 0 183
+\defineuclass 3 0 168
+\defineuclass 3 32 38
+\defineuclass 3 255 30
+
+\defineuclass 2 48 1
+\defineuclass 2 48 2
+\defineuclass 2 32 20
+\defineuclass 2 255 94
+\defineuclass 2 32 25
+\defineuclass 2 32 29
+\defineuclass 2 48 21
+\defineuclass 2 48 9
+\defineuclass 2 48 11
+\defineuclass 2 48 13
+\defineuclass 2 48 15
+\defineuclass 2 48 23
+\defineuclass 2 48 17
+\defineuclass 2 34 55
+\defineuclass 2 0 176
+\defineuclass 2 32 50
+\defineuclass 2 32 51
+\defineuclass 2 255 1
+\defineuclass 2 255 2
+\defineuclass 2 255 7
+\defineuclass 2 255 9
+\defineuclass 2 255 12
+\defineuclass 2 255 14
+\defineuclass 2 255 26
+\defineuclass 2 255 27
+\defineuclass 2 255 31
+\defineuclass 2 255 61
+\defineuclass 2 255 93
+
+\defineudigit 0 37 203
+\defineudigit 1 78 0
+\defineudigit 2 78 140
+\defineudigit 3 78 9
+\defineudigit 4 86 219
+\defineudigit 5 78 148
+\defineudigit 6 81 109
+\defineudigit 7 78 3
+\defineudigit 8 81 107
+\defineudigit 9 78 93
+\defineudigit 10 83 65
+\defineudigit 100 118 126
+\defineudigit 1000 83 67
+\defineudigit 10000 78 7
+\defineudigit 100000000 78 191
+
+\defineudigit 0* 150 246
+\defineudigit 1* 88 249
+\defineudigit 2* 141 48
+\defineudigit 3* 83 193
+\defineudigit 4* 128 134
+\defineudigit 5* 79 13
+\defineudigit 6* 150 70
+\defineudigit 7* 103 210
+\defineudigit 8* 99 76
+\defineudigit 9* 115 150
+\defineudigit 10* 98 254
+\defineudigit 100* 79 112
+\defineudigit 1000* 78 223
+\defineudigit 10000* 132 44
+\defineudigit 100000000* 78 191
+
+\defineudigit 20 94 255
+\defineudigit 21 78 0
+\defineudigit 22 78 140
+\defineudigit 23 78 9
+\defineudigit 24 86 219
+\defineudigit 25 78 148
+\defineudigit 26 81 109
+\defineudigit 27 78 3
+\defineudigit 28 81 107
+\defineudigit 29 78 93
+
+\defineudigit 30 83 69
+\defineudigit 31 78 0
+\defineudigit 32 78 140
+\defineudigit 33 78 9
+\defineudigit 34 86 219
+\defineudigit 35 78 148
+\defineudigit 36 81 109
+\defineudigit 37 78 3
+\defineudigit 38 81 107
+\defineudigit 39 78 93
+
+\stopencoding
+
+% \doif \currentregime {utf} \endinput
+
\startencoding[big5]
\defineuclass 1 161 93
@@ -138,7 +248,7 @@
\defineudigit 27 164 67
\defineudigit 28 164 75
\defineudigit 29 164 69
-
+
\defineudigit 30 164 202
\defineudigit 31 164 64
\defineudigit 32 164 71
@@ -258,4 +368,4 @@
\stopencoding
-\endinput
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/enco-def.tex b/Master/texmf-dist/tex/context/base/enco-def.tex
index af59a799c05..c111b6c441a 100644
--- a/Master/texmf-dist/tex/context/base/enco-def.tex
+++ b/Master/texmf-dist/tex/context/base/enco-def.tex
@@ -41,6 +41,8 @@
\definecharacter textring 23
\definecharacter texttilde 126
+\definecharacter textbottomcomma {\hbox{\lower.35ex\hbox{\tx,}}} % for mojca
+
\definecharacter dotlessi {\char"10 }
\definecharacter dotlessj {\char"11 }
\definecharacter dotlessI {I}
@@ -62,8 +64,9 @@
\definecharacter thorn {\unknownchar}
\definecharacter Thorn {\unknownchar}
-\definecharacter eth {\dstroke} % wrong but better that nothing
-\definecharacter Eth {\Dstroke} % wrong but better that nothing
+\definecharacter eth {\unknownchar} % mojca prefers this (was \dstroke)
+%definecharacter Eth {\unknownchar}
+\definecharacter Eth {\Dstroke} % mojca prefers this too
\definecharacter exclamdown 60
\definecharacter questiondown 62
@@ -347,10 +350,12 @@
\definecharacter Oumlaut {\smashaccent\Odiaeresis}
\definecharacter Uumlaut {\smashaccent\Udiaeresis}
-\definecharacter scommaaccent {s\quoteright}
-\definecharacter Scommaaccent {S\quoteright}
-\definecharacter tcommaaccent {t\quoteright}
-\definecharacter Tcommaaccent {T\quoteright}
+\definecharacter scommaaccent {\buildtextbottomcomma s}
+\definecharacter Scommaaccent {\buildtextbottomcomma S}
+\definecharacter tcommaaccent {\buildtextbottomcomma t}
+\definecharacter Tcommaaccent {\buildtextbottomcomma T}
+\definecharacter lcommaaccent {\buildtextbottomcomma l}
+\definecharacter Lcommaaccent {\buildtextbottomcomma L}
\definecharacter Etilde {\buildtextaccent\texttilde E}
\definecharacter etilde {\buildtextaccent\texttilde e}
@@ -414,10 +419,11 @@
\definecharacter udotbelow {\buildtextbottomdot u}
\definecharacter Ydotbelow {\buildtextbottomdot Y}
\definecharacter ydotbelow {\buildtextbottomdot y}
-\definecharacter Ohorndotbelow {\buildtextbottomdot O}
-\definecharacter ohorndotbelow {\buildtextbottomdot o}
-\definecharacter Uhorndotbelow {\buildtextbottomdot U}
-\definecharacter uhorndotbelow {\buildtextbottomdot u}
+
+\definecharacter Ohorndotbelow {\buildtextbottomdot\Ohorn}
+\definecharacter ohorndotbelow {\buildtextbottomdot\ohorn}
+\definecharacter Uhorndotbelow {\buildtextbottomdot\Uhorn}
+\definecharacter uhorndotbelow {\buildtextbottomdot\uhorn}
\definecharacter Acircumflexdotbelow {\buildtextbottomdot\Acircumflex}
\definecharacter acircumflexdotbelow {\buildtextbottomdot\acircumflex}
@@ -451,6 +457,17 @@
\stopencoding
+%D Needed for transliterated chinese (provided by Tobias Burnus).
+
+\startencoding[default]
+
+\definecharacter acaron {\buildtextaccent\textcaron a} % U+01CE
+\definecharacter icaron {\buildtextaccent\textcaron \dotlessi} % U+01D0
+\definecharacter ocaron {\buildtextaccent\textcaron o} % U+01D2
+\definecharacter ucaron {\buildtextaccent\textcaron u} % U+01D4
+
+\stopencoding
+
%D Greek (moved to here):
\startencoding[default]
@@ -682,30 +699,70 @@
\definecharacter cyrillicq {q}
\definecharacter cyrillicw {w}
+\definecharacter cyrillicGJE {\'\cyrillicG}
+\definecharacter cyrillicgje {\'\cyrillicg}
+\definecharacter cyrillicKJE {\'\cyrillicK}
+\definecharacter cyrillickje {\'\cyrillick}
+
\stopencoding
%D Hebrew:
\startencoding[default]
-\definecharacter hebrewAlef {'} \definecharacter hebrewBet {b} \definecharacter hebrewGimel {g} \definecharacter hebrewDalet {d} \definecharacter hebrewHe {h} \definecharacter hebrewVav {w} \definecharacter hebrewZayin {z} \definecharacter hebrewHet {\hstroke} \definecharacter hebrewTet {\tcedilla} \definecharacter hebrewYod {y} \definecharacter hebrewKaffinal {k} \definecharacter hebrewKaf {k} \definecharacter hebrewLamed {l} \definecharacter hebrewMemfinal {m} \definecharacter hebrewMem {m} \definecharacter hebrewNunfinal {n} \definecharacter hebrewNun {n} \definecharacter hebrewSamekh {s} \definecharacter hebrewAyin {\gdotaccent} \definecharacter hebrewPefinal {p} \definecharacter hebrewPe {p} \definecharacter hebrewTsadifinal {\scedilla} \definecharacter hebrewTsadi {\scedilla} \definecharacter hebrewQof {q} \definecharacter hebrewResh {r} \definecharacter hebrewShin {\scaron} \definecharacter hebrewTav {th}
+\definecharacter hebrewAlef {'}
+\definecharacter hebrewBet {b}
+\definecharacter hebrewGimel {g}
+\definecharacter hebrewDalet {d}
+\definecharacter hebrewHe {h}
+\definecharacter hebrewVav {w}
+\definecharacter hebrewZayin {z}
+\definecharacter hebrewHet {\hstroke}
+\definecharacter hebrewTet {\tcedilla}
+\definecharacter hebrewYod {y}
+\definecharacter hebrewKaffinal {k}
+\definecharacter hebrewKaf {k}
+\definecharacter hebrewLamed {l}
+\definecharacter hebrewMemfinal {m}
+\definecharacter hebrewMem {m}
+\definecharacter hebrewNunfinal {n}
+\definecharacter hebrewNun {n}
+\definecharacter hebrewSamekh {s}
+\definecharacter hebrewAyin {\gdotaccent}
+\definecharacter hebrewPefinal {p}
+\definecharacter hebrewPe {p}
+\definecharacter hebrewTsadifinal {\scedilla}
+\definecharacter hebrewTsadi {\scedilla}
+\definecharacter hebrewQof {q}
+\definecharacter hebrewResh {r}
+\definecharacter hebrewShin {\scaron}
+\definecharacter hebrewTav {th}
\stopencoding
%D A few goodies:
-\def\eszett {\ssharp}
-\def\Eszett {\Ssharp}
+\def\eszett{\ssharp}
+\def\Eszett{\Ssharp}
-\def\lslash {\lstroke}
-\def\Lslash {\Lstroke}
-\def\dslash {\dstroke}
-\def\Dslash {\Dstroke}
-\def\oslash {\ostroke}
-\def\Oslash {\Ostroke}
+\def\lslash{\lstroke}
+\def\Lslash{\Lstroke}
+\def\dslash{\dstroke}
+\def\Dslash{\Dstroke}
+\def\oslash{\ostroke}
+\def\Oslash{\Ostroke}
-\def\dcroat {\dstroke}
-\def\Dcroat {\Dstroke}
+\def\dcroat{\dstroke}
+\def\Dcroat{\Dstroke}
+
+% \startencoding [default]
+%
+% \definecharacter scommaaccent {\scedilla}
+% \definecharacter Scommaaccent {\Scedilla}
+% \definecharacter tcommaaccent {\tcedilla}
+% \definecharacter Tcommaaccent {\Tcedilla}
+%
+% \stopencoding
% for plain tex's sake
@@ -829,4 +886,13 @@
\stopencoding
+%D Also new, from Taco, for Mojca, who wanted another 8~regimes.
+
+\startencoding[\s!default]
+
+\definecharacter texthorizontalbar {{--\kern\zeropoint--}}
+\definecharacter textdong {\underbar{\dstroke}}
+
+\stopencoding
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/enco-ec.tex b/Master/texmf-dist/tex/context/base/enco-ec.tex
index aa8319e007f..4f1dfed1b8d 100644
--- a/Master/texmf-dist/tex/context/base/enco-ec.tex
+++ b/Master/texmf-dist/tex/context/base/enco-ec.tex
@@ -3,7 +3,7 @@
%D version=2000.05.07, % 1999.16.07,
%D title=\CONTEXT\ Encoding Macros,
%D subtitle=\LATEX\ EC Encoding,
-%D author={Patrick Gundlach, Hans Hagen, Taco Hoekwater},
+%D author={Patrick Gundlach, Hans Hagen, Taco Hoekwater, Mojca Miklavec},
%D date=\currentdate,
%D copyright=PRAGMA-ADE]
%C
@@ -17,30 +17,34 @@
%D
%D Annoyingly, most \POSTSCRIPT\ fonts do not have \type
%D {\dotlessj}, and T1 encoding does not make the various
-%D prebuilts with \type {j} available.
+%D prebuilts with \type {j} available. When this is the case:
%D
+%D \starttyping
+%D \startencoding[ec]
+%D \definecharacter dotlessj {j}
+%D \stopencoding
+%D \stoptyping
+%D
+%D is a way out.
+
%D There is hardly a point in supporting TS1 encoding.
\startmapping[ec]
-\resetcaserange 141 to 141
-\resetcaserange 149 to 149
-\definecasemap 159 to 159
-\resetcaserange 173 to 173
-\resetcaserange 180 to 181
-\resetcaserange 184 to 184
-\resetcaserange 189 to 191
-
-\definecasemap 157 `i 157
-\definecasemap 158 158 `D
+% a problem is that the uppercase of dstroke (158) and eth (240)
+% is the same glyph (208) so we cannot do lowercase mapping there
\definecasemaps 128 to 156 lc +32 uc 0
-\definecasemaps 160 to 188 lc 0 uc -32
-
-\definecasemaps 192 to 222 lc +32 uc 0
+\definecasemap 157 `i 157 % Idotaccent i
+\definecasemap 158 158 208 % dstroke Eth
+\definecasemap 159 159 159 % sectionmark
+\definecasemaps 160 to 187 lc 0 uc -32
+\resetcaserange 189 to 191 % exclamdown, questiondown, textsterling
+\definecasemaps 192 to 223 lc +32 uc 0
\definecasemaps 224 to 254 lc 0 uc -32
+\definecaseswap 255 223 % ssharp (else patterns fail)
-\definecaseswap 255 223
+% 156 vs. 188 IJligature
%D Some languages need this:
@@ -60,17 +64,13 @@
%D explicitly constructed.
%D
%D \startitemize[columns,two]
-%D \item \type{\dotlessj}
+%D \item \type{\dotlessj} - but then it may not be defined!!!!
%D \item \type{\IJligature}
%D \item \type{\ijligature}
%D \item \type{\Ssharp}
%D \item \type{\perthousand}
%D \item \type{\compoundwordmark}
-% %D \item \type{\textvisiblespace}
-% %D \item \type{\tcaron}
-% %D \item \type{\tcedilla }
-% %D \item \type{\Tcedilla}
-% %D \item \type{\ydiaeresis}
+% \item \type{\textvisiblespace}
%D \stopitemize
%D So, for the moment we nil them; we can always create
@@ -80,204 +80,214 @@
\startencoding[ec][ec] % second arg defines auto regime, needed here ?
+\definecharacter textgrave 0
\definecharacter textacute 1
-\definecharacter textbreve 8
-\definecharacter textcaron 7
-\definecharacter textcedilla 11
\definecharacter textcircumflex 2
+\definecharacter texttilde 3
\definecharacter textdiaeresis 4
-\definecharacter textdotaccent 10
-\definecharacter textgrave 0
\definecharacter texthungarumlaut 5
+\definecharacter textring 6
+\definecharacter textcaron 7
+\definecharacter textbreve 8
\definecharacter textmacron 9
+\definecharacter textdotaccent 10
+\definecharacter textcedilla 11
\definecharacter textogonek 12
-\definecharacter textring 6
-\definecharacter texttilde 3
-
-\definecharacter dotlessi 25
-%definecharacter dotlessj 26
-
+\definecharacter quotesinglebase 13
+\definecharacter guilsingleleft 14
+\definecharacter guilsingleright 15
+\definecharacter quotedblleft 16
+\definecharacter quotedblright 17
+\definecharacter quotedblbase 18
+\definecharacter leftguillemot 19
+\definecharacter rightguillemot 20
\definecharacter endash 21
\definecharacter emdash 22
-
-\definecharacter aeligature 230
-\definecharacter AEligature 198
-%definecharacter ijligature 188
-%definecharacter IJligature 156
-\definecharacter oeligature 247
-\definecharacter OEligature 215
-
-\definecharacter ssharp 255
-%definecharacter Ssharp 223
-
-\definecharacter thorn 254
-\definecharacter Thorn 222
-
-%definecharacter Eth 208 % no !
-\definecharacter Dstroke 208
-\definecharacter eth 240
-
-\definecharacter exclamdown 189 % lig
-\definecharacter questiondown 190 % lig
-
-\definecharacter sectionmark 159
-
-\definecharacter textsterling 191
-
-\definecharacter percent 37
-%definecharacter perthousand 24
-
-\definecharacter softhyphen 127 % ?
%definecharacter compoundwordmark 23
-
-\definecharacter textasciicircum 94
-\definecharacter textasciitilde 126
-\definecharacter textbackslash 92
-\definecharacter textbraceleft 123
-\definecharacter textbraceright 125
-\definecharacter textunderscore 95
+%definecharacter perthousand 24
+\definecharacter dotlessi 25 % or when missing: {j}
+\definecharacter dotlessj 26
+% ff 27
+% fi 28
+% fl 29
+% ffi 30
+% ffl 31
%definecharacter textvisiblespace 32
-
+% exclam ! 33
\definecharacter quotedbl 34
-\definecharacter quotedblbase 18
-\definecharacter quotedblleft 16
-\definecharacter quotedblright 17
-
-\definecharacter quotesingle 39 % fake 'm
-\definecharacter quotesinglebase 13
-
-\definecharacter quoteleft 96
+% numbersign # 35
+% dollar $ 36
+\definecharacter percent 37
+% ampersand & 38
+%definecharacter quotesingle 39 % fake 'm TODO:enco-def!!!!
\definecharacter quoteright 39
-
-\definecharacter guilsingleleft 14
-\definecharacter guilsingleright 15
-\definecharacter leftguillemot 19
-\definecharacter rightguillemot 20
-
-\definecharacter aacute 225
-\definecharacter Aacute 193
-\definecharacter cacute 162
-\definecharacter Cacute 130
-\definecharacter eacute 233
-\definecharacter Eacute 201
-\definecharacter iacute 237
-\definecharacter Iacute 205
-\definecharacter lacute 168
-\definecharacter Lacute 136
-\definecharacter Nacute 139
-\definecharacter Oacute 211
-\definecharacter nacute 171
-\definecharacter oacute 243
-\definecharacter racute 175
-\definecharacter Racute 143
-\definecharacter sacute 177
-\definecharacter Sacute 145
-\definecharacter uacute 250
-\definecharacter Uacute 218
-\definecharacter yacute 253
-\definecharacter Yacute 221
-\definecharacter zacute 185
-\definecharacter Zacute 153
-
-\definecharacter abreve 160
-\definecharacter Abreve 128
-\definecharacter gbreve 167
-\definecharacter Gbreve 135
-
-\definecharacter ccaron 163
-\definecharacter Ccaron 131
-\definecharacter dcaron 164
-\definecharacter Dcaron 132
-\definecharacter ecaron 165
-\definecharacter Ecaron 133
-\definecharacter lcaron 169
-\definecharacter Lcaron 137
-\definecharacter ncaron 172
-\definecharacter Ncaron 140
-\definecharacter rcaron 176
-\definecharacter Rcaron 144
-\definecharacter scaron 178
-\definecharacter Scaron 146
-\definecharacter tcaron 180
-\definecharacter Tcaron 148
-\definecharacter zcaron 186
-\definecharacter Zcaron 154
-
-\definecharacter ccedilla 231
-\definecharacter Ccedilla 199
-\definecharacter scedilla 179
-\definecharacter Scedilla 147
-\definecharacter tcedilla 181
-\definecharacter Tcedilla 149
-
-\definecharacter acircumflex 226
-\definecharacter Acircumflex 194
-\definecharacter ecircumflex 234
-\definecharacter Ecircumflex 202
-\definecharacter icircumflex 238
-\definecharacter Icircumflex 206
-\definecharacter ocircumflex 244
-\definecharacter Ocircumflex 212
-\definecharacter ucircumflex 251
-\definecharacter Ucircumflex 219
-
-\definecharacter adiaeresis 228
-\definecharacter Adiaeresis 196
-\definecharacter ediaeresis 235
-\definecharacter Ediaeresis 203
-\definecharacter idiaeresis 239
-\definecharacter Idiaeresis 207
-\definecharacter odiaeresis 246
-\definecharacter Odiaeresis 214
-\definecharacter udiaeresis 252
-\definecharacter Udiaeresis 220
-\definecharacter ydiaeresis 184
-\definecharacter Ydiaeresis 152
-
+% parenleft ( 40
+% parenright ) 41
+% asterisk * 42
+% plus + 43
+% comma , 44
+\definecharacter softhyphen 45
+% period . 46
+% slash / 47
+% 0-9 48-57
+% colon : 58
+% semicolon ; 59
+% less < 60
+% equal = 61
+% greater > 62
+% question ? 63
+% at @ 64
+% A-Z 65-90
+% bracketleft [ 91
+\definecharacter textbackslash 92
+% bracketright ] 93
+\definecharacter textasciicircum 94
+\definecharacter textunderscore 95
+\definecharacter quoteleft 96
+% a-z 97-122
+\definecharacter textbraceleft 123
+\definecharacter textbraceright 125
+\definecharacter textasciitilde 126
+%definecharacter softhyphen 127 % -> 45 (127 often undefined)
+\definecharacter Abreve 128 % abreve 160
+\definecharacter Aogonek 129 % aogonek 161
+\definecharacter Cacute 130 % cacute 162
+\definecharacter Ccaron 131 % ccaron 163
+\definecharacter Dcaron 132 % dcaron 164
+\definecharacter Ecaron 133 % ecaron 165
+\definecharacter Eogonek 134 % eogonek 166
+\definecharacter Gbreve 135 % gbreve 167
+\definecharacter Lacute 136 % lacute 168
+\definecharacter Lcaron 137 % lcaron 169
+\definecharacter Lstroke 138 % lstroke 170
+\definecharacter Nacute 139 % nacute 171
+\definecharacter Ncaron 140 % ncaron 172
+\definecharacter Eng 141 % eng 173
+\definecharacter Neng 141 % Neng 173
+\definecharacter Ohungarumlaut 142 % ohungarumlaut 174
+\definecharacter Racute 143 % racute 175
+\definecharacter Rcaron 144 % rcaron 176
+\definecharacter Sacute 145 % sacute 177
+\definecharacter Scaron 146 % scaron 178
+\definecharacter Scedilla 147 % scedilla 179
+\definecharacter Tcaron 148 % tcaron 180
+\definecharacter Tcedilla 149 % tcedilla 181
+\definecharacter Uhungarumlaut 150 % uhungarumlaut 182
+\definecharacter Uring 151 % uring 183
+\definecharacter Ydiaeresis 152 % ydiaeresis 184
+\definecharacter Zacute 153 % zacute 185
+\definecharacter Zcaron 154 % zcaron 186
+\definecharacter Zdotaccent 155 % zdotaccent 187
+\definecharacter IJligature 156 % ijligature 188
\definecharacter Idotaccent 157
-\definecharacter zdotaccent 187
-\definecharacter Zdotaccent 155
-
-\definecharacter agrave 224
-\definecharacter Agrave 192
-\definecharacter egrave 232
-\definecharacter Egrave 200
-\definecharacter igrave 236
-\definecharacter Igrave 204
-\definecharacter ograve 242
-\definecharacter Ograve 210
-\definecharacter ugrave 249
-\definecharacter Ugrave 217
-
-\definecharacter ohungarumlaut 174
-\definecharacter Ohungarumlaut 142
-\definecharacter uhungarumlaut 182
-\definecharacter Uhungarumlaut 150
-
-%definecharacter dmacron 158 % no !
-\definecharacter dstroke 158
-
-\definecharacter aogonek 161
-\definecharacter Aogonek 129
-\definecharacter eogonek 166
-\definecharacter Eogonek 134
+\definecharacter dstroke 158 % Dstroke 208
+\definecharacter sectionmark 159
+\definecharacter abreve 160 % Abreve 128
+\definecharacter aogonek 161 % Aogonek 129
+\definecharacter cacute 162 % Cacute 130
+\definecharacter ccaron 163 % Ccaron 131
+\definecharacter dcaron 164 % Dcaron 132
+\definecharacter ecaron 165 % Ecaron 133
+\definecharacter eogonek 166 % Eogonek 134
+\definecharacter gbreve 167 % Gbreve 135
+\definecharacter lacute 168 % Lacute 136
+\definecharacter lcaron 169 % Lcaron 137
+\definecharacter lstroke 170 % Lstroke 138
+\definecharacter nacute 171 % Nacute 139
+\definecharacter ncaron 172 % Ncaron 140
+\definecharacter eng 173 % Eng 141
+\definecharacter ohungarumlaut 174 % Ohungarumlaut 142
+\definecharacter racute 175 % Racute 143
+\definecharacter rcaron 176 % Rcaron 144
+\definecharacter sacute 177 % Sacute 145
+\definecharacter scaron 178 % Scaron 146
+\definecharacter scedilla 179 % Scedilla 147
+\definecharacter tcaron 180 % Tcaron 148
+\definecharacter tcedilla 181 % Tcedilla 149
+\definecharacter uhungarumlaut 182 % Uhungarumlaut 150
+\definecharacter uring 183 % Uring 151
+\definecharacter ydiaeresis 184 % Ydiaeresis 152
+\definecharacter zacute 185 % Zacute 153
+\definecharacter zcaron 186 % Zcaron 154
+\definecharacter zdotaccent 187 % Zdotaccent 155
+\definecharacter ijligature 188 % IJligature 156
+\definecharacter exclamdown 189
+\definecharacter questiondown 190
+\definecharacter textsterling 191
+\definecharacter Agrave 192 % agrave 224
+\definecharacter Aacute 193 % aacute 225
+\definecharacter Acircumflex 194 % acircumflex 226
+\definecharacter Atilde 195 % atilde 227
+\definecharacter Adiaeresis 196 % adiaeresis 228
+\definecharacter Aring 197 % aring 229
+\definecharacter AEligature 198 % aeligature 230
+\definecharacter Ccedilla 199 % ccedilla 231
+\definecharacter Egrave 200 % egrave 232
+\definecharacter Eacute 201 % eacute 233
+\definecharacter Ecircumflex 202 % ecircumflex 234
+\definecharacter Ediaeresis 203 % ediaeresis 235
+\definecharacter Igrave 204 % igrave 236
+\definecharacter Iacute 205 % iacute 237
+\definecharacter Icircumflex 206 % icircumflex 238
+\definecharacter Idiaeresis 207 % idiaeresis 239
+\definecharacter Eth 208 % eth 240
+\definecharacter Dstroke 208 % dstroke 158
+\definecharacter Ntilde 209 % ntilde 241
+\definecharacter Ograve 210 % ograve 242
+\definecharacter Oacute 211 % oacute 243
+\definecharacter Ocircumflex 212 % ocircumflex 244
+\definecharacter Otilde 213 % otilde 245
+\definecharacter Odiaeresis 214 % odiaeresis 246
+\definecharacter OEligature 215 % oeligature 247
+\definecharacter Ostroke 216 % ostroke 248
+\definecharacter Ugrave 217 % ugrave 249
+\definecharacter Uacute 218 % uacute 250
+\definecharacter Ucircumflex 219 % ucircumflex 251
+\definecharacter Udiaeresis 220 % udiaeresis 252
+\definecharacter Yacute 221 % yacute 253
+\definecharacter Thorn 222 % thorn 254
+\definecharacter Ssharp 223 % ssharp 255
+\definecharacter agrave 224 % Agrave 192
+\definecharacter aacute 225 % Aacute 193
+\definecharacter acircumflex 226 % Acircumflex 194
+\definecharacter atilde 227 % Atilde 195
+\definecharacter adiaeresis 228 % Adiaeresis 196
+\definecharacter aring 229 % Aring 197
+\definecharacter aeligature 230 % AEligature 198
+\definecharacter ccedilla 231 % Ccedilla 199
+\definecharacter egrave 232 % Egrave 200
+\definecharacter eacute 233 % Eacute 201
+\definecharacter ecircumflex 234 % Ecircumflex 202
+\definecharacter ediaeresis 235 % Ediaeresis 203
+\definecharacter igrave 236 % Igrave 204
+\definecharacter iacute 237 % Iacute 205
+\definecharacter icircumflex 238 % Icircumflex 206
+\definecharacter idiaeresis 239 % Idiaeresis 207
+\definecharacter eth 240 % Eth 208
+\definecharacter ntilde 241 % Ntilde 209
+\definecharacter ograve 242 % Ograve 210
+\definecharacter oacute 243 % Oacute 211
+\definecharacter ocircumflex 244 % Ocircumflex 212
+\definecharacter otilde 245 % Otilde 213
+\definecharacter odiaeresis 246 % Odiaeresis 214
+\definecharacter oeligature 247 % OEligature 215
+\definecharacter ostroke 248 % Ostroke 216
+\definecharacter ugrave 249 % Ugrave 217
+\definecharacter uacute 250 % Uacute 218
+\definecharacter ucircumflex 251 % Ucircumflex 219
+\definecharacter udiaeresis 252 % Udiaeresis 220
+\definecharacter yacute 253 % Yacute 221
+\definecharacter thorn 254 % Thorn 222
+\definecharacter ssharp 255 % Ssharp 223
-\definecharacter aring 229
-\definecharacter Aring 197
-\definecharacter uring 183
-\definecharacter Uring 151
+\stopencoding
-\definecharacter lstroke 170
-\definecharacter Lstroke 138
-\definecharacter ostroke 248
-\definecharacter Ostroke 216
+\startencoding[ec]
-\definecharacter atilde 227
-\definecharacter Atilde 195
-\definecharacter ntilde 241
-\definecharacter Ntilde 209
-\definecharacter otilde 245
-\definecharacter Otilde 213
+\definecharacter Scommaaccent {\Scedilla}
+\definecharacter scommaaccent {\scedilla}
+\definecharacter Tcommaaccent {\Tcedilla}
+\definecharacter tcommaaccent {\tcedilla}
\stopencoding
diff --git a/Master/texmf-dist/tex/context/base/enco-fde.tex b/Master/texmf-dist/tex/context/base/enco-fde.tex
index 92ce7cc96c2..bbefb51bf07 100644
--- a/Master/texmf-dist/tex/context/base/enco-fde.tex
+++ b/Master/texmf-dist/tex/context/base/enco-fde.tex
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D These definitions used to be part of lang-ger.tex.
-
\unprotect
\startlanguagespecifics[\s!de]
@@ -61,10 +59,13 @@
\startlanguagespecifics[\s!de]
- \installcompoundcharacter "` {\handlequotation\c!leftquotation}
- \installcompoundcharacter "' {\handlequotation\c!rightquotation}
+ \installcompoundcharacter "` {\startdelimitedtext[\v!quotation]}
+ \installcompoundcharacter "' {\stopdelimitedtext}
\installcompoundcharacter ". {\kern.1em\ignorespaces}
+ %installcompoundcharacter "` {\languageparameter\c!leftquotation }
+ %installcompoundcharacter "' {\languageparameter\c!rightquotation}
+
\def\setupDElanguage
{\setuplanguage
[\s!de]
diff --git a/Master/texmf-dist/tex/context/base/enco-ffr.tex b/Master/texmf-dist/tex/context/base/enco-ffr.tex
index f321b100529..1ddd226eebe 100644
--- a/Master/texmf-dist/tex/context/base/enco-ffr.tex
+++ b/Master/texmf-dist/tex/context/base/enco-ffr.tex
@@ -21,12 +21,17 @@
\unprotect
\startlanguagespecifics[\s!fr]
+ \definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{:}:}
+ \definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{;};}
+ \definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{?}?}
+ \definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentmainlanguage{!}!}
+\stoplanguagespecifics
+\startlanguagespecifics[\s!fr]
\defineactivecharacter : {\mathortext{:}{\directdiscretionary{:}}}
\defineactivecharacter ; {\mathortext{;}{\directdiscretionary{;}}}
\defineactivecharacter ! {\mathortext{!}{\directdiscretionary{!}}}
\defineactivecharacter ? {\mathortext{?}{\directdiscretionary{?}}}
-
\stoplanguagespecifics
% maybe tricky due to possible name clashes:
diff --git a/Master/texmf-dist/tex/context/base/enco-fpl.tex b/Master/texmf-dist/tex/context/base/enco-fpl.tex
index ec9c81070cc..2f90ad9c7ad 100644
--- a/Master/texmf-dist/tex/context/base/enco-fpl.tex
+++ b/Master/texmf-dist/tex/context/base/enco-fpl.tex
@@ -21,24 +21,24 @@
\appendtoks \makecharacteractive / \to \everynormalcatcodes
- \installcompoundcharacter /a {\k a}
- \installcompoundcharacter /c {\'c}
- \installcompoundcharacter /e {\k e}
- \installcompoundcharacter /l {\l}
- \installcompoundcharacter /n {\'n}
- \installcompoundcharacter /o {\'o}
- \installcompoundcharacter /s {\'s}
- \installcompoundcharacter /x {\'z}
- \installcompoundcharacter /z {\.z}
- \installcompoundcharacter /A {\k A}
- \installcompoundcharacter /C {\'C}
- \installcompoundcharacter /E {\k E}
- \installcompoundcharacter /L {\L}
- \installcompoundcharacter /N {\'N}
- \installcompoundcharacter /O {\'O}
- \installcompoundcharacter /S {\'S}
- \installcompoundcharacter /X {\'Z}
- \installcompoundcharacter /Z {\.Z}
+ \installcompoundcharacter /a {\aogonek}
+ \installcompoundcharacter /c {\cacute}
+ \installcompoundcharacter /e {\eogonek}
+ \installcompoundcharacter /l {\lstroke}
+ \installcompoundcharacter /n {\nacute}
+ \installcompoundcharacter /o {\oacute}
+ \installcompoundcharacter /s {\sacute}
+ \installcompoundcharacter /x {\zacute}
+ \installcompoundcharacter /z {\zdotaccent}
+ \installcompoundcharacter /A {\Aogonek}
+ \installcompoundcharacter /C {\Cacute}
+ \installcompoundcharacter /E {\Eogonek}
+ \installcompoundcharacter /L {\Lstroke}
+ \installcompoundcharacter /N {\Nacute}
+ \installcompoundcharacter /O {\Oacute}
+ \installcompoundcharacter /S {\Sacute}
+ \installcompoundcharacter /X {\Zacute}
+ \installcompoundcharacter /Z {\Zdotaccent}
\stoplanguagespecifics
@@ -62,28 +62,30 @@
\stoplanguagespecifics
-\startlanguagespecifics[\s!pl]
-
- \definesortkey {/a}{a}{a}{\k a}
- \definesortkey {/A}{a}{a}{\k a}
- \definesortkey {/c}{c}{a}{\'c}
- \definesortkey {/C}{c}{a}{\'c}
- \definesortkey {/e}{e}{a}{\k e}
- \definesortkey {/E}{e}{a}{\k e}
- \definesortkey {/l}{l}{a}{\l }
- \definesortkey {/L}{l}{a}{\l }
- \definesortkey {/n}{n}{a}{\'n}
- \definesortkey {/N}{n}{a}{\'n}
- \definesortkey {/o}{o}{a}{\'o}
- \definesortkey {/O}{o}{a}{\'o}
- \definesortkey {/s}{s}{a}{\'s}
- \definesortkey {/S}{s}{a}{\'s}
- \definesortkey {/x}{z}{a}{\'x}
- \definesortkey {/X}{z}{a}{\'x}
- \definesortkey {/z}{z}{b}{\.z}
- \definesortkey {/Z}{z}{b}{\.z}
-
-\stoplanguagespecifics
+% obsolete
+%
+% \startlanguagespecifics[\s!pl]
+%
+% \definesortkey {/a}{a}{a}{\k a}
+% \definesortkey {/A}{a}{a}{\k a}
+% \definesortkey {/c}{c}{a}{\'c}
+% \definesortkey {/C}{c}{a}{\'c}
+% \definesortkey {/e}{e}{a}{\k e}
+% \definesortkey {/E}{e}{a}{\k e}
+% \definesortkey {/l}{l}{a}{\l }
+% \definesortkey {/L}{l}{a}{\l }
+% \definesortkey {/n}{n}{a}{\'n}
+% \definesortkey {/N}{n}{a}{\'n}
+% \definesortkey {/o}{o}{a}{\'o}
+% \definesortkey {/O}{o}{a}{\'o}
+% \definesortkey {/s}{s}{a}{\'s}
+% \definesortkey {/S}{s}{a}{\'s}
+% \definesortkey {/x}{z}{a}{\'x}
+% \definesortkey {/X}{z}{a}{\'x}
+% \definesortkey {/z}{z}{b}{\.z}
+% \definesortkey {/Z}{z}{b}{\.z}
+%
+% \stoplanguagespecifics
\startencoding[pdfdoc]
\startlanguagespecifics[pl]% hm
diff --git a/Master/texmf-dist/tex/context/base/enco-fro.tex b/Master/texmf-dist/tex/context/base/enco-fro.tex
index b811e207e46..f6644402bdd 100644
--- a/Master/texmf-dist/tex/context/base/enco-fro.tex
+++ b/Master/texmf-dist/tex/context/base/enco-fro.tex
@@ -13,7 +13,7 @@
%D These definitions used to be part of lang-ita.tex.
-\unprotect
+\unprotect
\startlanguagespecifics[\s!ro]
@@ -21,13 +21,13 @@
\installcompoundcharacter "i {\icircumflex}
\installcompoundcharacter "s {\scedilla}
\installcompoundcharacter "t {\tcedilla}
- \installcompoundcharacter "A {\Acircumflex}
+ \installcompoundcharacter "A {\Acircumflex}
\installcompoundcharacter "I {\Icircumflex}
\installcompoundcharacter "S {\Scedilla}
\installcompoundcharacter "T {\Tcedilla}
- \installcompoundcharacter "` {\handlequotation\c!leftquotation}
- \installcompoundcharacter "' {\handlequotation\c!rightquotation}
+ \installcompoundcharacter "` {\startdelimitedtext[\v!quotation]}
+ \installcompoundcharacter "' {\stopdelimitedtext}
\stoplanguagespecifics
-\protect \endinput
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/enco-ini.tex b/Master/texmf-dist/tex/context/base/enco-ini.tex
index 2b7c85fcd04..9b78ae18da0 100644
--- a/Master/texmf-dist/tex/context/base/enco-ini.tex
+++ b/Master/texmf-dist/tex/context/base/enco-ini.tex
@@ -115,6 +115,13 @@
3: codificarea -- este necunoscuta
\stopmessages
+\startmessages french library: encodings
+ title: encodage
+ 1: encodage --
+ 2: l'encodage -- est chargé
+ 3: encodage -- inconnu
+\stopmessages
+
%D First we define a few local or not yet initialized constants.
\def\@map@{@m@ap@} % mapping prefix
@@ -203,9 +210,17 @@
\def\trueregimename#1%
{\executeifdefined{\@reg@::#1}{#1}}
+% \def\enableregime[#1]%
+% {\edef\characterregime{@\trueregimename{#1}@}%
+% \ifx\enabledregime\characterregime \else
+% \the\executeifdefined{\@reg@\characterregime}\emptytoks
+% \fi}
+
\def\enableregime[#1]%
{\edef\characterregime{@\trueregimename{#1}@}%
\ifx\enabledregime\characterregime \else
+ \doifundefined{\@reg@\characterregime}
+ {\expanded{\useregime[\pureencodingname\characterregime]}}% auto load
\the\executeifdefined{\@reg@\characterregime}\emptytoks
\fi}
@@ -377,11 +392,11 @@
\def\douseencoding#1%
{\doifundefined{\c!file\f!encodingprefix#1}%
{\letvalue{\c!file\f!encodingprefix#1}\empty
- \makeshortfilename[\f!encodingprefix#1]%
+ \makeshortfilename[\truefilename{\f!encodingprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename
- {\showmessage\m!encodings2{#1}}
- {\showmessage\m!encodings3{#1}}%
+ \readsysfile\shortfilename
+ {\showmessage\m!encodings2{#1}}
+ {\showmessage\m!encodings3{#1}}%
\stopreadingfile}}
\def\useencoding[#1]%
@@ -432,10 +447,12 @@
\def\stopsavingmappingtoks
{\global\mappingtoks\emptytoks
- \dostepwiserecurse{128}{255}\plusone
+ \dostepwiserecurse{0}{255}\plusone
{\edef\@@expanded
{\the\mappingtoks
- \noexpand\checkregimecode\recurselevel\space
+ \ifnum\recurselevel>127
+ \noexpand\checkregimecode\recurselevel\space
+ \fi
\lccode\recurselevel\ifnum\lccode\recurselevel=\zerocount\zerocount\else\space\the\lccode\recurselevel\space\fi
\uccode\recurselevel\ifnum\uccode\recurselevel=\zerocount\zerocount\else\space\the\uccode\recurselevel\space\fi
\ifnum\sfcode\recurselevel=\plusthousand\else\sfcode\recurselevel=\the\sfcode\recurselevel\space\fi
@@ -751,7 +768,8 @@
{\edef\charactermapping{@#1@}%
\ifx\enabledmapping\charactermapping \else
\doifdefined{\@map@\charactermapping}
- {\the\csname\@map@\charactermapping\endcsname}%
+ {%\expandafter\showthe\csname\@map@\charactermapping\endcsname\endcsname
+ \the\csname\@map@\charactermapping\endcsname}%
% == \the\executeifdefined{\@map@\charactermapping}\emptytoks
\edef\enabledmapping{\charactermapping}%
\enablelanguagespecifics[\currentlanguage]% new
@@ -929,43 +947,17 @@
\def\startencoding
{\dodoubleempty\dostartencoding}
-% \def\dostartencoding[#1][#2]% encoding regime
-% {\doifelsenothing{#1}
-% {\let\stopencoding\relax}
-% {%\protectfontcharacters % problematic in language loading
-% %\showmessage\m!encodings1{#1}%
-% \pushmacro\dohandleaccent % still needed?
-% \pushmacro\dohandlecommand % still needed?
-% \pushmacro\definesortkey
-% \pushmacro\characterregime
-% \pushmacro\doautosetregime
-% \let\dohandleaccent\donthandleaccent % still needed?
-% \let\dohandlecommand\donthandlecommand % still needed?
-% \let\definesortkey\savesortkey
-% \doifelsenothing{#2}%
-% {\let\doautosetregime\gobbletwoarguments}
-% {\def\characterregime{@#2@}}%
-% \enableencoding[#1]%
-% \def\stopencoding%
-% {\popmacro\doautosetregime
-% \popmacro\characterregime
-% \popmacro\definesortkey
-% \popmacro\dohandlecommand % still needed?
-% \popmacro\dohandleaccent % still needed?
-% \enableencoding[\s!default]%
-% }}}% \unprotectfontcharacters}}} % ??
-
\def\dostartencoding[#1][#2]% encoding regime
{%\showmessage\m!encodings1{#1}%
\pushmacro\characterencoding
\pushmacro\characterregime
\pushmacro\dohandleaccent % still needed?
\pushmacro\dohandlecommand % still needed?
- \pushmacro\definesortkey
+ %pushmacro\definesortkey
\pushmacro\doautosetregime
\let\dohandleaccent\donthandleaccent % still needed?
\let\dohandlecommand\donthandlecommand % still needed?
- \let\definesortkey\savesortkey
+ %let\definesortkey\savesortkey
\edef\characterencoding{@#1@}%
\doifelsenothing{#2}%
{\let\doautosetregime\gobbletwoarguments}
@@ -973,7 +965,7 @@
\def\stopencoding
{\popmacro\doautosetregime
- \popmacro\definesortkey
+ %popmacro\definesortkey
\popmacro\dohandlecommand % still needed?
\popmacro\dohandleaccent % still needed?
\popmacro\characterregime
@@ -1018,27 +1010,34 @@
%D This mechanism is currently being tested and subjected to
%D changes!
-\def\savesortkey#1#2#3#4%
- {\let\flushsortkey\relax % important
- \edef\!!stringa{sort:\characterencoding}%
- \ifundefined\!!stringa
- \let\!!stringb\empty
- \else
- \@EA\def\@EA\!!stringb\@EA{\csname\!!stringa\endcsname}%
- \fi
- \convertargument#1\to\asciiA \convertargument#2\to\asciiB
- \convertargument#3\to\asciiC \convertargument#4\to\asciiD
- \setevalue{\!!stringa}%
- {\!!stringb\flushsortkey{\asciiA}{\asciiB}{\asciiC}{\asciiD}}}
-
-\def\definesortkey#1#2#3#4%
- {}
+%D THS CODE IS OBSOLETE
-\def\flushsortkeys
- {\enablelanguagespecifics[\currentlanguage]%
- \getvalue{sort:\characterencoding}}
+% \def\savesortkey#1#2#3#4%
+% {\let\flushsortkey\relax % important
+% \edef\!!stringa{sort:\characterencoding}%
+% \ifundefined\!!stringa
+% \let\!!stringb\empty
+% \else
+% \@EA\def\@EA\!!stringb\@EA{\csname\!!stringa\endcsname}%
+% \fi
+% \convertargument#1\to\asciiA \convertargument#2\to\asciiB
+% \convertargument#3\to\asciiC \convertargument#4\to\asciiD
+% \setevalue{\!!stringa}%
+% {\!!stringb\flushsortkey{\asciiA}{\asciiB}{\asciiC}{\asciiD}}}
+%
+% \def\definesortkey#1#2#3#4%
+% {}
+%
+% \def\flushsortkeys
+% {\enablelanguagespecifics[\currentlanguage]%
+% \getvalue{sort:\characterencoding}}
+%
+% \let\flushsortkey \relax
-\let\flushsortkey\relax
+\let\definesortkey\gobblefourarguments
+\let\savesortkey \gobblefourarguments
+\let\flushsortkeys\relax
+\let\flushsortkey \relax
%D \macros
%D {defineaccent, definecharacter, definecommand}
@@ -1125,6 +1124,7 @@
\else
\enablepatterntokens
\fi
+ \let\dochar\thechr
\lccode16=16 % brrr, extra quote in ec (turkish)
\lccode17=17 % brrr, extra quote in ec (turkish)
\lccode`\-=`\-
@@ -1172,13 +1172,23 @@
% \doautosetregime{#1}{#2}}
% {\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
-\def\numcharacter#1{\char#1 }
-\let\dochar\numcharacter
+% \def\numcharacter#1{\char#1 }
+% \let\dochar\numcharacter
+
+ \def\thechr#1{\char#1 } % just in case \relax interferes
+\unexpanded\def\numchr#1{\char#1\relax}
+\unexpanded\def\strchr#1{\csname#1\endcsname}
+
+\let\dochar\numchr
+
+\def\startdirectcharacters {\pushmacro\dochar \let\dochar\thechr}
+\def\stopdirectcharacters {\popmacro \dochar}
\def\definecharacter#1 #2 %
{\ifundefined{#1}\setvalue{#1}{\dohandlecharacter{#1}}\fi
+% \doifnumberelse{\string#2}
\doifnumberelse{\string#2}
- {\setevalue{\characterprefix\characterencoding\string#1}{\dochar{#2}}%
+ {\setvalue{\characterprefix\characterencoding\string#1}{\dochar{#2}}%
\doautosetregime{#1}{#2}}
{\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
@@ -1458,11 +1468,13 @@
%D When we show 'm, we don't want to see the protection
%D measures.
-\def\currentencoding{\@EA\docurrentencoding\characterencoding}
-\def\currentregime {\@EA\docurrentencoding\characterregime }
-\def\currentmapping {\@EA\docurrentencoding\charactermapping }
+\def\currentencoding{\@EA\dopureencodingname\characterencoding}
+\def\currentregime {\@EA\dopureencodingname\characterregime }
+\def\currentmapping {\@EA\dopureencodingname\charactermapping }
+
+\def\dopureencodingname @#1@{#1}
-\def\docurrentencoding @#1@{#1}
+\def\pureencodingname#1{\@EA\dopureencodingname#1}
%D \macros
%D {showaccents, showcharacters,
@@ -1647,7 +1659,19 @@
%D The next few macros are experimental and needed for unicoded
%D chinese characters.
-\def\defineuclass #1 #2 #3 {\setvalue{uc#2#3}{#1}}
+\beginETEX
+ \def\defineuclass #1 #2 #3 %
+ {\setvalue{uc\the\numexpr#2*256+#3\relax}{#1}}
+\endETEX
+
+\beginTEX
+ \def\defineuclass #1 #2 #3 %
+ {\scratchcounter256\relax
+ \multiply\scratchcounter#2\relax
+ \advance\scratchcounter#3\relax
+ \setvalue{uc\the\scratchcounter}{#1}}
+\endTEX
+
\def\defineudigit #1 #2 #3 {\setvalue{\characterencoding uc#1}{\uchar{#2}{#3}}}
%D It may look strange, but for the moment, we want the encoding
@@ -1848,6 +1872,10 @@
\definecommand d {\buildtextbottomdot}
\definecommand k {\buildtextogonek}
+%D A collectors item:
+
+\def\buildtextbottomcomma{\bottomaccent{.15ex}{0}{5}{\tx,}}
+
%D Rarely needed but there:
\unexpanded\def\topaccent#1#2#3#4#5% down right slantcorrection accent char
@@ -1921,15 +1949,27 @@
% new, to be documented (oeps, conflicts with existing code)
+\def\donthandleaccent #1{\expandafter\string\csname#1\endcsname\space}
+\def\donthandlecommand #1{\expandafter\string\csname#1\endcsname\space}
+\def\donthandlecharacter #1{\expandafter\string\csname#1\endcsname\space}
+
+\def\stringifyhandleaccent #1{\strchr{#1}}
+\def\stringifyhandlecommand #1{\strchr{#1}}
+\def\stringifyhandlecharacter#1{\strchr{#1}}
+
+\def\keephandleaccent #1{\expandafter\noexpand\csname#1\endcsname}
+\def\keephandlecommand #1{\expandafter\noexpand\csname#1\endcsname}
+\def\keephandlecharacter #1{\expandafter\noexpand\csname#1\endcsname}
+
+\def\handleaccent #1{\csname#1\endcsname}
+\def\handlecommand #1{\csname#1\endcsname}
+\def\handlecharacter #1{\csname#1\endcsname}
+
\def\dontexpandencoding
{\let\dohandleaccent \donthandleaccent
\let\dohandlecommand \donthandlecommand
\let\dohandlecharacter\donthandlecharacter}
-\def\donthandleaccent #1{\expandafter\string\csname#1\endcsname\space}
-\def\donthandlecommand #1{\expandafter\string\csname#1\endcsname\space}
-\def\donthandlecharacter#1{\expandafter\string\csname#1\endcsname\space}
-
\def\keepencodedtokens
{\let\dohandleaccent \keephandleaccent
\let\dohandlecommand \keephandlecommand
@@ -1940,13 +1980,10 @@
% \let\dohandlecommand \keephandlecommand
\let\dohandlecharacter\keephandlecharacter}
-\def\keephandleaccent #1{\expandafter\noexpand\csname#1\endcsname}
-\def\keephandlecommand #1{\expandafter\noexpand\csname#1\endcsname}
-\def\keephandlecharacter#1{\expandafter\noexpand\csname#1\endcsname}
-
-\def\handleaccent #1{\csname#1\endcsname}
-\def\handlecommand #1{\csname#1\endcsname}
-\def\handlecharacter#1{\csname#1\endcsname}
+\def\stringifyencodedtokens
+ {% \let\dohandleaccent \stringifyhandleaccent
+ % \let\dohandlecommand \stringifyhandlecommand
+ \let\dohandlecharacter\stringifyhandlecharacter}
\unexpanded\def\uhandleaccent #1{\csname#1\endcsname}
\unexpanded\def\uhandlecommand #1{\csname#1\endcsname}
@@ -1957,17 +1994,19 @@
\def\dohandlecommand {\uhandlecommand}%
\def\dohandlecharacter{\uhandlecharacter}}
+\def\convertencodedtokens{\dontexpandencoding}
+
%D Still valid? To be checked:
+\def\doignoreaccent #1#2{\string#1\string#2}%
+\def\doignorecommand #1{\string#1}
+\def\doignorecharacter#1{\string#1}
+
\def\ignoreencoding
{\let\dohandleaccent \doignoreaccent
\let\dohandlecommand \doignorecommand
\let\dohandlecharacter\doignorecharacter}
-\def\doignoreaccent #1#2{\string#1\string#2}%
-\def\doignorecommand #1{\string#1}
-\def\doignorecharacter#1{\string#1}
-
\appendtoks
\ignoreencoding
\to \everycleanupfeatures
@@ -1985,7 +2024,9 @@
\useencoding[def,acc,raw,com,cas,mis] % mis should come first
-\useencoding[ans,il2,ec,tbo,pdf,uc,pol,qx,t5,cyr]
+\useencoding[ans,il2,ec,tbo,pdf,uc,pol,qx,t5,cyr,agr] % pol and il2 will go away
+
+\useencoding[032,033,037]
\setupencoding[\s!default=ec] % was: [\s!default=\s!default]
diff --git a/Master/texmf-dist/tex/context/base/enco-mis.tex b/Master/texmf-dist/tex/context/base/enco-mis.tex
index b089fe5695a..d3e5b7883cd 100644
--- a/Master/texmf-dist/tex/context/base/enco-mis.tex
+++ b/Master/texmf-dist/tex/context/base/enco-mis.tex
@@ -143,18 +143,18 @@
% perthings
-\def\fakeperthousand
- {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle00}}}
-
\def\fakepercent
{\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle0}}}
+\def\fakeperthousand
+ {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle00}}}
+
\def\fakepermine
{\dontleavehmode
\bgroup
- \setbox0\hbox
+ \setbox\scratchbox\hbox
{\mathematics{+}}%
- \hbox to \wd0
+ \hbox to \wd\scratchbox
{\hss
\mathematics{^{\scriptscriptstyle-}\kern-.4em/\kern-.3em_{\scriptscriptstyle-}}%
\hss}%
@@ -214,7 +214,9 @@
\ifx\mathunderscore\undefined \let\mathunderscore\fakeunderscore \fi
\ifx\textunderscore\undefined \let\textunderscore\fakeunderscore \fi
-\def\_{\ifmmode\mathunderscore\else\textunderscore\fi}
+\unexpanded\def\normalunderscore{\ifmmode\mathunderscore\else\textunderscore\fi}
+
+\let\_\normalunderscore
% Handy but obsolete, replaced by \unknownchar:
%
diff --git a/Master/texmf-dist/tex/context/base/enco-pfr.tex b/Master/texmf-dist/tex/context/base/enco-pfr.tex
index 9507d9e4e5b..a74a8c6a72a 100644
--- a/Master/texmf-dist/tex/context/base/enco-pfr.tex
+++ b/Master/texmf-dist/tex/context/base/enco-pfr.tex
@@ -137,6 +137,8 @@
% {\doif{#1}\currentencoding
% {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}}
+% alternatively we can use object references
+
\long\def\startpdffontresource[#1]#2\stoppdffontresource
{\doif{#1}\currentencoding{\doifdefined\pdffontresource
{\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}}}
@@ -151,20 +153,33 @@
\appendtoksonce \includepdffontresource \to \everyfont
+% \def\includepdffontresource
+% {\ifincludepdffontresources
+% \ifx\pdffontattr\undefined
+% % we're not using (a recent version of) pdftex
+% \else\ifcase\pdfoutput
+% % we're not in pdf mode
+% \else
+% \doincludepdffontresource
+% \fi\fi
+% \fi}
+
\def\includepdffontresource
{\ifincludepdffontresources
- \ifx\pdffontattr\undefined
- % we're not using (a recent version of) pdftex
- \else\ifcase\pdfoutput
- % we're not in pdf mode
- \else
- \doincludepdffontresource
- \fi\fi
+ \expandafter\ifx\the\font\nullfont \else
+ \ifx\pdffontattr\undefined
+ % we're not using (a recent version of) pdftex
+ \else\ifcase\pdfoutput
+ % we're not in pdf mode
+ \else
+ \doincludepdffontresource
+ \fi\fi
+ \fi
\fi}
\def\dododoincludepdffontresource#1% encoding
{\bgroup
- \def\currentencoding{#1}%
+ \edef\currentencoding{#1}%
\doifvaluesomething\pdffontfileresource
{\startreadingfile
\readsysfile{pdfr-\getvalue\pdffontfileresource}\donothing\donothing
@@ -190,9 +205,10 @@
\doifsomething\pdffontfileresource
{\pdfobj reserveobjnum {}%
\setxvalue\pdffontresource{\the\pdflastobj}%
- \doglobal\appendetoks
- \noexpand\dododoincludepdffontresource{\currentencoding}%
- \to \everybeforeshipout}% prevent multiple loading
+ \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}%
+% \doglobal\appendetoks
+% \noexpand\dododoincludepdffontresource{\currentencoding}%
+% \to \everybeforeshipout}% prevent multiple loading
\fi\fi
\ifcsname\pdffontresource\endcsname
\expanded{\pdffontattr\font{/ToUnicode \csname\pdffontresource\endcsname\space0 R}}%
@@ -216,9 +232,10 @@
\doifsomething\pdffontfileresource
{\pdfobj reserveobjnum {}%
\setxvalue\pdffontresource{\the\pdflastobj}%
- \doglobal\appendetoks
- \noexpand\dododoincludepdffontresource{\currentencoding}%
- \to \everybeforeshipout}% prevent multiple loading
+ \flushatshipout{\dododoincludepdffontresource{\currentencoding}}}%
+% \doglobal\appendetoks
+% \noexpand\dododoincludepdffontresource{\currentencoding}%
+% \to \everybeforeshipout}% prevent multiple loading
\fi
\fi
\expandafter\ifx\csname\pdffontresource\endcsname\relax\else
diff --git a/Master/texmf-dist/tex/context/base/enco-pol.tex b/Master/texmf-dist/tex/context/base/enco-pol.tex
index d9f49a2dc6b..a012f03708c 100644
--- a/Master/texmf-dist/tex/context/base/enco-pol.tex
+++ b/Master/texmf-dist/tex/context/base/enco-pol.tex
@@ -98,29 +98,31 @@
\stopencoding
-\startencoding[pl0]
-
-\definesortkey {161} {a}{a}{\k a} \definesortkey {129} {a}{a}{\k a}
-\definesortkey {162} {c}{a}{\'c} \definesortkey {130} {c}{a}{\'c}
-\definesortkey {166} {e}{a}{\k e} \definesortkey {134} {e}{a}{\k e}
-\definesortkey {170} {l}{a}{\l } \definesortkey {138} {l}{a}{\l }
-\definesortkey {171} {n}{a}{\'n} \definesortkey {139} {n}{a}{\'n}
-\definesortkey {177} {s}{a}{\'s} \definesortkey {145} {s}{a}{\'s}
-\definesortkey {185} {z}{a}{\'z} \definesortkey {153} {z}{a}{\'z}
-\definesortkey {187} {z}{b}{\.z} \definesortkey {155} {z}{b}{\.z}
-\definesortkey {243} {o}{a}{\'o} \definesortkey {211} {o}{a}{\'o}
-
-\definesortkey {\'c} {c}{a}{\'c} \definesortkey {\'C} {c}{a}{\'c}
-\definesortkey {\'n} {n}{a}{\'n} \definesortkey {\'N} {n}{a}{\'n}
-\definesortkey {\'o} {o}{a}{\'o} \definesortkey {\'O} {o}{a}{\'o}
-\definesortkey {\'s} {s}{a}{\'s} \definesortkey {\'S} {s}{a}{\'s}
-\definesortkey {\'z} {z}{a}{\'z} \definesortkey {\'Z} {z}{a}{\'z}
-\definesortkey {\.z} {z}{b}{\.z} \definesortkey {\.Z} {z}{b}{\.z}
-\definesortkey {\k a}{a}{a}{\k a} \definesortkey {\k A}{a}{a}{\k a}
-\definesortkey {\k e}{e}{a}{\k e} \definesortkey {\k E}{e}{a}{\k e}
-\definesortkey {\l } {l}{a}{\l} \definesortkey {\L } {l}{a}{\l}
-
-\stopencoding
+% obsolete
+%
+% \startencoding[pl0]
+%
+% \definesortkey {161} {a}{a}{\k a} \definesortkey {129} {a}{a}{\k a}
+% \definesortkey {162} {c}{a}{\'c} \definesortkey {130} {c}{a}{\'c}
+% \definesortkey {166} {e}{a}{\k e} \definesortkey {134} {e}{a}{\k e}
+% \definesortkey {170} {l}{a}{\l } \definesortkey {138} {l}{a}{\l }
+% \definesortkey {171} {n}{a}{\'n} \definesortkey {139} {n}{a}{\'n}
+% \definesortkey {177} {s}{a}{\'s} \definesortkey {145} {s}{a}{\'s}
+% \definesortkey {185} {z}{a}{\'z} \definesortkey {153} {z}{a}{\'z}
+% \definesortkey {187} {z}{b}{\.z} \definesortkey {155} {z}{b}{\.z}
+% \definesortkey {243} {o}{a}{\'o} \definesortkey {211} {o}{a}{\'o}
+%
+% \definesortkey {\'c} {c}{a}{\'c} \definesortkey {\'C} {c}{a}{\'c}
+% \definesortkey {\'n} {n}{a}{\'n} \definesortkey {\'N} {n}{a}{\'n}
+% \definesortkey {\'o} {o}{a}{\'o} \definesortkey {\'O} {o}{a}{\'o}
+% \definesortkey {\'s} {s}{a}{\'s} \definesortkey {\'S} {s}{a}{\'s}
+% \definesortkey {\'z} {z}{a}{\'z} \definesortkey {\'Z} {z}{a}{\'z}
+% \definesortkey {\.z} {z}{b}{\.z} \definesortkey {\.Z} {z}{b}{\.z}
+% \definesortkey {\k a}{a}{a}{\k a} \definesortkey {\k A}{a}{a}{\k a}
+% \definesortkey {\k e}{e}{a}{\k e} \definesortkey {\k E}{e}{a}{\k e}
+% \definesortkey {\l } {l}{a}{\l} \definesortkey {\L } {l}{a}{\l}
+%
+% \stopencoding
%D Polish CP-1250 encoding.
diff --git a/Master/texmf-dist/tex/context/base/enco-run.tex b/Master/texmf-dist/tex/context/base/enco-run.tex
index 8622a238802..f27b6593757 100644
--- a/Master/texmf-dist/tex/context/base/enco-run.tex
+++ b/Master/texmf-dist/tex/context/base/enco-run.tex
@@ -127,11 +127,12 @@
\gdef\showhyphenations#1%
{\starttabulate[|le|l|]
- \NC language \NC \currentlanguage (code:\the\normallanguage) \NC \NR
- \NC font \NC \fontname\font \NC \NR
- \NC encoding \NC \currentencoding \NC \NR
- \NC mapping \NC \currentencoding \NC \NR
- \NC sample \NC \hyphenatedword{#1} \NC \NR
+ \NC language \NC \currentlanguage\ (internal code:\the\normallanguage) \NC \NR
+ \NC font \NC \fontname\font \NC \NR
+ \NC encoding \NC \ifx\@@fontencoding\empty not set\else\@@fontencoding\fi \NC \NR
+ \NC mapping \NC \ifx\@@fontmapping \empty not set\else\@@fontmapping \fi \NC \NR
+ \NC handling \NC \ifx\@@fonthandling\empty not set\else\@@fonthandling\fi \NC \NR
+ \NC sample \NC \hyphenatedword{#1} \NC \NR
\stoptabulate}
\gdef\showmapping
diff --git a/Master/texmf-dist/tex/context/base/filt-ini.tex b/Master/texmf-dist/tex/context/base/filt-ini.tex
index ec4fa257b76..d6e03f9684a 100644
--- a/Master/texmf-dist/tex/context/base/filt-ini.tex
+++ b/Master/texmf-dist/tex/context/base/filt-ini.tex
@@ -58,6 +58,12 @@
2: filtro sconosciuto --
\stopmessages
+\startmessages french library: filters
+ title: filtre
+ 1: le filtre -- est chargé
+ 2: filtre -- inconnu
+\stopmessages
+
%D \macros
%D {definefiltersynonym}
@@ -129,11 +135,11 @@
\def\dousefilter#1%
{\doifundefined{\c!file\f!filterprefix#1}%
{\letvalue{\c!file\f!filterprefix#1}\empty
- \makeshortfilename[\f!filterprefix#1]%
+ \makeshortfilename[\truefilename{\f!filterprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename
- {\showmessage\m!filters1{#1}}
- {\showmessage\m!filters2{#1}}%
+ \readsysfile\shortfilename
+ {\showmessage\m!filters1{#1}}
+ {\showmessage\m!filters2{#1}}%
\stopreadingfile}}
\def\usefilter[#1]%
diff --git a/Master/texmf-dist/tex/context/base/font-chi.tex b/Master/texmf-dist/tex/context/base/font-chi.tex
index 7a602d4ab83..cf30470d7e5 100644
--- a/Master/texmf-dist/tex/context/base/font-chi.tex
+++ b/Master/texmf-dist/tex/context/base/font-chi.tex
@@ -12,8 +12,16 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\ifx\handlechineseunicodeglyph\undefined \else \endinput \fi
+
% NOT YET ADAPTED TO THE NEW FONT MACROS
+%D The first implementation (most of which is here) is based on
+%D the specific font layout. This is because not all glyphs are
+%D available in uniciode, which means that we cannot use
+%D unicode codepoints (yet); if it were possible we could use
+%D just one table per input encoding.
+
\writestatus{loading}{Context Font Macros / Chinese}
% much will to typo-chi.tex
@@ -36,7 +44,6 @@
%M \def\WangLei{\purechinese{\uchar{205}{245}\uchar{192}{218}}}
\useencoding[chi]
-\loadmapfile[gbk]
%D When \WangLei\ sent me a mail asking if \CONTEXT\ was able
%D to support Chinese, I wasn't sure if the answer could be
@@ -106,11 +113,13 @@
%D There are a few variables, that can be (re|)|set
%D depending on the current font. They default to:
+% hm, why don't we use the normal unicodestrut mechanism?
+
\def\chineseunicodescale {1.00} % not smaller than .85
\def\chineseunicodeheight {1.00}
\def\chineseunicodedepth {1.00}
-\def\chineseinterglyphskip{0pt plus .05em minus .01em}
-\def\chinesesurroundskip {.25em plus .15em minus .05em}
+\def\chineseinterglyphskip{0pt \!!plus .05em \!!minus .01em}
+\def\chinesesurroundskip {.25em \!!plus .15em \!!minus .05em}
%D We define a few signals. As said, another example of
%D using signals can be found in the module \type {m-units}.
@@ -154,90 +163,30 @@
\horizontalchineseunicodeglyph
\fi\fi}
-% This is a previous, very encoding specific, attempt. The
-% current implementation is more versatile.
-%
-% \starttypen
-% \def\chineseleftglyph {\chardef\chineseSstatus=1 }
-% \def\chineserightglyph {\chardef\chineseSstatus=2 }
-% \def\chinesecenterglyph {\chardef\chineseSstatus=3 }
-%
-% \def\analyzechineseunicodeglyph%
-% {% left
-% \ifnum\unicodeposition=161174 \chineseleftglyph \else
-% \ifnum\unicodeposition=161176 \chineseleftglyph \else
-% \ifnum\unicodeposition=161178 \chineseleftglyph \else
-% \ifnum\unicodeposition=161180 \chineseleftglyph \else
-% \ifnum\unicodeposition=161182 \chineseleftglyph \else
-% \ifnum\unicodeposition=161184 \chineseleftglyph \else
-% \ifnum\unicodeposition=161186 \chineseleftglyph \else
-% \ifnum\unicodeposition=161188 \chineseleftglyph \else
-% \ifnum\unicodeposition=161190 \chineseleftglyph \else
-% \ifnum\unicodeposition=163168 \chineseleftglyph \else
-% \ifnum\unicodeposition=163219 \chineseleftglyph \else
-% \ifnum\unicodeposition=163224 \chineseleftglyph \else
-% \ifnum\unicodeposition=163251 \chineseleftglyph \else
-% % right
-% \ifnum\unicodeposition=161162 \chineserightglyph \else
-% \ifnum\unicodeposition=161163 \chineserightglyph \else
-% \ifnum\unicodeposition=161175 \chineserightglyph \else
-% \ifnum\unicodeposition=161177 \chineserightglyph \else
-% \ifnum\unicodeposition=161179 \chineserightglyph \else
-% \ifnum\unicodeposition=161181 \chineserightglyph \else
-% \ifnum\unicodeposition=161183 \chineserightglyph \else
-% \ifnum\unicodeposition=161185 \chineserightglyph \else
-% \ifnum\unicodeposition=161187 \chineserightglyph \else
-% \ifnum\unicodeposition=161189 \chineserightglyph \else
-% \ifnum\unicodeposition=161191 \chineserightglyph \else
-% \ifnum\unicodeposition=161227 \chineserightglyph \else
-% \ifnum\unicodeposition=161228 \chineserightglyph \else
-% \ifnum\unicodeposition=161229 \chineserightglyph \else
-% \ifnum\unicodeposition=163161 \chineserightglyph \else
-% \ifnum\unicodeposition=163162 \chineserightglyph \else
-% \ifnum\unicodeposition=163167 \chineserightglyph \else
-% \ifnum\unicodeposition=163169 \chineserightglyph \else
-% \ifnum\unicodeposition=163172 \chineserightglyph \else
-% \ifnum\unicodeposition=163174 \chineserightglyph \else
-% \ifnum\unicodeposition=163186 \chineserightglyph \else
-% \ifnum\unicodeposition=163187 \chineserightglyph \else
-% \ifnum\unicodeposition=163191 \chineserightglyph \else
-% \ifnum\unicodeposition=163221 \chineserightglyph \else
-% \ifnum\unicodeposition=163253 \chineserightglyph \else
-% % center
-% \ifnum\unicodeposition=161164 \chinesecenterglyph \else
-% \ifnum\unicodeposition=161167 \chinesecenterglyph \else
-% \ifnum\unicodeposition=161173 \chinesecenterglyph \else
-% \ifnum\unicodeposition=163190 \chinesecenterglyph \else
-% % unknown
-% \chardef\chineseSstatus=0
-% \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi
-% \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi}
-% \stoptypen
-%
% chinese classes: left=1|right=2|center=3
\chardef\plusfour=4
\def\analyzechineseunicodeglyph % beware, no zerocount !
- {\chardef\chineseSstatus0\getvalue{uc\the\unicodeposition}\relax}
+ {\chardef\chineseSstatus0\getvalue{uc\number\unicodeposition}\relax}
\def\analyzechineseunicodeenviroment
{% left
- \ifx (\nextglyph \chardef\chineseAstatus\plusone \else
- \ifx [\nextglyph \chardef\chineseAstatus\plusone \else
+ \ifx (\nextutoken \chardef\chineseAstatus\plusone \else
+ \ifx [\nextutoken \chardef\chineseAstatus\plusone \else
% right
- \ifx ,\nextglyph \chardef\chineseAstatus\plustwo \else
- \ifx .\nextglyph \chardef\chineseAstatus\plustwo \else
- \ifx ?\nextglyph \chardef\chineseAstatus\plustwo \else
- \ifx ;\nextglyph \chardef\chineseAstatus\plustwo \else
- \ifx :\nextglyph \chardef\chineseAstatus\plustwo \else
- \ifx !\nextglyph \chardef\chineseAstatus\plustwo \else
- \ifx )\nextglyph \chardef\chineseAstatus\plustwo \else
- \ifx ]\nextglyph \chardef\chineseAstatus\plustwo \else
+ \ifx ,\nextutoken \chardef\chineseAstatus\plustwo \else
+ \ifx .\nextutoken \chardef\chineseAstatus\plustwo \else
+ \ifx ?\nextutoken \chardef\chineseAstatus\plustwo \else
+ \ifx ;\nextutoken \chardef\chineseAstatus\plustwo \else
+ \ifx :\nextutoken \chardef\chineseAstatus\plustwo \else
+ \ifx !\nextutoken \chardef\chineseAstatus\plustwo \else
+ \ifx )\nextutoken \chardef\chineseAstatus\plustwo \else
+ \ifx ]\nextutoken \chardef\chineseAstatus\plustwo \else
% space
- \ifx\nextglyph\blankspace \chardef\chineseAstatus\plusthree \else
- \ifx\nextglyph\space \chardef\chineseAstatus\plusthree \else
- \chardef\chineseAstatus\zerocount
+ \ifx\nextutoken\blankspace \chardef\chineseAstatus\plusthree \else
+ \ifx\nextutoken\space \chardef\chineseAstatus\plusthree \else
+ \chardef\chineseAstatus\zerocount
% unknown
\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi \fi\fi
% maybe save the last skip?
@@ -264,14 +213,16 @@
\def\horizontalchineseunicodeglyph
{\relax
\ifhmode\else\dontleavehmode\fi % added
- \setunicodescale\chineseunicodescale
- \setunicodestrut\chineseunicodeheight\chineseunicodedepth
+ \setunicodescale\chineseunicodescale % redundant
+ \setunicodestrut\chineseunicodeheight\chineseunicodedepth % redundant
\ifprocessingverbatim
\iftracechinese
\ruledhbox{\insertunicodeglyph}%
\else
\insertunicodeglyph
\fi
+ \else\ifx\nextutoken\relax
+ \insertunicodeglyph
\else
\analyzechineseunicodeglyph
\analyzechineseunicodeenviroment
@@ -338,7 +289,7 @@
\insertchineseglyph
\hskip\chineseinterglyphskip
\hskip\chineseRsignal
- \fi
+ \fi\fi
\aftergroup\ignorespaces % watch this
\fi}
@@ -347,32 +298,40 @@
\ifprocessingverbatim % to do
\horizontalchineseunicodeglyph
\else
- \setunicodescale\chineseunicodescale
- \setunicodestrut\chineseunicodeheight\chineseunicodedepth
- \analyzechineseunicodeglyph
- \setbox\scratchbox\hbox to \hsize
- {\hss
- \ifcase\chineseSstatus\relax
- \insertchineseglyph
- \else % left / right
- \setbox\scratchbox\hbox{\insertchineseglyph}%
- \rotate[\c!rotation=270]{\box\scratchbox}%
- \fi
- \hss}%
- \ht\scratchbox\unicodeheight\strutht
- \dp\scratchbox\unicodedepth \strutdp
- \ifvmode % catches \hbox{...}, actually \hbox should be \vbox -)
- \nointerlineskip
- \fi
- \ifcase\prevchineseSstatus\relax
- \ifnum\chineseSstatus=\plustwo \par\nobreak\else\allowbreak\fi
- \or % left
- \par\nobreak
- \or % right
- \ifnum\chineseSstatus=\plustwo \par\nobreak\else\allowbreak\fi
+ \setunicodescale\chineseunicodescale % redundant
+ \setunicodestrut\chineseunicodeheight\chineseunicodedepth % redundant
+ \ifx\nextutoken\relax
+ \insertchineseglyph
+ \ifvmode % catches \hbox{...}, actually \hbox should be \vbox -)
+ \nointerlineskip
+ \fi
+ \allowbreak
+ \else
+ \analyzechineseunicodeglyph
+ \setbox\scratchbox\hbox to \hsize
+ {\hss
+ \ifcase\chineseSstatus\relax
+ \insertchineseglyph
+ \else % left / right
+ \setbox\scratchbox\hbox{\insertchineseglyph}%
+ \rotate[\c!rotation=270]{\box\scratchbox}%
+ \fi
+ \hss}%
+ \ht\scratchbox\unicodeheight\strutht
+ \dp\scratchbox\unicodedepth \strutdp
+ \ifvmode % catches \hbox{...}, actually \hbox should be \vbox -)
+ \nointerlineskip
+ \fi
+ \ifcase\prevchineseSstatus\relax
+ \ifnum\chineseSstatus=\plustwo \par\nobreak\else\allowbreak\fi
+ \or % left
+ \par\nobreak
+ \or % right
+ \ifnum\chineseSstatus=\plustwo \par\nobreak\else\allowbreak\fi
+ \fi
+ \global\chardef\prevchineseSstatus\chineseSstatus % pagebody ...
+ \box\scratchbox\par
\fi
- \global\chardef\prevchineseSstatus\chineseSstatus % pagebody ...
- \box\scratchbox\par
\aftergroup\ignorespaces % watch this
\fi}
@@ -536,7 +495,7 @@
\stopdummy}
\def\tracedchineseglyph
- {\leavevmode
+ {\dontleavehmode
\ruledhbox
{\setbox\scratchbox\hbox{\insertunicodeglyph}%
\hbox to \wd\scratchbox
@@ -893,12 +852,14 @@
\setupunicodefont
[chinese]
- [ \c!scale=\chineseunicodescale,
- \c!height=\chineseunicodeheight,
- \c!depth=\chineseunicodedepth,
- \c!conversion=\chinesenumber,
- \c!commands=\setchineseencoding, % needed for digits
- \c!command=\handlechineseunicodeglyph]
+ [ \c!scale=\chineseunicodescale,
+ \c!height=\chineseunicodeheight,
+ \c!depth=\chineseunicodedepth,
+ \c!strut=\v!yes,
+ \c!interlinespace=\v!yes,
+ \c!conversion=\chinesenumber,
+ \c!commands=\setchineseencoding, % needed for digits
+ \c!command=\handlechineseunicodeglyph]
%D For the moment, this encoding is implemented rather ugly. The
%D trick is to move the encoding value from the current font
@@ -918,12 +879,12 @@
%D \defineunicodefont
%D [SimChi]
%D [SimplifiedChinese]
-%D [ \c!scale=\chineseunicodescale,
-%D \c!height=\chineseunicodeheight,
-%D \c!depth=\chineseunicodedepth,
+%D [\c!scale=\chineseunicodescale,
+%D \c!height=\chineseunicodeheight,
+%D \c!depth=\chineseunicodedepth,
%D \c!conversion=\chinesenumber,
%D \c!commands=\setchineseencoding, % needed for digits
-%D \c!command=\handlechineseunicodeglyph]
+%D \c!command=\handlechineseunicodeglyph]
%D \stoptyping
%D
%D However, the former definitions is more general. Next we
@@ -943,6 +904,42 @@
\definefontsynonym [TraditionalChineseBoldSlanted] [b5heisl] [encoding=big5]
\definefontsynonym [TraditionalChineseBoldItalic] [b5heisl] [encoding=big5]
+% we need to move this to typescripts
+
+\doifelse \currentregime {utf} {
+
+ \definefontsynonym [SimplifiedChineseRegular] [ChineseRegular]
+ \definefontsynonym [SimplifiedChineseSlanted] [ChineseSlanted]
+ \definefontsynonym [SimplifiedChineseItalic] [ChineseItalic]
+ \definefontsynonym [SimplifiedChineseBold] [ChineseBold]
+ \definefontsynonym [SimplifiedChineseBoldSlanted] [ChineseBoldSlanted]
+ \definefontsynonym [SimplifiedChineseBoldItalic] [ChineseBoldItalic]
+
+ \definefontsynonym [TraditionalChineseRegular] [ChineseRegular]
+ \definefontsynonym [TraditionalChineseSlanted] [ChineseSlanted]
+ \definefontsynonym [TraditionalChineseItalic] [ChineseItalic]
+ \definefontsynonym [TraditionalChineseBold] [ChineseBold]
+ \definefontsynonym [TraditionalChineseBoldSlanted][ChineseBoldSlanted]
+ \definefontsynonym [TraditionalChineseBoldItalic] [ChineseBoldItalic]
+
+ \definefontsynonym [ChineseRegular] [uni-htsong-][encoding=cjk-uni]
+ \definefontsynonym [ChineseSlanted] [uni-htsong-][encoding=cjk-uni]
+ \definefontsynonym [ChineseItalic] [uni-htsong-][encoding=cjk-uni]
+ \definefontsynonym [ChineseBold] [uni-hthei-] [encoding=cjk-uni]
+ \definefontsynonym [ChineseBoldSlanted][uni-hthei-] [encoding=cjk-uni]
+ \definefontsynonym [ChineseBoldItalic] [uni-hthei-] [encoding=cjk-uni]
+
+ \loadmapfile[uni-htsong.map]
+ \loadmapfile[uni-htfs.map]
+ \loadmapfile[uni-hthei.map]
+ \loadmapfile[uni-htkai.map]
+
+} {
+
+ \loadmapfile[gbk]
+
+}
+
\defineunicodefont [SimChi] [SimplifiedChinese] [chinese]
\defineunicodefont [TraChi] [TraditionalChinese] [chinese]
@@ -1143,7 +1140,7 @@
%D \stopnarrower
%D This package is written in the city of Hasselt, a pretty
-%D small town in the |<|compare to China real small|>|
+%D small town in the |<|compared to China real small|>|
%D Netherlands. Like most dutch cities, even this small one
%D has a chinese restaurant, run by chinese, speaking chinese,
%D and |<|indeed|>| writing chinese. Eating there will never
diff --git a/Master/texmf-dist/tex/context/base/font-ini.tex b/Master/texmf-dist/tex/context/base/font-ini.tex
index b2007ee3122..8e620309e67 100644
--- a/Master/texmf-dist/tex/context/base/font-ini.tex
+++ b/Master/texmf-dist/tex/context/base/font-ini.tex
@@ -226,6 +226,21 @@
14: bodyfont -- is defined (can better be done global)
\stopmessages
+\startmessages french library: fonts
+ title: corps de texte
+ 1: encodage --
+ 2: la variante -- est chargée
+ 3: variante -- inconnue
+ 4: policecorps -- n'est pas définie
+ 5: le style -- n'est pas défini
+ 6: -- est chargé
+ 7: format -- inconnu
+ 8: style -- défini
+% 9: mapping -- is loaded
+ 10: fichier de police -- inconnu
+ 14: policecorps -- est défini (une définition globale pourrait être plus adéquat)
+\stopmessages
+
%D This module is one of the oldest modules of \CONTEXT. The
%D macros below evolved out of the \PLAIN\ \TEX\ macros and
%D therefore use a similar naming scheme (\type{\rm},
@@ -848,7 +863,7 @@
%D defining it here, we have at least an safeguard for utility
%D file reading.
-\unexpanded\def\uchar#1#2{[#1,#2]}
+\ifx\uchar\undefined \unexpanded\def\uchar#1#2{[#1,#2]} \fi
%D We define some (very private) constants to improve speed,
%D memory usage and consistency.
@@ -1033,21 +1048,21 @@
\def\dodosetmathfamily#1#2%
{\@EA\ifx \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname\relax
- \@EA\ifx \csname\fontclass\fontbody\c!mm\fontfamily\endcsname \relax
- \@EA\ifx \csname\fontclass\fontbody\backfamily\fontsize\endcsname \relax
- \@EA\ifx \csname\fontclass\fontbody\backfamily\endcsname \relax
+ \@EA\ifx \csname\fontclass\fontbody\c!mm\fontfamily \endcsname\relax
+ \@EA\ifx \csname\fontclass\fontbody \backfamily\fontsize\endcsname\relax
+ \@EA\ifx \csname\fontclass\fontbody \backfamily \endcsname\relax
\@EA\ifx \csname \fontbody\c!mm\fontfamily\fontsize\endcsname\relax
- \@EA\ifx \csname \fontbody\c!mm\fontfamily\endcsname \relax
- \@EA\ifx \csname \fontbody\backfamily\fontsize\endcsname \relax
- \@EA\ifx \csname \fontbody\backfamily\endcsname \relax
- \autofontsizetrue \nullfont \else
- \autofontsizetrue \csname \fontbody\backfamily\endcsname \fi \else
- \autofontsizefalse \csname \fontbody\backfamily\fontsize\endcsname \fi \else
- \autofontsizetrue \csname \fontbody\c!mm\fontfamily\endcsname \fi \else
+ \@EA\ifx \csname \fontbody\c!mm\fontfamily \endcsname\relax
+ \@EA\ifx \csname \fontbody \backfamily\fontsize\endcsname\relax
+ \@EA\ifx \csname \fontbody \backfamily \endcsname\relax
+ \autofontsizetrue \nullfont \else
+ \autofontsizetrue \csname \fontbody \backfamily \endcsname\fi \else
+ \autofontsizefalse \csname \fontbody \backfamily\fontsize\endcsname\fi \else
+ \autofontsizetrue \csname \fontbody\c!mm\fontfamily \endcsname\fi \else
\autofontsizefalse \csname \fontbody\c!mm\fontfamily\fontsize\endcsname\fi \else
- \autofontsizetrue \csname\fontclass\fontbody\backfamily\endcsname \fi \else
- \autofontsizefalse \csname\fontclass\fontbody\backfamily\fontsize\endcsname \fi \else
- \autofontsizetrue \csname\fontclass\fontbody\c!mm\fontfamily\endcsname \fi \else
+ \autofontsizetrue \csname\fontclass\fontbody \backfamily \endcsname\fi \else
+ \autofontsizefalse \csname\fontclass\fontbody \backfamily\fontsize\endcsname\fi \else
+ \autofontsizetrue \csname\fontclass\fontbody\c!mm\fontfamily \endcsname\fi \else
\autofontsizefalse \csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname\fi
#1#2\font}
@@ -1088,12 +1103,12 @@
\def\dodosetmathfamilyA#1#2%
{\ifcsname \fontbody\c!mm\fontfamily\fontsize\endcsname \autofontsizefalse
\csname \fontbody\c!mm\fontfamily\fontsize\endcsname \else
- \ifcsname \fontbody\c!mm\fontfamily\endcsname \autofontsizetrue
- \csname \fontbody\c!mm\fontfamily\endcsname \else
- \ifcsname \fontbody\backfamily\fontsize\endcsname \autofontsizefalse
- \csname \fontbody\backfamily\fontsize\endcsname \else
- \ifcsname \fontbody\backfamily\endcsname \autofontsizetrue
- \csname \fontbody\backfamily\endcsname \else
+ \ifcsname \fontbody\c!mm\fontfamily \endcsname \autofontsizetrue
+ \csname \fontbody\c!mm\fontfamily \endcsname \else
+ \ifcsname \fontbody \backfamily\fontsize\endcsname \autofontsizefalse
+ \csname \fontbody \backfamily\fontsize\endcsname \else
+ \ifcsname \fontbody \backfamily \endcsname \autofontsizetrue
+ \csname \fontbody \backfamily \endcsname \else
\nullfont \autofontsizetrue
\fi\fi\fi\fi
#1#2\font}
@@ -1101,12 +1116,12 @@
\def\dodosetmathfamilyB#1#2%
{\ifcsname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname \autofontsizefalse
\csname\fontclass\fontbody\c!mm\fontfamily\fontsize\endcsname \else
- \ifcsname\fontclass\fontbody\c!mm\fontfamily\endcsname \autofontsizetrue
- \csname\fontclass\fontbody\c!mm\fontfamily\endcsname \else
- \ifcsname\fontclass\fontbody\backfamily\fontsize\endcsname \autofontsizefalse
- \csname\fontclass\fontbody\backfamily\fontsize\endcsname \else
- \ifcsname\fontclass\fontbody\backfamily\endcsname \autofontsizetrue
- \csname\fontclass\fontbody\backfamily\endcsname \else
+ \ifcsname\fontclass\fontbody\c!mm\fontfamily \endcsname \autofontsizetrue
+ \csname\fontclass\fontbody\c!mm\fontfamily \endcsname \else
+ \ifcsname\fontclass\fontbody \backfamily\fontsize\endcsname \autofontsizefalse
+ \csname\fontclass\fontbody \backfamily\fontsize\endcsname \else
+ \ifcsname\fontclass\fontbody \backfamily \endcsname \autofontsizetrue
+ \csname\fontclass\fontbody \backfamily \endcsname \else
\dodosetmathfamilyA#1#2%
\fi\fi\fi\fi
#1#2\font}
@@ -1260,6 +1275,16 @@
\endETEX
+%D We also save:
+
+\def\savemathtextstyle#1% #1=rm|ss|..
+ {\doifsomething{#1}{\setxvalue{\fontclass\c!mm\s!text}{#1}}}
+
+\def\currentmathtextstyle % we default to empty !
+ {\executeifdefined{\fontclass\c!mm\s!text}\empty}
+
+%D Scaling macros:
+
\newdimen\scaledfont
\let\somefontspec\empty
@@ -1295,6 +1320,81 @@
\def\setforcedfontspec#1 #2\relax]%
{\csname\@fs@#1\endcsname#2\relax}
+%D For \XETEX\ we need to support a bit more:
+%D
+%D \starttyping
+%D \definedfont[{cmr10} at 40pt] test
+%D \definedfont['cmss10' at 40pt] test
+%D \definedfont["cmtt10" at 40pt] test
+%D
+%D \definedfont[{cmr10} at 40pt] test
+%D \definedfont['cmss10' at 40pt] test
+%D \definedfont["cmtt10" at 40pt] test
+%D
+%D \definedfont["Gentium" at 40pt] test
+%D \stoptyping
+
+\beginXETEX \font
+
+ % actually, we can use "" in pdftex> 1.20 as well
+
+ \def\parsefontspec#1%
+ {\xdef\somefontspec{#1\space}%
+ \@EA\doparsefontspec\somefontspec\relax]% =>#1 \empty]
+ \donoparsefontspec}
+
+ \def\doparsefontspec#1%
+ {\ifx"#1%
+ \@EA\dodqparsefontspec
+ \else\ifx'#1%
+ \@EAEAEA\dosqparsefontspec
+ \else
+ \@EAEAEA\dodoparsefontspec
+ \fi\fi#1}
+
+ \def\dqfontquote{"}
+ \def\sqfontquote{'}
+
+ \def\dodqparsefontspec"#1"#2%
+ {\def\somefontname{#1}%
+ \let\somefontquote\dqfontquote
+ \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2}
+
+ \def\dosqparsefontspec'#1'#2%
+ {\def\somefontname{#1}%
+ \let\somefontquote\sqfontquote
+ \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2}
+
+ \def\dodoparsefontspec#1 #2%
+ {\def\somefontname{#1}%
+ \let\somefontquote\empty
+ \ifx\somefontname\empty % space before fontname
+ \@EA\doparsefontspec
+ \else\ifx#2\relax
+ \@EAEAEA\setnaturalfontspec
+ \else
+ \@EAEAEA\setforcedfontspec
+ \fi\fi
+ #2}
+
+ \def\setnaturalfontspec#1]%
+ {\@fs@scaled\plusthousand\relax}
+
+ \def\setforcedfontspec#1 #2\relax]%
+ {\csname\@fs@#1\endcsname#2\relax}
+
+ \def\donoparsefontspec % #1 == \cs
+ {\edef\fontfile{\somefontquote\truefontname\somefontname\somefontquote}%
+ \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi
+ \edef\lastfontname{\fontfile\somefontspec}%
+ \ifx\fontclass\empty
+ \expandafter\definefontlocal
+ \else
+ \expandafter\definefontglobal
+ \fi} % #1 == \cs
+
+\endXETEX
+
\def\@fs@scaled
{\afterassignment\do@fs@scaled\scratchcounter}
@@ -1510,6 +1610,9 @@
%
% \testfeatureonce{5000}{\definefontsynonym[somefont][somename]} \end
+
+\def\classfont#1#2{#1#2} % \definefont[whatever][\classfont{xx}{yy} at 10pt]
+
\def\definefontsynonym[#1]#2[#3]%
{\edef\@@fontfile{#3}%
\@EA\let\csname\??ff\fontclass#1\endcsname\@@fontfile
@@ -1798,6 +1901,14 @@
\def\rawfontidentifier{**\lastfontidentifier\fontsize**}
\def\newfontidentifier{*\fontclass\lastfontidentifier\fontsize*}
+% best we can add the style as well because otherwise we get math encoding mixups
+%
+% \setupbodyfont [8pt] [\currentencoding/\ccaron\scaron\zcaron]
+% \blank
+% \switchtobodyfont[7pt] [\currentencoding/\ccaron\scaron\zcaron]
+
+\def\newfontidentifier{*\fontclass\lastfontidentifier\fontstyle\fontsize*}
+
\def\dododefinefont#1#2%
{\edef\lastfontidentifier{#1}%
\let\localrelativefontsize\defaultrelativefontsize
@@ -2712,30 +2823,13 @@
{\ifloadfontfileonce
\letvalue{\c!file\f!fontprefix#2}\empty
\fi
+ \makeshortfilename[\truefilename{\f!fontprefix#2}]%
\startreadingfile
- \readsysfile{\truefilename{\f!fontprefix#2}}
- {\showmessage\m!fonts2{#2}}
- {\makeshortfilename[\truefilename{\f!fontprefix#2}]%
- \readsysfile\shortfilename
- {\showmessage\m!fonts2{#2}}
- {\showmessage\m!fonts3{#2}}}%
+ \readsysfile\shortfilename
+ {\showmessage\m!fonts2{#2}}
+ {\showmessage\m!fonts3{#2}}%
\stopreadingfile}}
-% \def\doreadfontdefinitionfile#1#2% #1 = set/switch state
-% {\doifundefined{\c!file\f!fontprefix#2}%
-% {\ifloadfontfileonce
-% \letvalue{\c!file\f!fontprefix#2}\empty
-% \fi
-% \startreadingfile
-% \readsysfile{\truefilename{\f!fontprefix#2}}
-% {\showmessage\m!fonts2}
-% {\makeshortfilename[\truefilename{\f!fontprefix#2}]%
-% \readsysfile\shortfilename
-% {\showmessage\m!fonts2}
-% {\showmessage\m!fonts3}}%
-% {#2}% argument to \showmessage
-% \stopreadingfile}}
-
%D When \type {\loadfontfileoncetrue}, such files are
%D only loaded once! This permits redundant loading, but at
%D the same time forced grouping when we want continuously mix
@@ -2842,8 +2936,8 @@
\fi}%
\chardef\currentxfontsize\zerocount}
-\def\dodosetfont#1#2% #1 = set/switch state
- {\dododosetfont{#1}{#2}{\showmessage\m!fonts4{#2}}}
+\def\dodosetfont#1#2% #1 = set/switch state | check fo rempty, else space
+ {\doifsomething{#2}{\dododosetfont{#1}{#2}{\showmessage\m!fonts4{#2}}}}
\def\dododosetfont#1#2#3% #1 = set/switch state
{\doifnumberelse{#2}
@@ -2852,7 +2946,8 @@
{\edef\fontstep{\bodyfontcsname\normalizedbodyfontsize\interfaced{#2}\endcsname}%
\expanded{\dodododosetfont{#1}{\fontstep}}{#3}}
{\doifelse{#2}\v!reset
- {\let\fontsize\empty}
+ {\let\fontstyle\empty % new 31/7/2006
+ \let\fontsize \empty}
{\doifdefinedelse{\@style@#2}
{\edef\fontstyle{#2}}
{\doreadfontdefinitionfile{#1}{#2}}}}}}
@@ -2980,12 +3075,23 @@
\edef\fontbody{#1}%
\synchronizefont}
+% \def\setcurrentfontstyle#1%
+% {%\message{[3 #1]}%
+% \edef\fontstyle{#1}%
+% \ifmmode\mr\fi % otherwise \rm not downward compatible
+% \synchronizefont}
+%
+% For Taco: optional fall backs:
+
\def\setcurrentfontstyle#1%
{%\message{[3 #1]}%
+ \checkfontclass{#1}%
\edef\fontstyle{#1}%
\ifmmode\mr\fi % otherwise \rm not downward compatible
\synchronizefont}
+\let\checkfontclass\gobbleoneargument % implemented in type-ini
+
\def\setcurrentfontbodyalternative#1#2%
{%\message{[4 #1 #2]}%
\edef\fontbody{#1}%
@@ -3441,6 +3547,18 @@
\def\dosetmathfont
{\def\rm{\fam\mrfam}\dodosetmathfont}
+\def\enableencodinginmath
+ {\appendtoks
+ \everyhbox{\mr\everyhbox\emptytoks}%
+ \everyvbox{\mr\everyvbox\emptytoks}%
+ \to \everymathematics} % was \everymath
+
+% \enableencodinginmath % too untested to enable by default
+
+%D \startyping
+%D $\cases{& \ccaron}$ $x=\hbox{\ccaron $x=\hbox{\ccaron}$}$
+%D \stoptyping
+
%D The font specific features are bound to the filename.
\def\updatefontparameters
@@ -3588,8 +3706,7 @@
%D because \PLAIN\ \TEX\ is english anyway.
\def\dodefinebodyfontswitch[#1][#2]%
- {\def\docommando##1%
- {\setvalue{##1}{\switchtobodyfont[#2]}}%
+ {\def\docommando##1{\setvalue{##1}{\switchtobodyfont[#2]}}%
\processcommalist[#1]\docommando}
\def\definebodyfontswitch
@@ -3741,6 +3858,13 @@
\def\definestyle{\definealternativestyle}
+%D Maybe too geneneric, but probably ok is the following. (Maybe one
+%D day we will use a dedicated grouped command for styles.)
+
+\appendtoks
+ \let\groupedcommand\thirdofthreearguments
+\to \simplifiedcommands
+
%D This command also defines the keyword as command. This means
%D that the example definition of \type{bold} we gave before,
%D results in a command \type{\bold} which can be used as:
@@ -4208,15 +4332,30 @@
\let\thedefinedfont\relax
-\def\symbolicscaledfont#1#2%
- {\scaledfont\fontbody
- \scaledfont#1\scaledfont
- \font\thedefinedfont\truefontname{\glyphfontfile{#2}} at
+% \def\symbolicscaledfont#1#2%
+% {\scaledfont\fontbody
+% \scaledfont#1\scaledfont
+% \font\thedefinedfont\truefontname{\glyphfontfile{#2}} at
+% \currentfontbodyscale\scaledfont
+% \thedefinedfont}
+%
+% \unexpanded\def\symbolicfont
+% {\symbolicscaledfont\plusone}
+%
+% even more control (needed for mthsqrt etc)
+
+\def\symbolicsizedfont#1#2#3%
+ {\scaledfont#1%
+ \scaledfont#2\scaledfont
+ \font\thedefinedfont\truefontname{\glyphfontfile{#3}} at
\currentfontbodyscale\scaledfont
\thedefinedfont}
+\def\symbolicscaledfont
+ {\symbolicsizedfont\fontbody}
+
\unexpanded\def\symbolicfont
- {\symbolicscaledfont\plusone}
+ {\symbolicsizedfont\fontbody\plusone}
\unexpanded\def\getglyph#1#2% slow, faster, much faster
%{{\definefont[\s!dummy][\glyphfontfile{#1} sa \currentfontscale]\dummy#2}}
@@ -4570,6 +4709,7 @@
\definealternativestyle [\v!normal] [\tf] []
\definealternativestyle [\v!bold] [\bf] []
\definealternativestyle [\v!type] [\tt] []
+\definealternativestyle [\v!mono] [\tt] []
\definealternativestyle [\v!slanted] [\sl] []
\definealternativestyle [\v!italic] [\it] []
\definealternativestyle [\v!boldslanted,\v!slantedbold] [\bs] []
@@ -4698,15 +4838,16 @@
\scaledfont\currentfontscale\bodyfontsize
\scaledfont\relativefontsize\scaledfont}
-\def\variant[#1]% slow
+\unexpanded\def\variant[#1]% slow
{\dosetscaledfont
\expanded{\definedfont
[\truefontname{\fontstringA\fontstylesuffix\fontvariant\fontstringA{#1}}
- at \scaledfont]}}
+ at \scaledfont]}%
+ \ignoreimplicitspaces}
\beginXETEX \font
- \def\variant[#1]%
+ \unexpanded\def\variant[#1]%
{\dosetscaledfont
\font\variantfont\truefontname{\fontstringA\fontstylesuffix\fontvariant\fontstringA{#1}}
at \scaledfont
diff --git a/Master/texmf-dist/tex/context/base/font-jap.tex b/Master/texmf-dist/tex/context/base/font-jap.tex
new file mode 100644
index 00000000000..6bb813cccd1
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/font-jap.tex
@@ -0,0 +1,83 @@
+%D \module
+%D [ file=font-jap,
+%D version=2006.01.13,
+%D title=\CONTEXT\ Font Macros,
+%D subtitle=Japanese,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D suggestions=Wang Lei,
+%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.
+
+\ifx\handlejapaneseunicodeglyph\undefined \else \endinput \fi
+\ifx\handlechineseunicodeglyph \undefined \input font-chi.tex \fi
+
+\writestatus{loading}{Context Font Macros / Japanese}
+
+\unprotect
+
+\newif\iftracejapanese
+
+\let\japaneseencoding\empty
+
+\def\setjapaneseencoding
+ {\getfontfileparameters\unicodestyle
+ \ifx\currentfontfileencoding\undefined \else
+ \let\japaneseencoding\currentfontfileencoding
+ \fi}
+
+\def\japaneseunicodescale {\chineseunicodescale }
+\def\japaneseunicodeheight {\chineseunicodeheight }
+\def\japaneseunicodedepth {\chineseunicodedepth }
+\def\japaneseinterglyphskip{\chineseinterglyphskip}
+\def\japanesesurroundskip {\chinesesurroundskip }
+
+\setupunicodefont
+ [japanese]
+ [ \c!scale=\japaneseunicodescale,
+ \c!height=\japaneseunicodeheight,
+ \c!depth=\japaneseunicodedepth,
+ \c!strut=\v!yes,
+ \c!interlinespace=\v!yes,
+ \c!conversion=\japanesenumber,
+ \c!commands=\setjapaneseencoding, % needed for digits
+ \c!command=\handlejapaneseunicodeglyph]
+
+\def\japanesenumber{\numbers}
+
+\def\handlejapaneseunicodeglyph
+ {\begingroup
+% \let\chineseunicodescale \japaneseunicodescale
+% \let\chineseunicodeheight \japaneseunicodeheight
+% \let\chineseunicodedepth \japaneseunicodedepth
+% \let\chineseinterglyphskip\japaneseinterglyphskip
+% \let\chinesesurroundskip \japanesesurroundskip
+ \iftracejapanese\tracechinesetrue\else\tracechinesefalse\fi
+ \handlechineseunicodeglyph
+ \endgroup}
+
+\doifelse \currentregime {utf} {
+
+ % todo: typescripts
+
+ \definefontsynonym [JapaneseRegular] [uni-cybercjk-][encoding=cjk-uni]
+ \definefontsynonym [JapaneseSlanted] [uni-cybercjk-][encoding=cjk-uni]
+ \definefontsynonym [JapaneseItalic] [uni-cybercjk-][encoding=cjk-uni]
+ \definefontsynonym [JapaneseBold] [uni-cybercjk-][encoding=cjk-uni]
+ \definefontsynonym [JapaneseBoldSlanted][uni-cybercjk-][encoding=cjk-uni]
+ \definefontsynonym [JapaneseBoldItalic] [uni-cybercjk-][encoding=cjk-uni]
+
+ \loadmapfile[uni-cybercjk.map]
+
+ \defineunicodefont [Japanese] [Japanese] [japanese]
+
+} {
+ \writestatus{Japanese}{No fonts defined}
+}
+
+\Japanese
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/font-run.tex b/Master/texmf-dist/tex/context/base/font-run.tex
index 08537e374cf..d657aa40208 100644
--- a/Master/texmf-dist/tex/context/base/font-run.tex
+++ b/Master/texmf-dist/tex/context/base/font-run.tex
@@ -17,6 +17,9 @@
\unprotect
+\gdef\@@onlyenglish#1%
+ {\blank{\tttf \type {#1} is only available in the english interface}\blank}
+
\gdef\dosetshowfonttitle#1%
{\tabskip\zeropoint
\parindent\zeropoint
@@ -28,7 +31,7 @@
{\doifnot{[\fontclass]}\title
{\edef\title{[\fontclass]\space\title}}}}
-\gdef\showbodyfont%
+\gdef\showbodyfont
{\dosingleempty\doshowbodyfont}
\gdef\doshowbodyfont[#1]%
@@ -81,7 +84,7 @@
&&\getvalue{\bodyfontvariable{##1\c!xx}}%
&&\getvalue{\bodyfontvariable{##1\interfaced\v!small}}%
&&\getvalue{\bodyfontvariable{##1\interfaced\v!big}}%
- &&\getvalue{\bodyfontvariable{##1\c!interlinespace}}&\cr
+ &&\edef\next{\getvalue{\bodyfontvariable{##1\c!interlinespace}}}\ifx\next\empty not set\else\next\fi&\cr
\noalign{\hrule}}
\halign to \localhsize
{##&\vrule##\strut
@@ -105,7 +108,7 @@
\beginTEX \iffontchar
-\gdef\iffontchar#1#2{\iftrue}
+ \gdef\iffontchar#1#2{\iftrue}
\endTEX
@@ -178,15 +181,15 @@
\nointerlineskip
\vskip2pt
% the \noexpand before \blank is needed for non etex
- \edef\ascii {name: {\noexpand\black\fontname\font}}
+ \edef\ascii{name: {\noexpand\black\fontname\font}}
\doifelse\v!unknown{#2}
{\edef\theshowfontspecs
- {name: {\noexpand\black\fontname\font}}}
+ {name: {\noexpand\black\fontname\font}}}
{\edef\theshowfontspecs
- {name: {\noexpand\black\fontname\font }\noexpand\quad
+ {name: {\noexpand\black\fontname\font}\noexpand\quad
encoding: {\noexpand\black\currentencoding}\noexpand\quad
- mapping: {\noexpand\black\currentmapping }\noexpand\quad
- handling: {\noexpand\black\fonthandling }}}%
+ mapping: {\noexpand\black\currentmapping }\noexpand\quad
+ handling: {\noexpand\black\fonthandling}}}%
\tf % also sets em
\hbox to 40em{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs}
\egroup
@@ -227,7 +230,7 @@
\gdef\showligatures[#1]%
{\ifx\starttabulate\undefined
- \blank{\tttf \type {\showligatures} is only available in thr english interface}\blank
+ \@@onlyenglish\showligatures
\else
\bgroup
\setupcolors[\c!state=\v!local]%
@@ -247,7 +250,7 @@
\gdef\doshowfontstrip[#1]%
{\ifx\starttabulate\undefined
- \blank{\tttf \type {\showfontstrip} is only available in thr english interface}\blank
+ \@@onlyenglish\showfontstrip
\else
\bgroup
\def\dofontstripa##1##2%
@@ -303,7 +306,7 @@
\gdef\showminimalbaseline
{\ifx\starttabulate\undefined
- \blank{\tttf \type {\showminimalbaseline} is only available in thr english interface}\blank
+ \@@onlyenglish\showminimalbaseline
\else
\starttabulate[||T|T|T|T|T|T|T|T|T|]
\testminimalbaseline{\hbox to 1em{\hss\showstruts\strut\hss}}%
diff --git a/Master/texmf-dist/tex/context/base/font-uni.tex b/Master/texmf-dist/tex/context/base/font-uni.tex
index 09fcf22ea5f..3dee48ec48f 100644
--- a/Master/texmf-dist/tex/context/base/font-uni.tex
+++ b/Master/texmf-dist/tex/context/base/font-uni.tex
@@ -38,11 +38,15 @@
\stopmessages
\startmessages italian library: fonts
- 21: l'uso di (pdf)eTeX pi sicuro
+ 21: l'uso di (pdf)eTeX è più sicuro
\stopmessages
\startmessages norwegian library: fonts
- 21: bruke (pdf)eTeX er tryggere
+ 21: å bruke (pdf)eTeX er tryggere
+\stopmessages
+
+\startmessages french library: fonts
+ 21: l'utilisation de (pdf)eTeX est plus économe
\stopmessages
\unprotect
@@ -93,7 +97,7 @@
%D
%D \starttyping
%D \def\handleunicodeglyph
-%D {take actions based on \unicodeone-two-position cq. \nextglyph
+%D {take actions based on \unicodeone-two-position cq. \nextutoken
%D redefine \unicodecharcommand if needed
%D expand \insertunicodeglyph
%D take some final actions}
@@ -101,84 +105,41 @@
\newcount\unicodeposition
-% \def\handleunicodeflowglyph#1#2%
-% {\def\dohandleunicodeflowglyph{\dodohandleunicodeflowglyphA{#1}{#2}}%
-% \futurelet\nextglyph\dohandleunicodeflowglyph}
-%
-% %D The first alternative (A) takes a character as second
-% %D argument and is used in the primary handler introduced
-% %D earlier.
-%
-% \def\dodohandleunicodeflowglyphA#1#2%
-% {\bgroup
-% \def\unicodeone{#1}%
-% \edef\unicodetwo{\number\expandafter`\string#2}% takes also <128 !
-% \unicodeposition=\unicodeone\unicodetwo\relax
-% \handleunicodeglyph
-% \egroup}
-%
-% %D The second alternative (B) takes numbers and is used in
-% %D the \type {\uchar} command. This command takes two
-% %D decimal numbers.
-%
-% \def\dodohandleunicodeflowglyphB#1#2%
-% {\bgroup
-% \def\unicodeone{#1}%
-% \def\unicodetwo{#2}%
-% \unicodeposition=\unicodeone\unicodetwo\relax
-% \handleunicodeglyph
-% \egroup}
-%
-% \unexpanded\def\uchar%
-% {\let\nextglyph\relax
-% \dodohandleunicodeflowglyphB}
-
%D The multistep approach is needed to pick up the second
%D token, since this token can have any value and any
%D catcode.
-%\def\handleunicodeflowglyph#1%
-% {\bgroup
-% \edef\unicodeone{#1}%
-% \@EA\afterassignment\@EA\dohandleunicodeflowglyph
-% \@EA\chardef\@EA\nexttoken\@EA`\string}
-%
-%\def\dohandleunicodeflowglyph
-% {\futurelet\nextglyph\dodohandleunicodeflowglyph}
-%
-%\def\dodohandleunicodeflowglyph%
-% {\edef\unicodetwo{\the\nexttoken}%
-% \unicodeposition\unicodeone\unicodetwo\relax
-% \handleunicodeglyph
-% \egroup}
-
% the \relax trick prevents eating up the space (needed for
% korean
\def\handleunicodeflowglyph#1#2%
- {\bgroup
+ {\begingroup
\edef\unicodeone{#1}%
- \@EA\afterassignment\@EA\dohandleunicodeflowglyph
+ \@EA\afterassignment\@EA\dohandleunicodeflowglyph % two redundant ea's
\@EA\chardef\@EA\nexttoken\@EA`\string#2\relax}
\def\dohandleunicodeflowglyph\relax
- {\futurelet\nextglyph\dodohandleunicodeflowglyph}
+ {\futurelet\nextutoken\dodohandleunicodeflowglyph}
-\def\dodohandleunicodeflowglyph
+\def\dodohandleunicodeflowglyph % todo tex (or maybe no longer)
{\edef\unicodetwo{\the\nexttoken}%
- \unicodeposition\unicodeone\unicodetwo\relax
+ \unicodeposition\numexpr\unicodeone*256+\unicodetwo\relax
\handleunicodeglyph
- \egroup}
+ \endgroup}
\unexpanded\def\uchar#1#2% use as standalone glyph
- {\bgroup
- \let\nextglyph\relax
+ {\begingroup
\edef\unicodeone{#1}%
\edef\unicodetwo{#2}%
-% \unicodeposition=\unicodeone\unicodetwo\relax
- \unicodeposition\unicodeone\unicodetwo\relax
+ \unicodeposition\numexpr\unicodeone*256+\unicodetwo\relax
\handleunicodeglyph
- \egroup}
+ \endgroup}
+
+\let\nextutoken\relax
+
+\unexpanded\def\lookaheaduchar#1#2%
+ {\def\dolookaheaduchar{\uchar{#1}{#2}\let\nextutoken\relax}%
+ \futurelet\nextutoken\dolookaheaduchar}
%D In \XETEX, unicode support is straightforward, so we
%D simply output a \type {\char} with a 16||bit number.
@@ -194,63 +155,20 @@
\endXETEX
\def\dohandleucflowglyph
-% {\unicodeposition=\unicodeone\unicodetwo\relax
- {\unicodeposition\unicodeone\unicodetwo\relax
+ {\unicodeposition\numexpr\unicodeone*256+\unicodetwo\relax
\handleunicodeglyph
- \egroup}
+ \endgroup}
\unexpanded\def\uc#1#2% used in tricky situations
- {\bgroup
+ {\begingroup
\edef\unicodeone{#1}%
\edef\unicodetwo{#2}%
- \futurelet\nextglyph\dohandleucflowglyph}
-
-% Alternative, handles [char >127]{number} too.
-%
-% \def\handleunicodeflowglyph#1%
-% {\bgroup
-% \edef\unicodeone{#1}%
-% \futurelet\nexttoken\dohandleunicodeflowglyph}
-%
-% \def\dohandleunicodeflowglyph%
-% {\ifx\nexttoken\bgroup
-% \expandafter\dohandleunicodeflowglyphA
-% \else
-% \expandafter\dohandleunicodeflowglyphB
-% \fi}
-%
-% \def\dohandleunicodeflowglyphA#1%
-% {\chardef\nexttoken=#1\relax
-% \dodohandleunicodeflowglyph}
-%
-% \def\dohandleunicodeflowglyphB%
-% {\@EA\afterassignment\@EA\dodohandleunicodeflowglyph
-% \@EA\chardef\@EA\nexttoken\@EA=\@EA`\string}
-%
-% \def\dodohandleunicodeflowglyph%
-% {\futurelet\nextglyph\dododohandleunicodeflowglyph}
-%
-% \def\dododohandleunicodeflowglyph%
-% {\edef\unicodetwo{\the\nexttoken}%
-% \unicodeposition=\unicodeone\unicodetwo\relax
-% \handleunicodeglyph
-% \egroup}
-%
-% Can be used with (the less byte hungry alternative):
-%
-% sub unirecode
-% { my ($a,$b) = @_ ;
-% if ((ord($b)<0x80)&&($b !~ /[a-zA-Z0-9]/))
-% { print "$b" ; ++$recoded ;
-% #return "\\uc\{" . ord($a) . "\}\{". ord($b) . "\}" }
-% return "$a\{". ord($b) . "\}" }
-% else
-% { return "$a$b" } }
+ \futurelet\nextutoken\dohandleucflowglyph}
\def\insertunicodeglyph
{\unicodeglyph\unicodeone\unicodetwo}
-\let\handleunicodeglyph=\insertunicodeglyph
+\let\handleunicodeglyph\insertunicodeglyph
%D One can use the \type {\unicodeposition} in the macros
%D that handle pre and post material.
@@ -303,22 +221,43 @@
\let\unicodecharcommand\firstofoneargument
-% \unexpanded\def\unicodeglyph#1#2% watch the double mapping
-% {\bgroup
-% \bodyfontsize=\unicodescale\bodyfontsize
-% \font\unicodefont=\truefontname{\truefontname\unicodestyle\lchexnumbers{#1}}
-% at \currentfontscale\bodyfontsize
-% \unicodestrut\unicodefont\unicodecharcommand{\char#2\relax}%
-% \egroup}
-
\unexpanded\def\unicodeglyph#1#2% watch the double mapping
- {\bgroup
- \getvalue{@@\currentucharmapping\strippedcsname\uchar}{#1}{#2}%
+ {\begingroup
+ \getvalue{@@\currentucharmapping\strippedcsname\uchar}{#1}{#2}% map to a to hex font range
\bodyfontsize\unicodescale\bodyfontsize
- \font\unicodefont=\truefontname{\truefontname\unicodestyle\unicodeone}
- at \currentfontscale\bodyfontsize
- \unicodestrut\unicodefont\unicodecharcommand{\char\unicodetwo\relax}%
- \egroup}
+ % readable:
+ % \doifelsefontsynonym{\unicodestyle\unicodeone}
+ % {\font\unicodefont=\truefontname{\unicodestyle\unicodeone}
+ % at \currentfontscale\bodyfontsize}
+ % {\font\unicodefont=\truefontname{\truefontname\unicodestyle\unicodeone}
+ % at \currentfontscale\bodyfontsize}%
+ % unreadable but more efficient:
+ \font\unicodefont=\truefontname{\doifelsefontsynonym{\unicodestyle
+ \unicodeone}\empty\truefontname\unicodestyle\unicodeone}
+ at \currentfontscale\bodyfontsize
+ \unicodestrut % off by default
+ \unicodefont\unicodecharcommand{\char\unicodetwo\relax}%
+ \endgroup}
+
+%D This handler is used by default, for instance in:
+%D
+%D \starttyping
+%D \defineunicodefont [MySwitch] [MyFont] % [strut=no,command=\insertunicodeglyph]
+%D
+%D \definefontsynonym [MyFontRegular40] [Sans]
+%D \definefontsynonym [MyFontBold40] [SansBold]
+%D
+%D {\MySwitch \uchar{"40}{`a}}
+%D {\MySwitch \bf \uchar{"40}{`a}}
+%D \stoptyping
+%D
+%D \starttyping
+%D \definefontsynonym [MyFontRegular] [Sans]
+%D \definefontsynonym [MyFontBold] [SansBold]
+%D \stoptyping
+%D
+%D Is also possible, but in that case the number is appended to the raw font
+%D name!
%D \macros
%D {currentucharmapping,defineucharmapping}
@@ -353,15 +292,13 @@
\def\dorepositionunicode
{\dosetdivision\unicodeposition{256}\scratchcounter
- %\DoDiv\unicodeposition by256to\scratchcounter
\advance\scratchcounter \plusone
\edef\unicodeone{\ifnum\scratchcounter<10 0\fi\the\scratchcounter}%
\dosetmodulo\unicodeposition{256}\scratchcounter
- %\DoMod\unicodeposition by256to\scratchcounter
\edef\unicodetwo{\the\scratchcounter}}
%D \macros
-%D {setunicodestrut, setunicodescale, nextglyph,
+%D {setunicodestrut, setunicodescale, nextutoken,
%D handleunicodeglyph, insertunicodeglyph}
%D
%D A careful analysis of the previous macros, learns that the
@@ -401,15 +338,22 @@
\let\unicodestrut\empty
\fi\fi}
+\def\resetunicodestrut
+ {\let\unicodestrut\empty}
+
%D The additional scaling and strut default to:
\setunicodescale{1}
\setunicodestrut{1}{1}
+%D But better is not to have a strut added by default:
+
+\resetunicodestrut
+
%D The actual code for the additional actions as well as
%D specific spacing is handled outside these routines. The
%D character after the two that are under treatment is
-%D available in \type {\nextglyph}.
+%D available in \type {\nextutoken}.
%D \macros
%D {defineunicodefont, setupunicodefont}
@@ -421,12 +365,12 @@
%D \starttyping
%D \defineunicodefont
%D [SimChi] [SimplifiedChinese]
-%D [ \c!scale=0.85,
-%D \c!height=1.25,
-%D \c!depth=1.00,
-%D \c!interlinespaceinterlinie=yes,
+%D [\c!scale=0.85,
+%D \c!height=1.25,
+%D \c!depth=1.00,
+%D \c!interlinespaceinterlinie=yes,
%D \c!conversion=\chinesenumber,
-%D \c!command=\handlechineseunicodeglyph]
+%D \c!command=\handlechineseunicodeglyph]
%D \stoptyping
%D
%D Together with:
@@ -471,7 +415,7 @@
{\setupunicodefont[#1][#3]}
{\copyparameters
[\??uc#1][\??uc#3]
- [\c!height,\c!depth,\c!scale,\c!commands,
+ [\c!height,\c!depth,\c!scale,\c!commands,\c!strut,
\c!interlinespace,\c!command,\c!conversion]}}%
\doifelsenothing{#2}
{\setvalue{#1}{[uc font #1 undefined]}}
@@ -491,7 +435,7 @@
{\doifundefined{\??uc#1\c!command}
{\copyparameters
[\??uc#1][\??uc\s!default]
- [\c!height,\c!depth,\c!scale,\c!commands,
+ [\c!height,\c!depth,\c!scale,\c!commands,\v!strut,
\c!interlinespace,\c!command,\c!conversion]}%
\getparameters[\??uc#1][#2]}
@@ -502,8 +446,13 @@
\def\unicodedepth {\getvalue{\??uc#1\c!depth}}%
\def\unicodedigits {\getvalue{\??uc#1\c!conversion}}%
\def\handleunicodeglyph {\getvalue{\??uc#1\c!command}}%
- \enableregime[unicode]% the following \relax's are realy needed
- \doifvalue{\??uc#1\c!interlinespace}\v!yes\setupinterlinespace\relax
+ \doifnot\currentregime{utf}{\enableregime[unicode]}%
+ % the following \relax's are realy needed
+ \doifvalue{\??uc#1\c!interlinespace}\v!yes
+ \setupinterlinespace\relax
+ \doifvalue{\??uc#1\c!strut}\v!yes
+ {\setunicodestrut\unicodeheight\unicodedepth}
+ {\resetunicodestrut}%
\getvalue{\??uc#1\c!commands}\relax}
%D \macros
@@ -528,7 +477,8 @@
[\c!height=1,
\c!depth=1,
\c!scale=1,
- \c!interlinespace=\v!yes,
+ \c!strut=\v!no,
+ \c!interlinespace=\v!no,
\c!command=\insertunicodeglyph,
\c!conversion=\number]
diff --git a/Master/texmf-dist/tex/context/base/hand-def.tex b/Master/texmf-dist/tex/context/base/hand-def.tex
index 591370cda85..0a19ce270d1 100644
--- a/Master/texmf-dist/tex/context/base/hand-def.tex
+++ b/Master/texmf-dist/tex/context/base/hand-def.tex
@@ -476,7 +476,7 @@
% \stopfonthandling
% \definefonthandling [noligs] [noligs] [type=tag]
-% \setupfontsynonym[Serif][handling=noligs]
+ % \setupfontsynonym[Serif][handling=noligs]
% \definefont[test][Serif at 12.34pt]
%
% {``fi--ffl---ffi'' \test ``fi--ffl---ffi''}
diff --git a/Master/texmf-dist/tex/context/base/hand-ini.tex b/Master/texmf-dist/tex/context/base/hand-ini.tex
index 588d635a969..cef84d0e6bd 100644
--- a/Master/texmf-dist/tex/context/base/hand-ini.tex
+++ b/Master/texmf-dist/tex/context/base/hand-ini.tex
@@ -69,6 +69,13 @@
3: unknown font handling --
\stopmessages
+\startmessages french library: handlings
+ title: manipulation
+ 1: manipulation -- de police
+ 2: la manipulation -- de police est chargée
+ 3: manipulation -- inconnue de police
+\stopmessages
+
\newif\iftracefonthandling % \tracefonthandlingtrue
\newif\ifskiphandlingdef \skiphandlingdeffalse
@@ -201,15 +208,15 @@
\def\dosetfontadjusting#1%
{\iftracefonthandling\showfontadjusting{#1}\fi
\pdffontexpand\handledfont
- \csname\@fha@\@fha@#1\c!min \endcsname\space
\csname\@fha@\@fha@#1\c!max \endcsname\space
+ \csname\@fha@\@fha@#1\c!min \endcsname\space
\csname\@fha@\@fha@#1\c!step\endcsname\space
\@@pdfexpandbonus\relax}
\def\showfontadjusting#1%
{\writestatus\m!handlings{[adjust]\space#1\space
- \csname\@fha@\@fha@#1\c!min \endcsname/%
\csname\@fha@\@fha@#1\c!max \endcsname/%
+ \csname\@fha@\@fha@#1\c!min \endcsname/%
\csname\@fha@\@fha@#1\c!step\endcsname\space
\fontname\handledfont}}
\fi
@@ -394,6 +401,8 @@
\let\enablespacehandling \relax
\let\disablespacehandling \relax
+ \let\enablekernhandling \relax
+ \let\disablekernhandling \relax
\let\setspacehandling \gobbleoneargument
@@ -404,6 +413,8 @@
\def\enablespacehandling {\pdfadjustinterwordglue\plusone }
\def\disablespacehandling{\pdfadjustinterwordglue\minusone}
+ \def\enablekernhandling {\pdfprependkern \plusone }
+ \def\disablekernhandling {\pdfprependkern \minusone}
\appendtoks \disablespacehandling \to \everyforgetall % Here or not here?
@@ -574,15 +585,19 @@
\endETEX
\def\redofastenablehandling
- {\edef\fonthandling{\csname\@fha@\@fha@\@fha@\askedfonthandling\endcsname}%
- \rawprocesscommacommand[\fonthandling]\xfastenablehandling}
+ {\startdirectcharacters
+ \edef\fonthandling{\csname\@fha@\@fha@\@fha@\askedfonthandling\endcsname}%
+ \rawprocesscommacommand[\fonthandling]\xfastenablehandling
+ \stopdirectcharacters}
\def\dofastenablehandling
- {\the\everyenablefonthandling
+ {\startdirectcharacters
+ \the\everyenablefonthandling
\edef\fonthandling{\csname\@fha@\@fha@\askedfonthandling\endcsname}%
\checkfonthandling\filoffonthandling
\rawprocesscommacommand[\fonthandling]\dodoenablehandling
- \registerfonthandling\filoffonthandling}
+ \registerfonthandling\filoffonthandling
+ \stopdirectcharacters}
\def\nofastenablehandling
{\the\everyenablefonthandling
@@ -638,11 +653,11 @@
\def\dousehandling#1% is the same as encoding
{\doifundefined{\c!file\f!handlingprefix#1}%
{\letvalueempty{\c!file\f!handlingprefix#1}%
- \makeshortfilename[\f!handlingprefix#1]%
+ \makeshortfilename[\truefilename{\f!handlingprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename
- {\showmessage\m!handlings2{#1}}
- {\showmessage\m!handlings3{#1}}%
+ \readsysfile\shortfilename
+ {\showmessage\m!handlings2{#1}}
+ {\showmessage\m!handlings3{#1}}%
\stopreadingfile}}
\def\usehandling[#1]%
diff --git a/Master/texmf-dist/tex/context/base/java-ini.tex b/Master/texmf-dist/tex/context/base/java-ini.tex
index 7ee080238db..d2821162e2d 100644
--- a/Master/texmf-dist/tex/context/base/java-ini.tex
+++ b/Master/texmf-dist/tex/context/base/java-ini.tex
@@ -75,6 +75,13 @@
2: preambul necunoscut --
\stopmessages
+\startmessages french library: javascript
+ title: javascript
+ 1: chargement du jeu de script --
+ 2: préambule -- inconnu
+\stopmessages
+
+
%D \TEX\ is not the right tool to check the \JAVA\ code; the
%D most we can do is reporting some passed variables:
@@ -754,9 +761,8 @@
{\startnointerference
\letgvalueempty{\c!file\f!javascriptprefix#1}%
\makeshortfilename[\f!javascriptprefix#1]%
- \showmessage\m!javascript1{#1}%
\startreadingfile
- \readsysfile\shortfilename\donothing\donothing
+ \readsysfile\shortfilename{\showmessage\m!javascript1{#1}}\donothing
\stopreadingfile
\stopnointerference}}}
diff --git a/Master/texmf-dist/tex/context/base/lang-all.xml b/Master/texmf-dist/tex/context/base/lang-all.xml
index c0dfc67653e..486ef5d0885 100644
--- a/Master/texmf-dist/tex/context/base/lang-all.xml
+++ b/Master/texmf-dist/tex/context/base/lang-all.xml
@@ -11,7 +11,7 @@
<year>1991</year>
<owner>Julio Sanchez (jsanchez@gmv.es)</owner>
<comment>These patterns have been derived from "On Word Division in Spanish"
- Jos'e A. Ma~nas</comment>
+ Jos'e A. Ma~nas</comment>
</copyright>
<copyright>
<year>1997</year>
@@ -337,4 +337,16 @@
<comment>Vietnamese needs no patterns.</comment>
</description>
+<description language='agr'>
+ <sourcefile>grahyph4.tex</sourcefile>
+ <title>TeX hyphenation patterns for the ancient Greek language</title>
+ <copyright>
+ <year>2004</year>
+ <owner>Dimitrios Filippou</owner>
+ <comment>These hyphenation patterns are explained in "ancient.pdf".
+ Hyphenation examples are given in the file "anc-test.pdf".
+ Some doubtful patterns are marked by three question marks "???".</comment>
+ </copyright>
+</description>
+
</descriptions>
diff --git a/Master/texmf-dist/tex/context/base/lang-chi.tex b/Master/texmf-dist/tex/context/base/lang-chi.tex
index b6c3ba20af1..7458268f7e8 100644
--- a/Master/texmf-dist/tex/context/base/lang-chi.tex
+++ b/Master/texmf-dist/tex/context/base/lang-chi.tex
@@ -31,14 +31,15 @@
\c!rightquote=\cnencoding\cnupperrightsinglequote,
\c!leftquotation=\cnencoding\cnupperleftdoublequote,
\c!rightquotation=\cnencoding\cnupperrightdoublequote,
- \c!date={\v!month,\ ,\v!day,{,\ },\v!year},
+ \c!date={\v!year,\cnyear,\ ,\v!month,\v!day,\cnday},
\c!state=\v!stop]
+
\setupheadtext [\s!cn] [\v!content={\cnencoding\cnencodedcontents}]
\setupheadtext [\s!cn] [\v!tables={\cnencoding\cnencodedtables}]
\setupheadtext [\s!cn] [\v!figures={\cnencoding\cnencodedfigures}]
-\setupheadtext [\s!cn] [\v!graphics=Graphics]
-\setupheadtext [\s!cn] [\v!intermezzi=Intermezzos]
+\setupheadtext [\s!cn] [\v!graphics={\cnencoding\cnencodedgraphics}]% RG & XJF
+\setupheadtext [\s!cn] [\v!intermezzi={\cnencoding\cnencodedintermezzo}]% RG & XJF
\setupheadtext [\s!cn] [\v!index={\cnencoding\cnencodedindex}]
\setupheadtext [\s!cn] [\v!abbreviations={\cnencoding\cnencodedabbreviations}]
\setupheadtext [\s!cn] [\v!logos={\cnencoding\cnencodedlogos}]
@@ -46,14 +47,14 @@
\setuplabeltext [\s!cn] [\v!table={\cnencoding\cnencodedtable}]
\setuplabeltext [\s!cn] [\v!figure={\cnencoding\cnencodedfigure}]
-\setuplabeltext [\s!cn] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!cn] [\v!graphic=Illustration ]
-\setuplabeltext [\s!cn] [\v!appendix=]
+\setuplabeltext [\s!cn] [\v!intermezzo={\cnencoding\cnencodedintermezzo}]% RG & XJF
+\setuplabeltext [\s!cn] [\v!graphic={\cnencoding\cnencodedillustration}]% RG & XJF
+\setuplabeltext [\s!cn] [\v!appendix={\cnencoding\cnencodedappendix}]% RG
\setuplabeltext [\s!cn] [\v!part={\cnencoding\cnencodedintro,\cnencoding\cnencodedpart}]
\setuplabeltext [\s!cn] [\v!chapter={\cnencoding\cnencodedintro,\cnencoding\cnencodedchapter}]
\setuplabeltext [\s!cn] [\v!section={\cnencoding\cnencodedintro,\cnencoding\cnencodedsection}]
-\setuplabeltext [\s!cn] [\v!line=line ]
-\setuplabeltext [\s!cn] [\v!lines=lines ]
+\setuplabeltext [\s!cn] [\v!line={\cnencoding\cnencodedline}]% RG & XJF
+\setuplabeltext [\s!cn] [\v!lines={\cnencoding\cnencodedline}]% RG & XJF
\setuplabeltext [\s!cn] [\v!subsection=]
\setuplabeltext [\s!cn] [\v!subsubsection=]
@@ -93,7 +94,64 @@
%D the glyphs of both part depend on the encoding. Therefore,
%D we have an encoding section here.
-\def\cnencoding{\enableencoding[\chineseencoding]} % ugly and temporary
+\unexpanded\def\cnencoding{\enableencoding[\chineseencoding]} % ugly and temporary
+
+\startencoding[cjk-uni]
+ \definecommand cnleftsentence {\uchar{32}{20}\uchar{32}{20}}
+ \definecommand cnrightsentence {\uchar{32}{20}\uchar{32}{20}}
+ \definecommand cnleftsubsentence {\uchar{32}{20}\uchar{32}{20}}
+ \definecommand cnrightsubsentence {\uchar{32}{20}\uchar{32}{20}}
+ \definecommand cnupperleftsinglequote {\uchar{32}{24}}
+ \definecommand cnupperrightsinglequote {\uchar{32}{25}}
+ \definecommand cnupperleftdoublequote {\uchar{32}{28}}
+ \definecommand cnupperrightdoublequote {\uchar{32}{29}}
+ \definecommand cnupperleftsinglequote-v {\uchar{48}{12}}
+ \definecommand cnupperrightsinglequote-v {\uchar{48}{13}}
+ \definecommand cnupperleftdoublequote-v {\uchar{48}{14}}
+ \definecommand cnupperrightdoublequote-v {\uchar{48}{15}}
+ \definecommand cnencodedcontents {\uchar{118}{238}\uchar{95}{85}}
+ \definecommand cnencodedtables {\uchar{136}{104}\uchar{104}{60}}
+ \definecommand cnencodedfigures {\uchar{86}{254}\uchar{95}{98}}
+ \definecommand cnencodedindex {\uchar{125}{34}\uchar{95}{21}}
+ \definecommand cnencodedabbreviations {\uchar{127}{41}\uchar{117}{101}\uchar{139}{237}}
+ \definecommand cnencodedlogos {\uchar{95}{189}\uchar{141}{44}}
+ \definecommand cnencodedunits {\uchar{139}{161}\uchar{145}{207}\uchar{83}{85}\uchar{79}{77}}
+ \definecommand cnencodedtable {\uchar{136}{104}}
+ \definecommand cnencodedfigure {\uchar{86}{254}}
+ \definecommand cnencodedintro {\uchar{123}{44}}
+ \definecommand cnencodedpart {\uchar{144}{232}\uchar{82}{6}}
+ \definecommand cnencodedchapter {\uchar{122}{224}}
+ \definecommand cnencodedsection {\uchar{130}{130}}
+ \definecommand cnencodedjanuary {\uchar{78}{0}\uchar{103}{8}}
+ \definecommand cnencodedfebrary {\uchar{78}{140}\uchar{103}{8}}
+ \definecommand cnencodedmarch {\uchar{78}{9}\uchar{103}{8}}
+ \definecommand cnencodedapril {\uchar{86}{219}\uchar{103}{8}}
+ \definecommand cnencodedmay {\uchar{78}{148}\uchar{103}{8}}
+ \definecommand cnencodedjune {\uchar{81}{109}\uchar{103}{8}}
+ \definecommand cnencodedjuly {\uchar{78}{3}\uchar{103}{8}}
+ \definecommand cnencodedaugust {\uchar{81}{107}\uchar{103}{8}}
+ \definecommand cnencodedseptember {\uchar{78}{93}\uchar{103}{8}}
+ \definecommand cnencodedoctober {\uchar{83}{65}\uchar{103}{8}}
+ \definecommand cnencodednovember {\uchar{83}{65}\uchar{78}{0}\uchar{103}{8}}
+ \definecommand cnencodeddecember {\uchar{83}{65}\uchar{78}{140}\uchar{103}{8}}
+ \definecommand cnencodedsunday {\uchar{102}{31}\uchar{103}{31}\uchar{101}{229}}
+ \definecommand cnencodedmonday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{0}}
+ \definecommand cnencodedtuesday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{140}}
+ \definecommand cnencodedwednesday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{9}}
+ \definecommand cnencodedthursday {\uchar{102}{31}\uchar{103}{31}\uchar{86}{219}}
+ \definecommand cnencodedfriday {\uchar{102}{31}\uchar{103}{31}\uchar{78}{148}}
+ \definecommand cnencodedsaturday {\uchar{102}{31}\uchar{103}{31}\uchar{81}{109}}
+ % RG & XJF
+ \definecommand cnencodedgraphics {\uchar{86}{254}}
+ \definecommand cnencodedintermezzo {\uchar{210}{99}\uchar{242}{102}}
+ \definecommand cnencodedillustration {\uchar{99}{210}\uchar{86}{254}}
+ \definecommand cnencodedappendix {\uchar{150}{68}\uchar{95}{85}}
+ \definecommand cnencodedline {\uchar{136}{76}}
+ % Tobias Burnus & XJF
+ \definecommand cnyear {\uchar{94}{116}}
+ \definecommand cnmonth {\uchar{103}{8}}
+ \definecommand cnday {\uchar{101}{229}}
+\stopencoding
\startencoding[gbk]
\definecommand cnleftsentence {\uchar{161}{170}\uchar{161}{170}}
@@ -140,6 +198,16 @@
\definecommand cnencodedthursday {\uchar{208}{199}\uchar{198}{218}\uchar{203}{196}}
\definecommand cnencodedfriday {\uchar{208}{199}\uchar{198}{218}\uchar{206}{229}}
\definecommand cnencodedsaturday {\uchar{208}{199}\uchar{198}{218}\uchar{193}{249}}
+ % RG & XJF
+ \definecommand cnencodedgraphics {\uchar{205}{188}}
+ \definecommand cnencodedintermezzo {\uchar{178}{229}\uchar{199}{250}}
+ \definecommand cnencodedillustration {\uchar{178}{229}\uchar{205}{188}}
+ \definecommand cnencodedappendix {\uchar{184}{189}\uchar{194}{188}}
+ \definecommand cnencodedline {\uchar{208}{208}}
+ % Tobias Burnus & XJF
+ \definecommand cnyear {\uchar{196}{234}}
+ \definecommand cnmonth {\uchar{212}{194}}
+ \definecommand cnday {\uchar{200}{213}}
\stopencoding
\startencoding[big5]
@@ -187,6 +255,53 @@
\definecommand cnencodedthursday {\uchar{172} {80}\uchar{180}{193}\uchar{165}{124}}
\definecommand cnencodedfriday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{173}}
\definecommand cnencodedsaturday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{187}}
+ % Tobias Burnus &\XJF
+ \definecommand cnyear {\uchar{166}{126}}
+ \definecommand cnmonth {\uchar{164}{235}}
+ \definecommand cnday {\uchar{164}{233}}
+
+% Traditional Chinese characters (only where they differ to the
+% simplified ones) for lang-chi.tex and font-chi.tex.
+
+% \startencoding[cjk-uni]
+% \defineudigit 10000 132 44
+% \defineudigit 100000000 81 4
+
+% \definecommand cnencodedsection {\uchar{123}{192}}
+% \definecommand cnencodedfigure {\uchar{87}{22}}
+% \definecommand cnencodedunits {\uchar{138}{8}\uchar{145}{207}\uchar{85}{174}\uchar{79}{77}}
+% \definecommand cnencodedlogos {\uchar{95}{189}\uchar{140}{182}}
+% \definecommand cnencodedabbreviations {\uchar{126}{46}\uchar{117}{101}\uchar{138}{158}}
+% \definecommand cnencodedfigures {\uchar{87}{22}\uchar{95}{98}}
+% \definecommand cnencodedcontents {\uchar{118}{238}\uchar{147}{4}}
+% \stopencoding
+
+% \startencoding[gbk]
+% \defineudigit 10000 200 102
+% \defineudigit 100000000 131 124
+
+% \definecommand cnencodedsection {\uchar{185}{157}}
+% \definecommand cnencodedfigure {\uchar{136}{68}}
+% \definecommand cnencodedunits {\uchar{211}{139}\uchar{193}{191}\uchar{134}{206}\uchar{206}{187}}
+% \definecommand cnencodedlogos {\uchar{187}{213}\uchar{217}{72}
+% \definecommand cnencodedabbreviations {\uchar{191}{115}\uchar{194}{212}\uchar{213}{90}}
+% \definecommand cnencodedfigures {\uchar{136}{68}\uchar{208}{206}}
+% \definecommand cnencodedcontents {\uchar{196}{191}\uchar{228}{155}}
+% \stopencoding
+
+% \startencoding[big5]
+% \defineudigit 10000 184 85
+% \defineudigit 100000000 187 245
+
+% \definecommand cnencodedsection {\uchar{184}{96}}
+% \definecommand cnencodedfigure {\uchar{185}{207}}
+% \definecommand cnencodedunits {\uchar{173}{112}\uchar{182}{113}\uchar{179}{230}\uchar{166}{236}}
+% \definecommand cnencodedlogos {\uchar{192}{178}\uchar{182}{83}}
+% \definecommand cnencodedabbreviations {\uchar{193}{89}\uchar{178}{164}\uchar{187}{121}}
+% \definecommand cnencodedfigures {\uchar{185}{207}\uchar{167}{206}}
+% \definecommand cnencodedcontents {\uchar{165}{216}\uchar{191}{253}}
+% \stopencoding
+
\stopencoding
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-ctx.tex b/Master/texmf-dist/tex/context/base/lang-ctx.tex
index b3a2e020fd5..2f3c2dfd7ef 100644
--- a/Master/texmf-dist/tex/context/base/lang-ctx.tex
+++ b/Master/texmf-dist/tex/context/base/lang-ctx.tex
@@ -40,8 +40,20 @@
\installlanguage [\s!pl] [\s!mapping={pl0,ec,qx},\s!encoding={pl0,ec,qx}] % pl0 may go
\installlanguage [\s!cz] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go
\installlanguage [\s!sk] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go
-\installlanguage [\s!sl] [\s!mapping={il2,ec},\s!encoding={il2,ec}] % il2 may go
+\installlanguage [\s!sl] [\s!mapping=ec,\s!encoding=ec] % il2 has gone
\installlanguage [\s!vn] [\s!mapping=t5,\s!encoding=t5]
+\installlanguage [\s!ru] [\s!mapping=t2a,\s!encoding=t2a]
+
+% beware, don't use \setuplanguage here
+
+\installlanguage[\s!en][\s!lefthyphenmin=2,\s!righthyphenmin=3] % patterns can only handle this
+\installlanguage[\s!uk][\s!lefthyphenmin=3,\s!righthyphenmin=3] % patterns can only handle this
+\installlanguage[\s!us][\s!lefthyphenmin=2,\s!righthyphenmin=3] % patterns can only handle this
+
+% greek
+
+\installlanguage[\s!agr][\s!mapping=\s!agr,\s!encoding=\s!agr]
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-ger.tex b/Master/texmf-dist/tex/context/base/lang-ger.tex
index 919748c691f..4434b7dbaa1 100644
--- a/Master/texmf-dist/tex/context/base/lang-ger.tex
+++ b/Master/texmf-dist/tex/context/base/lang-ger.tex
@@ -126,7 +126,7 @@
\c!leftquotation=\upperleftdoublesixquote,
\c!rightquotation=\upperrightdoubleninequote,
\c!date={\v!day,{.},\ ,\v!month,\ ,\v!year},
- \c!default=\s!nl, % patterns
+ \c!default=\s!no,
\c!state=\v!stop]
%D Extra:
@@ -165,111 +165,6 @@
\installlanguage [norwegian] [\s!no]
\installlanguage [norsk] [\s!no] % bonus switch
-% GERMAN
-%
-% %D The next section is dedicated to Tobias Burnus.
-%
-% \startlanguagespecifics[\s!de]
-%
-% \installcompoundcharacter "a {\moveaccent{-.1ex}\"a\midworddiscretionary}
-% \installcompoundcharacter "e {\moveaccent{-.1ex}\"e\midworddiscretionary}
-% \installcompoundcharacter "i {\moveaccent{-.1ex}\"\i\midworddiscretionary}
-% \installcompoundcharacter "o {\moveaccent{-.1ex}\"o\midworddiscretionary}
-% \installcompoundcharacter "u {\moveaccent{-.1ex}\"u\midworddiscretionary}
-% \installcompoundcharacter "s {\SS}
-% \installcompoundcharacter "z {\SS}
-%
-% \installcompoundcharacter "A {\smashaccent\"A}
-% \installcompoundcharacter "E {\smashaccent\"E}
-% \installcompoundcharacter "I {\smashaccent\"I}
-% \installcompoundcharacter "O {\smashaccent\"O}
-% \installcompoundcharacter "U {\smashaccent\"U}
-% \installcompoundcharacter "Z {SZ}
-% \installcompoundcharacter "S {SS}
-%
-% \stoplanguagespecifics
-%
-% \startlanguagespecifics[\s!de]
-%
-% \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}}
-% \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}}
-% \installcompoundcharacter "ll {\discretionary{ll-}{l}{ll}}
-% \installcompoundcharacter "mm {\discretionary{mm-}{m}{mm}}
-% \installcompoundcharacter "nn {\discretionary{nn-}{n}{nn}}
-% \installcompoundcharacter "pp {\discretionary{pp-}{p}{pp}}
-% \installcompoundcharacter "rr {\discretionary{rr-}{r}{rr}}
-% \installcompoundcharacter "tt {\discretionary{tt-}{t}{tt}}
-%
-% \installcompoundcharacter "CK {\discretionary {K-}{K}{CK}}
-% \installcompoundcharacter "FF {\discretionary{FF-}{F}{FF}}
-% \installcompoundcharacter "LL {\discretionary{LL-}{L}{LL}}
-% \installcompoundcharacter "MM {\discretionary{MM-}{M}{MM}}
-% \installcompoundcharacter "NN {\discretionary{NN-}{N}{NN}}
-% \installcompoundcharacter "PP {\discretionary{PP-}{P}{PP}}
-% \installcompoundcharacter "RR {\discretionary{RR-}{R}{RR}}
-% \installcompoundcharacter "TT {\discretionary{TT-}{T}{TT}}
-%
-% \stoplanguagespecifics
-%
-% \startlanguagespecifics[\s!de]
-%
-% \installcompoundcharacter "` {\handlequotation\c!leftquotation}
-% \installcompoundcharacter "' {\handlequotation\c!rightquotation}
-% \installcompoundcharacter ". {\kern.1em\ignorespaces}
-%
-% \def\setupDElanguage%
-% {\setuplanguage
-% [\s!de]
-% [\c!leftsentence=\leftguillemot,
-% \c!rightsentence=\rightguillemot,
-% \c!leftsubsentence=\leftsubguillemot,
-% \c!rightsubsentence=\rightsubguillemot]}
-%
-% \installcompoundcharacter "< {{\setupDElanguage|<|}}
-% \installcompoundcharacter "> {{\setupDElanguage|>|}}
-%
-% \stoplanguagespecifics
-%
-% %D An experimental hack:
-%
-% \startencoding[pdfdoc]
-% \startlanguagespecifics[\s!de]% hm, a % is needed
-% \defineactivecharacter " {\"} % no {\simplifiedcompoundcharacter"}
-% \stoplanguagespecifics
-% \stopencoding
-%
-% \startencoding[ec]
-% \startlanguagespecifics[\s!de]%
-% \installcompoundcharacter "a {\"a}
-% \installcompoundcharacter "e {\"e}
-% \installcompoundcharacter "i {\"\i}
-% \installcompoundcharacter "o {\"o}
-% \installcompoundcharacter "u {\"u}
-% \installcompoundcharacter "A {\"A}
-% \installcompoundcharacter "E {\"E}
-% \installcompoundcharacter "I {\"I}
-% \installcompoundcharacter "O {\"O}
-% \installcompoundcharacter "U {\"U}
-% \stoplanguagespecifics
-% \stopencoding
-%
-% \startencoding[texnansi]
-% \startlanguagespecifics[\s!de]%
-% \installcompoundcharacter "a {\"a}
-% \installcompoundcharacter "e {\"e}
-% \installcompoundcharacter "i {\"\i}
-% \installcompoundcharacter "o {\"o}
-% \installcompoundcharacter "u {\"u}
-% \installcompoundcharacter "A {\"A}
-% \installcompoundcharacter "E {\"E}
-% \installcompoundcharacter "I {\"I}
-% \installcompoundcharacter "O {\"O}
-% \installcompoundcharacter "U {\"U}
-% \stoplanguagespecifics
-% \stopencoding
-%
-% %D This hack should be perfected.
-
%% NORWEGIAN
%
% These three letters (in this order) are the
@@ -406,12 +301,14 @@
\setuplabeltext [\s!af] [\v!graphic=Grafiek ]
\setuplabeltext [\s!no] [\v!graphic=Grafikk ]
-\setuplabeltext [\s!en] [\v!chapter=]
+%D We don't set these here. One can do that in a style.
+
+\setuplabeltext [\s!en] [\v!chapter=] % Chapter
\setuplabeltext [\s!nl] [\v!chapter=]
-\setuplabeltext [\s!de] [\v!chapter=]
+\setuplabeltext [\s!de] [\v!chapter=] % Kapitel
\setuplabeltext [\s!da] [\v!chapter=]
\setuplabeltext [\s!sv] [\v!chapter=]
-\setuplabeltext [\s!af] [\v!chapter=] % [\v!chapter=hoofstuk]
+\setuplabeltext [\s!af] [\v!chapter=] % Hoofstuk
\setuplabeltext [\s!no] [\v!chapter=]
\setuplabeltext [\s!en] [\v!section=]
@@ -419,7 +316,7 @@
\setuplabeltext [\s!de] [\v!section=]
\setuplabeltext [\s!da] [\v!section=]
\setuplabeltext [\s!sv] [\v!section=]
-\setuplabeltext [\s!af] [\v!section=] % [\v!section=paragraaf]
+\setuplabeltext [\s!af] [\v!section=] % Paragraaf
\setuplabeltext [\s!no] [\v!section=]
\setuplabeltext [\s!en] [\v!subsection=]
@@ -446,12 +343,12 @@
\setuplabeltext [\s!af] [\v!subsubsubsection=]
\setuplabeltext [\s!no] [\v!subsubsubsection=]
-\setuplabeltext [\s!en] [\v!appendix=]
+\setuplabeltext [\s!en] [\v!appendix=] % Appendix
\setuplabeltext [\s!nl] [\v!appendix=]
-\setuplabeltext [\s!de] [\v!appendix=]
-\setuplabeltext [\s!da] [\v!appendix=] % [\v!appendix=bilag]
+\setuplabeltext [\s!de] [\v!appendix=] % Anhang
+\setuplabeltext [\s!da] [\v!appendix=] % Bilag
\setuplabeltext [\s!sv] [\v!appendix=]
-\setuplabeltext [\s!af] [\v!appendix=] % [\v!appendix=bylae]
+\setuplabeltext [\s!af] [\v!appendix=] % Bylae
\setuplabeltext [\s!no] [\v!appendix=]
\setuplabeltext [\s!en] [\v!part=Part ]
@@ -669,18 +566,22 @@
\def\enordinaldaynumber#1%
{#1\ifnum\lasttwodigits{#1}=11
- \ordinalstr{th}%
+ \highordinalstr{th}%
+ \else\ifnum\lasttwodigits{#1}=12
+ \highordinalstr{th}%
+ \else\ifnum\lasttwodigits{#1}=13
+ \highordinalstr{th}%
\else\ifcase\lastdigit{#1}%
- \ordinalstr{th}%
+ \highordinalstr{th}%
\or % 1
- \ordinalstr{st}%
+ \highordinalstr{st}%
\or % 2
- \ordinalstr{nd}%
+ \highordinalstr{nd}%
\or % 3
- \ordinalstr{rd}%
+ \highordinalstr{rd}%
\else
- \ordinalstr{th}%
- \fi\fi}
+ \highordinalstr{th}%
+ \fi\fi\fi\fi}
% \def\enordinaldaynumber#1%
% {#1\ordinalstr{\ifnum\lasttwodigits{#1}=11 th\else\ifcase\lastdigit{#1}
@@ -697,4 +598,19 @@
%D \ShowAllLanguageValues [\s!af] [afrikaans] {Afrikaaner} {boer} % afrikaanse gasvryheid
%D \ShowAllLanguageValues [\s!no] [norwegian] {Norwegian} {wood}
+%D Extra month names:
+
+\setuplabeltext [\s!en] [\v!january :\s!mnem=jan]
+\setuplabeltext [\s!en] [\v!february :\s!mnem=feb]
+\setuplabeltext [\s!en] [\v!march :\s!mnem=mar]
+\setuplabeltext [\s!en] [\v!april :\s!mnem=apr]
+\setuplabeltext [\s!en] [\v!may :\s!mnem=may]
+\setuplabeltext [\s!en] [\v!june :\s!mnem=jun]
+\setuplabeltext [\s!en] [\v!july :\s!mnem=jul]
+\setuplabeltext [\s!en] [\v!august :\s!mnem=aug]
+\setuplabeltext [\s!en] [\v!september:\s!mnem=sep]
+\setuplabeltext [\s!en] [\v!october :\s!mnem=oct]
+\setuplabeltext [\s!en] [\v!november :\s!mnem=nov]
+\setuplabeltext [\s!en] [\v!december :\s!mnem=dec]
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-grk.tex b/Master/texmf-dist/tex/context/base/lang-grk.tex
index cd83daddbd3..13cebb20746 100644
--- a/Master/texmf-dist/tex/context/base/lang-grk.tex
+++ b/Master/texmf-dist/tex/context/base/lang-grk.tex
@@ -83,4 +83,11 @@
%D % \ShowAllLanguageValues [\s!gr] [\greekEpsilon\greeklambda\greeklambda\greeketa\greeknu\greekiota\greekkappa\greekalphatonos] {Greek} {love}
+\installlanguage
+ [\s!agr]
+ [\s!default=\s!gr,
+ \c!state=\v!stop]
+
+\installlanguage [ancientgreek] [\s!agr]
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-ini.tex b/Master/texmf-dist/tex/context/base/lang-ini.tex
index e435c2420cf..f47a4e9147f 100644
--- a/Master/texmf-dist/tex/context/base/lang-ini.tex
+++ b/Master/texmf-dist/tex/context/base/lang-ini.tex
@@ -95,17 +95,17 @@
\stopmessages
\startmessages norwegian library: linguals
- title: sprk
- 1: orddelingsmnster -- for -- er lest inn (n=--,e=--,m=--)
- 2: ingen orddelingsmnster -- for -- (n=--,e=--,m=--) (--,--)
+ title: sprøk
+ 1: orddelingsmønster -- for -- er lest inn (n=--,e=--,m=--)
+ 2: ingen orddelingsmønster -- for -- (n=--,e=--,m=--) (--,--)
3: orddelingsdefinisjon -- for -- er lest inn (n=--,e=--,m=--)
4: ingen orddelingsdefinisjon -- for -- (n=--,e=--,m=--)
- 5: orddelingsmnster for -- er ikke lest inn
- 6: sprk -- er udefinert
- 7: sprk spesifikk opsjon [--] introduserer et -- hopp
- 8: sprk spesifikk opsjon [--] problemfritt tilfyd
- 9: sprk -- er aktivt
- 10: orddelingsmnster -- er lest inn
+ 5: orddelingsmønster for -- er ikke lest inn
+ 6: spràk -- er udefinert
+ 7: spràk spesifikk opsjon [--] introduserer et -- hopp
+ 8: spràk spesifikk opsjon [--] problemfritt tilføyd
+ 9: spràk -- er aktivt
+ 10: orddelingsmønster -- er lest inn
\stopmessages
\startmessages romanian library: linguals
@@ -122,6 +122,20 @@
10: sabloanele -- incarcate
\stopmessages
+\startmessages french library: linguals
+ title: langue
+ 1: les motifs -- pour -- sont chargés (n=--,e=--,m=--)
+ 2: pas de motifs -- pour -- (n=--,e=--,m=--) (--,--)
+ 3: hyphenations -- pour -- chargés (n=--,e=--,m=--)
+ 4: pas d'hyphenations -- pour -- (n=--,e=--,m=--)
+ 5: les motifs pour -- ne sont pas chargés
+ 6: langue -- non définie
+ 7: les options spécifiques de langue [--] introduisent un -- saut
+ 8: les options spécifiques de langue [--] sont ajoutés en douceur
+ 9: la langue -- est active
+ 10: motifs -- chargés
+\stopmessages
+
%D When loading hyphenation patterns, \TEX\ assign a number to
%D each loaded table, starting with~0. Switching to a specific
%D table is done by assigning the relevant number to the
@@ -165,11 +179,31 @@
%D the languages. The current langage is saved in the macro
%D \type {\currentlanguage}. The setup macro is mainly used
%D for cosmetic purposes.
+%D
+%D \starttyping
+%D \dorecurse{3}
+%D {\language[nl]
+%D \startmode[*en] english \stopmode
+%D \startmode[*nl] dutch \stopmode
+%D \language[en]
+%D \startmode[*en] english \stopmode
+%D \startmode[*nl] dutch \stopmode}
+%D \stoptyping
\let\currentlanguage \empty
\let\currentmainlanguage\empty
-\def\setupcurrentlanguage[#1]{\def\currentlanguage{#1}}
+\def\setupcurrentlanguage[#1]{\setcurrentlanguage\currentmainlanguage{#1}}
+
+\def\setcurrentlanguage#1#2% sets modes: **id (currentmain) *id (current)
+ {\doifsomething{#1}
+ {\ifx\currentmainlanguage\empty\else\resetsystemmode{\systemmodeprefix\currentmainlanguage}\fi
+ \edef\currentmainlanguage{#1}%
+ \setsystemmode{\systemmodeprefix\currentmainlanguage}}%
+ \doifsomething{#2}
+ {\ifx\currentlanguage\empty\else\resetsystemmode\currentlanguage\fi
+ \edef\currentlanguage{#2}%
+ \setsystemmode\currentlanguage}}
%D The internal macros will be defined later.
@@ -249,6 +283,8 @@
\s!patterns=,
\s!mapping=,
\s!encoding=,
+ \s!lefthyphenmin=\defaultlanguageparameter\s!lefthyphenmin,
+ \s!righthyphenmin=\defaultlanguageparameter\s!righthyphenmin,
#2]}%
\doifvalue{\??la#1\c!default}{#1}{\letvalue{\??la#1\c!default}\empty}%
% loop in deo: \doifvalue{\??la#1\s!patterns}{#1}{\letvalue{\??la#1\c!default}\empty}%
@@ -303,22 +339,23 @@
\dodoloadpatterns{#1}{#2}{}{}%
\fi}
+\def\setuphyppatencoding
+ {\pathypsettings
+ \enableregime[utf]}
+
+\beginXETEX
+ \def\setuphyppatencoding
+ {\pathypsettings}
+\endXETEX
+
\def\dodoloadpatterns#1#2#3#4% beware, loaded language also incr
{\normallanguage\loadedlanguage % when not really needed
\bgroup
- % \startencoding[#3]%
- % \enablemapping[#4]% hm, does a sync patterns
- % \doifnothing\currentencoding{\let\currentencoding\s!default}%
- % \doifnothing\currentmapping {\let\currentmapping \s!default}%
- % better:
\let\synchronizepatterns\relax % needed?
\let\enabledmapping \empty % needed?
- % old (original) patterns
\doifelsenothing{#3}{\enableencoding[\s!default]}{\enableencoding[#3]}%
\doifelsenothing{#4}{\enablemapping [\s!default]}{\enablemapping [#4]}%
- % new patterns
- % \enableregime[utf]%
- %
+ \setuphyppatencoding
\ifundefined{\??la\??la:\currentencoding:\currentmapping:#2}%
\let\doshowpatterns\relax
\edef\alreadyloadedlanguage
@@ -373,13 +410,8 @@
%D Quick and dirty, but useful:
%D
%D \showsetup{setuplanguage}
-
-% \def\setuplanguage
-% {\dodoubleargument\dosetuplanguage}
-
-% \def\dosetuplanguage[#1][#2]%
-% {\getparameters[\??la#1][#2]%
-% \doif{#1}\currentlanguage\docomplexlanguage}
+%D
+%D Beware, this command can only be used when a language is installed.
\unprotected \def\setuplanguage
{\dodoubleempty\dosetuplanguage}
@@ -593,7 +625,7 @@
\ifcsname\l!prefix!\askedlanguage\endcsname
\edef\askedlanguage{\csname\l!prefix!\askedlanguage\endcsname}%
\ifx\currentlanguage\askedlanguage \else
- \let\currentlanguage\askedlanguage
+ \setcurrentlanguage\currentmainlanguage\askedlanguage
\docomplexlanguage
\fi
\else
@@ -613,7 +645,7 @@
\else
\edef\askedlanguage{\csname\l!prefix!\askedlanguage\endcsname}%
\ifx\currentlanguage\askedlanguage \else
- \let\currentlanguage\askedlanguage
+ \setcurrentlanguage\currentmainlanguage\askedlanguage
\docomplexlanguage
\fi
\fi
@@ -633,8 +665,7 @@
\ifcsname\l!prefix!\askedlanguage\endcsname
\edef\askedlanguage{\csname\l!prefix!\askedlanguage\endcsname}%
\ifx\currentmainlanguage\askedlanguage \else
- \let\currentmainlanguage\askedlanguage
- \let\currentlanguage\askedlanguage
+ \setcurrentlanguage\askedlanguage\askedlanguage
\docomplexlanguage
\fi
\fi
@@ -650,8 +681,7 @@
\@EA\ifx\csname\l!prefix!\askedlanguage\endcsname\relax\else
\edef\askedlanguage{\csname\l!prefix!\askedlanguage\endcsname}%
\ifx\currentmainlanguage\askedlanguage \else
- \let\currentmainlanguage\askedlanguage
- \let\currentlanguage\askedlanguage
+ \setcurrentlanguage\askedlanguage\askedlanguage
\docomplexlanguage
\fi
\fi
@@ -680,12 +710,18 @@
% \def\languageparameter#1%
% {\csname\??la\defaultlanguage\currentlanguage#1\endcsname}
-\def\languageparameter
+\def\languageparameter % @EA = speedup
{\@EA\dolanguageparameter\@EA{\defaultlanguage\currentlanguage}}
-\def\xxlanguageparameter#1%
+\def\specificlanguageparameter#1% @EA = speedup
+ {\@EA\dospecificlanguageparameter\@EA{\defaultlanguage{#1}}{#1}}
+
+\def\xxlanguageparameter#1% @EA = speedup
{\@EA\dolanguageparameter\@EA{\defaultlanguage{#1}}}
+\def\defaultlanguageparameter#1%
+ {\csname\??la\s!default#1\endcsname}
+
\beginETEX
\def\dolanguageparameter#1#2%
@@ -699,6 +735,17 @@
\fi\fi
#2\endcsname}
+ \def\dospecificlanguageparameter#1#2#3%
+ {\csname\??la
+ \ifcsname\??la#2#3\endcsname
+ \@EA\ifx\csname\??la#2#3\endcsname\empty\s!default\else#2\fi
+ \else\ifcsname\??la#1#3\endcsname
+ \@EA\ifx\csname\??la#1#3\endcsname\empty\s!default\else#1\fi
+ \else
+ \s!default
+ \fi\fi
+ #3\endcsname}
+
\endETEX
\beginTEX
@@ -716,6 +763,19 @@
\fi
#2\endcsname}
+ \def\dospecificlanguageparameter#1#2#3%
+ {\csname\??la
+ \@EA\ifx\csname\??la#2#3\endcsname\relax
+ \@EA\ifx\csname\??la#1#3\endcsname\relax
+ \s!default
+ \else
+ \@EA\ifx\csname\??la#1#3\endcsname\empty\s!default\else#1\fi
+ \fi
+ \else
+ \@EA\ifx\csname\??la#2#3\endcsname\empty\s!default\else#2\fi
+ \fi
+ #3\endcsname}
+
\endTEX
% moved
diff --git a/Master/texmf-dist/tex/context/base/lang-ita.tex b/Master/texmf-dist/tex/context/base/lang-ita.tex
index f2640379ab3..950f87344f3 100644
--- a/Master/texmf-dist/tex/context/base/lang-ita.tex
+++ b/Master/texmf-dist/tex/context/base/lang-ita.tex
@@ -23,7 +23,7 @@
%D
%D \starttabulate[|lB|l|]
%D \NC Italian \NC Giuseppe Bilotta \NC \NR
-%D \NC Rumanian \NC Dan Seracu \NC \NR
+%D \NC Romanian \NC Dan Seracu \NC \NR
%D \NC Portuguese \NC Pedro F. M. Mendon\c a \NC \NR
%D \stoptabulate
@@ -162,7 +162,7 @@
\setupheadtext [\s!pt] [\v!content=Conte\'udo]
\setupheadtext [\s!ro] [\v!content=Cuprins]
-\setupheadtext [\s!fr] [\v!tables=Tables]
+\setupheadtext [\s!fr] [\v!tables=Tableaux]
\setupheadtext [\s!es] [\v!tables=Tablas]
\setupheadtext [\s!ca] [\v!tables=Taules]
\setupheadtext [\s!it] [\v!tables=Tabelle]
@@ -226,7 +226,7 @@
\setupheadtext [\s!pt] [\v!units=Unidades]
\setupheadtext [\s!ro] [\v!units=Unit\u{a}\c{t}i]
-\setuplabeltext [\s!fr] [\v!table=Table ]
+\setuplabeltext [\s!fr] [\v!table=Tableau ]
\setuplabeltext [\s!es] [\v!table=Tablas ]
\setuplabeltext [\s!ca] [\v!table=Taules ]
\setuplabeltext [\s!it] [\v!table=Tabella ]
@@ -477,21 +477,6 @@
\setuplabeltext [\s!ro] [\v!friday=vineri]
\setuplabeltext [\s!ro] [\v!saturday=s\^{a}mb\u{a}t\u{a}]
-% \startlanguagespecifics[\s!ro]
-%
-% \installcompoundcharacter "a {\u{a}}
-% \installcompoundcharacter "i {\^{\i}}
-% \installcompoundcharacter "s {\c{s}}
-% \installcompoundcharacter "t {\c{t}}
-% \installcompoundcharacter "A {\^{a}}
-% \installcompoundcharacter "I {\^{I}}
-% \installcompoundcharacter "S {\c{S}}
-% \installcompoundcharacter "T {\c{T}}
-% \installcompoundcharacter "` {\handlequotation\c!leftquotation}
-% \installcompoundcharacter "' {\handlequotation\c!rightquotation}
-%
-% \stoplanguagespecifics
-
%D Rather new \unknown
\setuplabeltext [\s!it] [\v!page=pagina ]
diff --git a/Master/texmf-dist/tex/context/base/lang-jap.tex b/Master/texmf-dist/tex/context/base/lang-jap.tex
new file mode 100644
index 00000000000..ffb53ea7035
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lang-jap.tex
@@ -0,0 +1,235 @@
+%D \module
+%D [ file=lang-jap,
+%D version=2006.01.13,
+%D title=\CONTEXT\ Language Macros,
+%D subtitle=Japanese,
+%D author={Richard Gabriel},
+%D date=\currentdate,
+%D copyright={PRAGMA / RG}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% rgabriel@kerio.com
+
+\writestatus{loading}{Context Language Macros / Japanese}
+
+\unprotect
+
+\definesystemconstant {japanese} \definesystemconstant {ja}
+
+\installlanguage
+ [\s!ja]
+ [\c!leftsentence=\jaencoding\jaleftsentence,
+ \c!rightsentence=\jaencoding\jarightsentence,
+ \c!leftsubsentence=\jaencoding\jaleftsubsentence,
+ \c!rightsubsentence=\jaencoding\jarightsubsentence,
+ \c!leftquote=\jaencoding\jaencodedsinglestartquote,
+ \c!rightquote=\jaencoding\jaencodedsingleendquote,
+ \c!leftquotation=\jaencoding\jaencodedstartquote,
+ \c!rightquotation=\jaencoding\jaencodedendquote,
+ \c!date={\jaencodedchristiandate,\v!year,\jaencodedyear,\v!month,\jaencodedmonth,\v!day,\jaencodedday},
+ \c!state=\v!stop]
+
+\setupheadtext [\s!ja] [\v!content={\jaencoding\jaencodedtableofcontents}]
+\setupheadtext [\s!ja] [\v!tables={\jaencoding\jaencodedtables}]
+\setupheadtext [\s!ja] [\v!figures={\jaencoding\jaencodedfigures}]
+\setupheadtext [\s!ja] [\v!graphics={\jaencoding\jaencodedgraphics}]
+\setupheadtext [\s!ja] [\v!intermezzi={\jaencoding\jaencodedintermezzos}]
+\setupheadtext [\s!ja] [\v!index={\jaencoding\jaencodedindex}]
+\setupheadtext [\s!ja] [\v!abbreviations={\jaencoding\jaencodedabbreviations}]
+\setupheadtext [\s!ja] [\v!logos={\jaencoding\jaencodedlogos}]
+\setupheadtext [\s!ja] [\v!units={\jaencoding\jaencodedunits}]
+
+\setuplabeltext [\s!ja] [\v!table={\jaencoding\jaencodedtable}]
+\setuplabeltext [\s!ja] [\v!figure={\jaencoding\jaencodedfigure}]
+\setuplabeltext [\s!ja] [\v!intermezzo={\jaencoding\jaencodedintermezzo}]
+\setuplabeltext [\s!ja] [\v!graphic={\jaencoding\jaencodedillustration}]
+\setuplabeltext [\s!ja] [\v!appendix={\jaencoding\jaencodedappendix}]
+\setuplabeltext [\s!ja] [\v!part={\jaencoding\jaencodedintro,\jaencoding\jaencodedpart}]
+\setuplabeltext [\s!ja] [\v!chapter={\jaencoding\jaencodedintro,\jaencoding\jaencodedchapter}]
+\setuplabeltext [\s!ja] [\v!section={\jaencoding\jaencodedintro,\jaencoding\jaencodedsection}]
+\setuplabeltext [\s!ja] [\v!line={\jaencoding\jaencodedline}]
+\setuplabeltext [\s!ja] [\v!lines={\jaencoding\jaencodedline}]
+
+\setuplabeltext [\s!ja] [\v!subsection=]
+\setuplabeltext [\s!ja] [\v!subsubsection=]
+\setuplabeltext [\s!ja] [\v!subsubsubsection=]
+
+%D Why are these languagespecifics ?
+
+\setuplabeltext [\s!ja] [\v!january=1]
+\setuplabeltext [\s!ja] [\v!february=2]
+\setuplabeltext [\s!ja] [\v!march=3]
+\setuplabeltext [\s!ja] [\v!april=4]
+\setuplabeltext [\s!ja] [\v!may=5]
+\setuplabeltext [\s!ja] [\v!june=6]
+\setuplabeltext [\s!ja] [\v!july=7]
+\setuplabeltext [\s!ja] [\v!august=8]
+\setuplabeltext [\s!ja] [\v!september=9]
+\setuplabeltext [\s!ja] [\v!october=10]
+\setuplabeltext [\s!ja] [\v!november=11]
+\setuplabeltext [\s!ja] [\v!december=12]
+
+\setuplabeltext [\s!ja] [\v!sunday=\jaencoding\jaencodedsunday ]
+\setuplabeltext [\s!ja] [\v!monday=\jaencoding\jaencodedmonday ]
+\setuplabeltext [\s!ja] [\v!tuesday=\jaencoding\jaencodedtuesday ]
+\setuplabeltext [\s!ja] [\v!wednesday=\jaencoding\jaencodedwednesday]
+\setuplabeltext [\s!ja] [\v!thursday=\jaencoding\jaencodedthursday ]
+\setuplabeltext [\s!ja] [\v!friday=\jaencoding\jaencodedfriday ]
+\setuplabeltext [\s!ja] [\v!saturday=\jaencoding\jaencodedsaturday ]
+
+% Hardcoded - \japaneseencoding should be defined similarly to \chineseencoding
+
+\unexpanded\def\jaencoding{\enableencoding[cjk-uni]}
+
+%D This list is taken from DocBook XSL stylesheets (http://docbook.sourceforge.net/).
+
+\startencoding[cjk-uni]
+
+ \definecommand jaencodedabstract {\uchar{105}{130}\uchar{137}{129}}
+ \definecommand jaencodedand {\uchar{48}{1}}
+ \definecommand jaencodedanswer {\uchar{123}{84}\uchar{255}{26}}
+ \definecommand jaencodedappendix {\uchar{78}{216}\uchar{147}{50}}
+ \definecommand jaencodedarticle {\uchar{152}{5}\uchar{118}{238}}
+ \definecommand jaencodedbibliography {\uchar{83}{194}\uchar{128}{3}\uchar{101}{135}\uchar{115}{46}}
+ \definecommand jaencodedbook {\uchar{48}{214}\uchar{48}{195}\uchar{48}{175}}
+ \definecommand jaencodedbridgehead {\uchar{152}{5}}
+ \definecommand jaencodedbullet {\uchar{37}{207}}
+ \definecommand jaencodedby {\uchar{255}{26}}
+ \definecommand jaencodedcaution {\uchar{108}{232}\uchar{97}{15}}
+ \definecommand jaencodedcolophon {\uchar{89}{101}\uchar{78}{216}}
+ \definecommand jaencodedcopyright {\uchar{136}{253}\uchar{79}{92}\uchar{132}{87}\uchar{79}{92}}
+ \definecommand jaencodeddedication {\uchar{139}{29}\uchar{143}{158}}
+ \definecommand jaencodededited {\uchar{125}{232}\uchar{128}{5}}
+ \definecommand jaencodededitedby {\uchar{125}{232}\uchar{128}{5}\uchar{255}{26}}
+ \definecommand jaencodededition {\uchar{125}{232}\uchar{150}{198}}
+ \definecommand jaencodedendquote {\uchar{48}{13}}
+ \definecommand jaencodedequation {\uchar{95}{15}}
+ \definecommand jaencodedexample {\uchar{79}{139}}
+ \definecommand jaencodedfigure {\uchar{86}{243}}
+ \definecommand jaencodedglossary {\uchar{117}{40}\uchar{138}{158}\uchar{150}{198}}
+ \definecommand jaencodedglosssee {\uchar{83}{194}\uchar{113}{103}}
+ \definecommand jaencodedglossseealso {\uchar{83}{194}\uchar{113}{103}}
+ \definecommand jaencodedchapter {\uchar{122}{224}}
+ \definecommand jaencodedimportant {\uchar{145}{205}\uchar{137}{129}\uchar{152}{5}\uchar{118}{238}}
+ \definecommand jaencodedindex {\uchar{118}{238}\uchar{107}{33}}
+ \definecommand jaencodedindexsymbols {\uchar{48}{183}\uchar{48}{243}\uchar{48}{220}\uchar{48}{235}}
+ \definecommand jaencodedintro {\uchar{123}{44}}
+ \definecommand jaencodedlistofequations {\uchar{95}{15}\uchar{118}{238}\uchar{107}{33}}
+ \definecommand jaencodedlistofexamples {\uchar{79}{139}\uchar{118}{238}\uchar{107}{33}}
+ \definecommand jaencodedlistoffigures {\uchar{86}{243}\uchar{118}{238}\uchar{107}{33}}
+ \definecommand jaencodedlistoftables {\uchar{136}{104}\uchar{118}{238}\uchar{107}{33}}
+ \definecommand jaencodedlistofunknown {\uchar{78}{13}\uchar{102}{14}\uchar{118}{238}\uchar{107}{33}}
+ \definecommand jaencodedmsgaud {\uchar{91}{254}\uchar{140}{97}\uchar{128}{5}}
+ \definecommand jaencodedmsglevel {\uchar{48}{236}\uchar{48}{217}\uchar{48}{235}}
+ \definecommand jaencodedmsgorig {\uchar{118}{122}\uchar{79}{225}\uchar{81}{67}}
+ \definecommand jaencodednavhome {\uchar{48}{219}\uchar{48}{252}\uchar{48}{224}}
+ \definecommand jaencodednavnext {\uchar{107}{33}\uchar{48}{110}\uchar{48}{218}\uchar{48}{252}\uchar{48}{184}}
+ \definecommand jaencodednavnextsibling {\uchar{101}{233}\uchar{144}{1}\uchar{48}{138}}
+ \definecommand jaencodednavprev {\uchar{82}{77}\uchar{48}{110}\uchar{48}{218}\uchar{48}{252}\uchar{48}{184}}
+ \definecommand jaencodednavprevsibling {\uchar{93}{251}\uchar{98}{59}\uchar{48}{87}}
+ \definecommand jaencodednavup {\uchar{78}{10}\uchar{48}{107}\uchar{98}{59}\uchar{48}{139}}
+ \definecommand jaencodednestedendquote {\uchar{48}{15}}
+ \definecommand jaencodednestedstartquote {\uchar{48}{14}}
+ \definecommand jaencodednonexistantelement {\uchar{137}{129}\uchar{125}{32}\uchar{48}{76}\uchar{91}{88}\uchar{87}{40}\uchar{48}{87}\uchar{48}{126}\uchar{48}{91}\uchar{48}{147}}
+ \definecommand jaencodednote {\uchar{108}{232}\uchar{97}{15}}
+ \definecommand jaencodednotes {\uchar{108}{232}\uchar{97}{15}}
+ \definecommand jaencodedpages {\uchar{80}{103}\uchar{115}{46}}
+ \definecommand jaencodedpart {\uchar{48}{209}\uchar{48}{252}\uchar{48}{200}}
+ \definecommand jaencodedpreface {\uchar{94}{143}\uchar{101}{135}}
+ \definecommand jaencodedprocedure {\uchar{98}{75}\uchar{152}{6}}
+ \definecommand jaencodedprocedureformal {\uchar{98}{75}\uchar{152}{6}}
+ \definecommand jaencodedproductionset {\uchar{48}{215}\uchar{48}{237}\uchar{48}{192}\uchar{48}{175}\uchar{48}{183}\uchar{48}{231}\uchar{48}{243}}
+ \definecommand jaencodedproductionsetformal {\uchar{48}{215}\uchar{48}{237}\uchar{48}{192}\uchar{48}{175}\uchar{48}{183}\uchar{48}{231}\uchar{48}{243}}
+ \definecommand jaencodedpublished {\uchar{118}{122}\uchar{136}{76}}
+ \definecommand jaencodedqandadiv {\uchar{85}{79}\uchar{255}{26}\uchar{48}{1}\uchar{123}{84}\uchar{255}{26}}
+ \definecommand jaencodedqandaentry {\uchar{85}{79}\uchar{255}{26}}
+ \definecommand jaencodedquestion {\uchar{85}{79}\uchar{255}{26}}
+ \definecommand jaencodedreference {\uchar{83}{194}\uchar{113}{103}}
+ \definecommand jaencodedrefname {\uchar{84}{13}\uchar{82}{77}}
+ \definecommand jaencodedrefsection {\uchar{152}{5}}
+ \definecommand jaencodedrefsynopsisdiv {\uchar{105}{130}\uchar{137}{129}}
+ \definecommand jaencodedrevhistory {\uchar{101}{57}\uchar{138}{2}\uchar{92}{101}\uchar{107}{116}}
+ \definecommand jaencodedrevision {\uchar{101}{57}\uchar{138}{2}}
+ \definecommand jaencodedsection {\uchar{152}{5}}
+ \definecommand jaencodedsee {\uchar{83}{194}\uchar{113}{103}}
+ \definecommand jaencodedseealso {\uchar{83}{194}\uchar{113}{103}}
+ \definecommand jaencodedseparator {\uchar{48}{1}}
+ \definecommand jaencodedset {\uchar{138}{45}\uchar{91}{154}}
+ \definecommand jaencodedsetindex {\uchar{118}{238}\uchar{107}{33}\uchar{138}{45}\uchar{91}{154}}
+ \definecommand jaencodedsidebar {\uchar{48}{181}\uchar{48}{164}\uchar{48}{201}\uchar{48}{208}\uchar{48}{252}}
+ \definecommand jaencodedsimplesect {\uchar{152}{5}}
+ \definecommand jaencodedsingleendquote {\uchar{32}{25}}
+ \definecommand jaencodedsinglestartquote {\uchar{32}{24}}
+ \definecommand jaencodedstartquote {\uchar{48}{12}}
+ \definecommand jaencodedstep {\uchar{48}{185}\uchar{48}{198}\uchar{48}{195}\uchar{48}{215}}
+ \definecommand jaencodedtable {\uchar{136}{104}}
+ \definecommand jaencodedtablenotes {\uchar{108}{232}\uchar{97}{15}}
+ \definecommand jaencodedtableofcontents {\uchar{118}{238}\uchar{107}{33}}
+ \definecommand jaencodedtip {\uchar{48}{198}\uchar{48}{163}\uchar{48}{195}\uchar{48}{215}}
+ \definecommand jaencodedunexpectedelementname {\uchar{78}{13}\uchar{102}{14}\uchar{48}{106}\uchar{137}{129}\uchar{125}{32}\uchar{84}{13}}
+ \definecommand jaencodedunsupported {\uchar{48}{181}\uchar{48}{221}\uchar{48}{252}\uchar{48}{200}\uchar{48}{87}\uchar{48}{126}\uchar{48}{91}\uchar{48}{147}}
+ \definecommand jaencodedwarning {\uchar{139}{102}\uchar{84}{74}}
+
+ \definecommand jaencodedyear {\uchar{94}{116}}
+ \definecommand jaencodedmonth {\uchar{103}{8}}
+ \definecommand jaencodedday {\uchar{101}{229}}
+
+\stopencoding
+
+%D Taken from Chinese (will be investigated yet...)
+
+\startencoding[cjk-uni]
+
+ \definecommand jaencodedleftsentence {\uchar{32}{20}\uchar{32}{20}}
+ \definecommand jaencodedrightsentence {\uchar{32}{20}\uchar{32}{20}}
+ \definecommand jaencodedleftsubsentence {\uchar{32}{20}\uchar{32}{20}}
+ \definecommand jaencodedrightsubsentence {\uchar{32}{20}\uchar{32}{20}}
+
+\stopencoding
+
+%D Special thanxx to Eizo Tsuchihashi (eizo@arcbrain.jp) for the following stuff
+
+\startencoding[cjk-uni]
+
+ \definecommand jaencodedchristiandate {\uchar{137}{127}\uchar{102}{166}}
+
+ \definecommand jaencodedtables {\uchar{103}{58}}
+ \definecommand jaencodedfigures {\uchar{86}{243}}
+ \definecommand jaencodedabbreviations {\uchar{117}{101}\uchar{138}{158}}
+ \definecommand jaencodedlogos {\uchar{116}{6}\uchar{96}{39}}
+ \definecommand jaencodedunits {\uchar{48}{230}\uchar{48}{203}\uchar{48}{195}\uchar{48}{196}}
+
+ \definecommand jaencodedgraphics {\uchar{48}{176}\uchar{48}{233}\uchar{48}{213}}
+ \definecommand jaencodedintermezzo {\uchar{149}{147}\uchar{89}{79}\uchar{102}{242}}
+ \definecommand jaencodedintermezzos {\uchar{149}{147}\uchar{89}{79}\uchar{102}{242}}
+ \definecommand jaencodedillustration {\uchar{48}{164}\uchar{48}{233}\uchar{48}{185}\uchar{48}{200}}
+ \definecommand jaencodedline {\uchar{125}{218}}
+ \definecommand jaencodedlines {\uchar{125}{218}}
+
+ \definecommand jaencodedjanuary {\uchar{78}{0}\uchar{103}{8}}
+ \definecommand jaencodedfebruary {\uchar{78}{140}\uchar{103}{8}}
+ \definecommand jaencodedmarch {\uchar{78}{9}\uchar{103}{8}}
+ \definecommand jaencodedapril {\uchar{86}{219}\uchar{103}{8}}
+ \definecommand jaencodedmay {\uchar{78}{148}\uchar{103}{8}}
+ \definecommand jaencodedjune {\uchar{81}{109}\uchar{103}{8}}
+ \definecommand jaencodedjuly {\uchar{78}{3}\uchar{103}{8}}
+ \definecommand jaencodedaugust {\uchar{81}{107}\uchar{103}{8}}
+ \definecommand jaencodedseptember {\uchar{78}{93}\uchar{103}{8}}
+ \definecommand jaencodedoctober {\uchar{83}{65}\uchar{103}{8}}
+ \definecommand jaencodednovember {\uchar{83}{65}\uchar{78}{0}\uchar{103}{8}}
+ \definecommand jaencodeddecember {\uchar{83}{65}\uchar{78}{140}\uchar{103}{8}}
+
+ \definecommand jaencodedsunday {\uchar{103}{8}\uchar{102}{220}\uchar{101}{229}}
+ \definecommand jaencodedmonday {\uchar{112}{107}\uchar{102}{220}\uchar{101}{229}}
+ \definecommand jaencodedtuesday {\uchar{108}{52}\uchar{102}{220}\uchar{101}{229}}
+ \definecommand jaencodedwednesday {\uchar{103}{40}\uchar{102}{220}\uchar{101}{229}}
+ \definecommand jaencodedthursday {\uchar{145}{209}\uchar{102}{220}\uchar{101}{229}}
+ \definecommand jaencodedfriday {\uchar{87}{31}\uchar{102}{220}\uchar{101}{229}}
+ \definecommand jaencodedsaturday {\uchar{101}{229}\uchar{102}{220}\uchar{101}{229}}
+
+\stopencoding
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/lang-run.tex b/Master/texmf-dist/tex/context/base/lang-run.tex
index 76e38e4c553..4b332cfb975 100644
--- a/Master/texmf-dist/tex/context/base/lang-run.tex
+++ b/Master/texmf-dist/tex/context/base/lang-run.tex
@@ -20,11 +20,13 @@
{\bgroup
\def\doshowpatterns##1##2##3##4% language number encoding mapping
{\NC##1\NC##3\NC##4\NC##2\NC
- \xxlanguageparameter{##1}\s!lefthyphenmin\NC\xxlanguageparameter{##1}\s!righthyphenmin\NC\NR}%
+ \specificlanguageparameter{##1}\s!lefthyphenmin \NC
+ \specificlanguageparameter{##1}\s!righthyphenmin\NC\NR}%
\starttabulate[|c|c|c|c|c|c|]
\HL
\NC \bf language \NC \bf encoding \NC \bf mapping \NC \bf number \NC
- \bf left\low{min} \NC \bf right\low{min} \NC \NR
+ \bf left\low{min} \NC
+ \bf right\low{min} \NC \NR
\HL
\preloadedpmessage
\HL
diff --git a/Master/texmf-dist/tex/context/base/lang-sla.tex b/Master/texmf-dist/tex/context/base/lang-sla.tex
index 428796e8a4d..f517fe7ff96 100644
--- a/Master/texmf-dist/tex/context/base/lang-sla.tex
+++ b/Master/texmf-dist/tex/context/base/lang-sla.tex
@@ -24,6 +24,7 @@
%D \NC Polish \NC Grzegorz Sapijaszko \NC \NR
%D \NC Croatian \NC \Zcaron eljko Vrba \NC \NR
%D \NC Slovenian \NC Mojca Miklavec \NC \NR
+%D \NC Cz and Sk \NC Richard Gabriel \NC \NR
%D \stoptabulate
% Belarussian, Russian, Ukrainian, Bulgarian, Macedonian,
@@ -141,81 +142,7 @@
\installlanguage [slovenian] [\s!sl]
\installlanguage [slovene] [\s!sl] % both possible
-% specifics
-%
-% \startlanguagespecifics[\s!pl]
-%
-% \installcompoundcharacter /a {\k a}
-% \installcompoundcharacter /c {\'c}
-% \installcompoundcharacter /e {\k e}
-% \installcompoundcharacter /l {\l}
-% \installcompoundcharacter /n {\'n}
-% \installcompoundcharacter /o {\'o}
-% \installcompoundcharacter /s {\'s}
-% \installcompoundcharacter /x {\'z}
-% \installcompoundcharacter /z {\.z}
-% \installcompoundcharacter /A {\k A}
-% \installcompoundcharacter /C {\'C}
-% \installcompoundcharacter /E {\k E}
-% \installcompoundcharacter /L {\L}
-% \installcompoundcharacter /N {\'N}
-% \installcompoundcharacter /O {\'O}
-% \installcompoundcharacter /S {\'S}
-% \installcompoundcharacter /X {\'Z}
-% \installcompoundcharacter /Z {\.Z}
-%
-% \stoplanguagespecifics
-%
-% \startlanguagespecifics[\s!pl]
-%
-% \installcompoundcharacter /, {\handlequotation\c!leftquotation}
-% \installcompoundcharacter /' {\handlequotation\c!rightquotation}
-%
-% \def\setupPLlanguage%
-% {\setuplanguage
-% [\s!pl]
-% [\c!leftsentence=\leftguillemot,
-% \c!rightsentence=\rightguillemot,
-% \c!leftsubsentence=\leftsubguillemot,
-% \c!rightsubsentence=\rightsubguillemot]}
-%
-% \installcompoundcharacter /< {{\setupPLlanguage|<|}}
-% \installcompoundcharacter /> {{\setupPLlanguage|>|}}
-%
-% \installcompoundcharacter /- {|-|}
-%
-% \stoplanguagespecifics
-%
-% \startlanguagespecifics[\s!pl]
-%
-% \definesortkey {/a}{a}{a}{\k a}
-% \definesortkey {/A}{a}{a}{\k a}
-% \definesortkey {/c}{c}{a}{\'c}
-% \definesortkey {/C}{c}{a}{\'c}
-% \definesortkey {/e}{e}{a}{\k e}
-% \definesortkey {/E}{e}{a}{\k e}
-% \definesortkey {/l}{l}{a}{\l }
-% \definesortkey {/L}{l}{a}{\l }
-% \definesortkey {/n}{n}{a}{\'n}
-% \definesortkey {/N}{n}{a}{\'n}
-% \definesortkey {/o}{o}{a}{\'o}
-% \definesortkey {/O}{o}{a}{\'o}
-% \definesortkey {/s}{s}{a}{\'s}
-% \definesortkey {/S}{s}{a}{\'s}
-% \definesortkey {/x}{z}{a}{\'x}
-% \definesortkey {/X}{z}{a}{\'x}
-% \definesortkey {/z}{z}{b}{\.z}
-% \definesortkey {/Z}{z}{b}{\.z}
-%
-% \stoplanguagespecifics
-%
-% \startencoding[pdfdoc]
-% \startlanguagespecifics[pl]% hm
-% \defineactivecharacter / {\simplifiedcompoundcharacter/}
-% \stoplanguagespecifics
-% \stopencoding
-%
-% this can best be handled by \quotation and ||
+% If this is really needed we should make an enco-fhr.
%
% \startlanguagespecifics[\s!hr]
%
@@ -258,14 +185,14 @@
\setupheadtext [\s!sl] [\v!figures=Slike]
\setupheadtext [\s!pl] [\v!graphics=Grafika]
-\setupheadtext [\s!cz] [\v!graphics=Grafika] % new
-\setupheadtext [\s!sk] [\v!graphics=...]
+\setupheadtext [\s!cz] [\v!graphics=Graf]
+\setupheadtext [\s!sk] [\v!graphics=Graf]
\setupheadtext [\s!hr] [\v!graphics=Slike]
\setupheadtext [\s!sl] [\v!graphics=Slike]
\setupheadtext [\s!pl] [\v!intermezzi=Intermezza]
\setupheadtext [\s!cz] [\v!intermezzi=Intermezza]
-\setupheadtext [\s!sk] [\v!intermezzi=...]
+\setupheadtext [\s!sk] [\v!intermezzi=Intermezz\aacute]
\setupheadtext [\s!hr] [\v!intermezzi=Intermezza]
\setupheadtext [\s!sl] [\v!intermezzi=Intermezzi]
@@ -276,20 +203,20 @@
\setupheadtext [\s!sl] [\v!index=Kazalo]
\setupheadtext [\s!pl] [\v!abbreviations=Skr\oacute cenie]
-\setupheadtext [\s!cz] [\v!abbreviations=Zkratky] % new
-\setupheadtext [\s!sk] [\v!abbreviations=...]
+\setupheadtext [\s!cz] [\v!abbreviations=Zkratky]
+\setupheadtext [\s!sk] [\v!abbreviations=Skratky]
\setupheadtext [\s!hr] [\v!abbreviations=Kratice]
\setupheadtext [\s!sl] [\v!abbreviations=Kratice]
\setupheadtext [\s!pl] [\v!logos=Znaki]
-\setupheadtext [\s!cz] [\v!logos=Loga] % new
-\setupheadtext [\s!sk] [\v!logos=...]
+\setupheadtext [\s!cz] [\v!logos=Loga]
+\setupheadtext [\s!sk] [\v!logos=Log\aacute]
\setupheadtext [\s!hr] [\v!logos=Znakovi]
\setupheadtext [\s!sl] [\v!logos=Logotipi]
\setupheadtext [\s!pl] [\v!units=Jednostki]
-\setupheadtext [\s!cz] [\v!units=Jednotky] % new
-\setupheadtext [\s!sk] [\v!units=...]
+\setupheadtext [\s!cz] [\v!units=Jednotky]
+\setupheadtext [\s!sk] [\v!units=Jednotky]
\setupheadtext [\s!hr] [\v!units=Jednostki]
\setupheadtext [\s!sl] [\v!units=Enote]
@@ -301,19 +228,19 @@
\setuplabeltext [\s!pl] [\v!figure=Ilustracja ]
\setuplabeltext [\s!cz] [\v!figure=Obr\aacute zek ]
-\setuplabeltext [\s!sk] [\v!figure=... ]
+\setuplabeltext [\s!sk] [\v!figure=Obr\aacute zok ]
\setuplabeltext [\s!hr] [\v!figure=Slika ]
\setuplabeltext [\s!sl] [\v!figure=Slika ]
\setuplabeltext [\s!pl] [\v!intermezzo=Intermezzo ]
\setuplabeltext [\s!cz] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!sk] [\v!intermezzo=... ]
+\setuplabeltext [\s!sk] [\v!intermezzo=Intermezzo ]
\setuplabeltext [\s!hr] [\v!intermezzo=Intermezzo ]
\setuplabeltext [\s!sl] [\v!intermezzo=Intermezzo ]
\setuplabeltext [\s!pl] [\v!graphic=Grafika ]
-\setuplabeltext [\s!cz] [\v!graphic=... ]
-\setuplabeltext [\s!sk] [\v!graphic=... ]
+\setuplabeltext [\s!cz] [\v!graphic=Graf ]
+\setuplabeltext [\s!sk] [\v!graphic=Graf ]
\setuplabeltext [\s!hr] [\v!graphic=Slika ]
\setuplabeltext [\s!sl] [\v!graphic=Slika ]
@@ -324,32 +251,32 @@
\setuplabeltext [\s!sl] [\v!chapter=] % Poglavje
\setuplabeltext [\s!pl] [\v!section=] % Podrozdzia\l
-\setuplabeltext [\s!cz] [\v!section=] % Sekce % new
-\setuplabeltext [\s!sk] [\v!section=]
+\setuplabeltext [\s!cz] [\v!section=] % Sekce
+\setuplabeltext [\s!sk] [\v!section=] % Sekcia
\setuplabeltext [\s!hr] [\v!section=] % Podrozdzia\l
\setuplabeltext [\s!sl] [\v!section=]
\setuplabeltext [\s!pl] [\v!subsection=]
-\setuplabeltext [\s!cz] [\v!subsection=] % Podsekce % new
-\setuplabeltext [\s!sk] [\v!subsection=]
+\setuplabeltext [\s!cz] [\v!subsection=] % Podsekce
+\setuplabeltext [\s!sk] [\v!subsection=] % Podsekcia
\setuplabeltext [\s!hr] [\v!subsection=]
\setuplabeltext [\s!sl] [\v!subsection=]
\setuplabeltext [\s!pl] [\v!subsubsection=]
-\setuplabeltext [\s!cz] [\v!subsubsection=] % Podpodsekce % new
-\setuplabeltext [\s!sk] [\v!subsubsection=]
+\setuplabeltext [\s!cz] [\v!subsubsection=] % Podpodsekce
+\setuplabeltext [\s!sk] [\v!subsubsection=] % Podpodsekcia
\setuplabeltext [\s!hr] [\v!subsubsection=]
\setuplabeltext [\s!sl] [\v!subsubsection=]
\setuplabeltext [\s!pl] [\v!subsubsubsection=]
-\setuplabeltext [\s!cz] [\v!subsubsubsection=] % Podpodpodsekce % new
-\setuplabeltext [\s!sk] [\v!subsubsubsection=]
+\setuplabeltext [\s!cz] [\v!subsubsubsection=] % Podpodpodsekce
+\setuplabeltext [\s!sk] [\v!subsubsubsection=] % Podpodpodsekcia
\setuplabeltext [\s!hr] [\v!subsubsubsection=]
\setuplabeltext [\s!sl] [\v!subsubsubsection=]
\setuplabeltext [\s!pl] [\v!appendix=] % Dodatek
-\setuplabeltext [\s!cz] [\v!appendix=P\rcaron\iacute loha] % new
-\setuplabeltext [\s!sk] [\v!appendix=]
+\setuplabeltext [\s!cz] [\v!appendix=P\rcaron\iacute loha]
+\setuplabeltext [\s!sk] [\v!appendix=Pr\iacute loha]
\setuplabeltext [\s!hr] [\v!appendix=Dodatak ]
\setuplabeltext [\s!sl] [\v!appendix=Dodatek ]
@@ -360,14 +287,14 @@
\setuplabeltext [\s!sl] [\v!part=Del ]
\setuplabeltext [\s!pl] [\v!line=wiersz ]
-\setuplabeltext [\s!cz] [\v!line=\rcaron\aacute dek] % new
-\setuplabeltext [\s!sk] [\v!line=... ]
+\setuplabeltext [\s!cz] [\v!line=\rcaron\aacute dek]
+\setuplabeltext [\s!sk] [\v!line=riadok ]
\setuplabeltext [\s!hr] [\v!line=red ]
\setuplabeltext [\s!sl] [\v!line=vrstica ]
\setuplabeltext [\s!pl] [\v!lines=wiersze ]
-\setuplabeltext [\s!cz] [\v!lines=\rcaron\aacute dky] % new
-\setuplabeltext [\s!sk] [\v!lines=... ]
+\setuplabeltext [\s!cz] [\v!lines=\rcaron\aacute dky]
+\setuplabeltext [\s!sk] [\v!lines=riadky ]
\setuplabeltext [\s!hr] [\v!lines=redovi ]
\setuplabeltext [\s!sl] [\v!lines=vrstice ]
@@ -492,7 +419,7 @@
\setuplabeltext [\s!sl] [\v!see=glej ]
% new
-\setuplabeltext [\s!cz] [\v!page=strna ]
+\setuplabeltext [\s!cz] [\v!page=strana ]
\setuplabeltext [\s!cz] [\v!atpage=na stran\ecaron\ ]
\setuplabeltext [\s!cz] [\v!hencefore=viz v\yacute\scaron e ]
\setuplabeltext [\s!cz] [\v!hereafter=viz n\iacute\zcaron e ]
diff --git a/Master/texmf-dist/tex/context/base/lang-spe.tex b/Master/texmf-dist/tex/context/base/lang-spe.tex
index c030c8045e3..ed6becb6002 100644
--- a/Master/texmf-dist/tex/context/base/lang-spe.tex
+++ b/Master/texmf-dist/tex/context/base/lang-spe.tex
@@ -145,6 +145,8 @@
\long\def\dosetlanguagespecifics#1#2%
{%ifundefined{\??la\languageencoding#2\??la}\letvalue{\??la\languageencoding#2\??la}\empty\fi
\ifundefined{\??la\languageencoding#2\??la}\forgetlanguagespecifics[#2]\fi
+ % the next line catches the case that specifics are enabled *before* they are defined
+ \expandafter\ifx\csname\??la\languageencoding#2\??la\endcsname\relax\forgetlanguagespecifics[#2]\fi
\appendvalue{\??la\languageencoding#2\??la}{#1}%
\bgroup
\setbox\scratchbox\hbox{\enablelanguagespecifics[#2]}%
diff --git a/Master/texmf-dist/tex/context/base/m-cweb.tex b/Master/texmf-dist/tex/context/base/m-cweb.tex
index 65184ddae8a..1d3455acf9e 100644
--- a/Master/texmf-dist/tex/context/base/m-cweb.tex
+++ b/Master/texmf-dist/tex/context/base/m-cweb.tex
@@ -224,9 +224,9 @@
%D The original macros are based on a 10~point bodyfont size. We
%D therefore have to specify dimension in points a bit
%D different. Specifications like .6pt are changed to
-%D \type{.06} times \type{\korpsgrootte}.
+%D \type{.06} times \type{\bodyfontsize}.
-\defCWEBmacro\CWEBpt {\korpsgrootte} % still dutch
+\defCWEBmacro\CWEBpt {\bodyfontsize} % still dutch
%D \macros{CEE,UNIX,TEX,CPLUSPLUS}{}
%D
diff --git a/Master/texmf-dist/tex/context/base/m-database.tex b/Master/texmf-dist/tex/context/base/m-database.tex
new file mode 100644
index 00000000000..b707a8ecc3a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-database.tex
@@ -0,0 +1,407 @@
+%D \module
+%D [ file=m-database,
+%D version=2006.04.23,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Database Thingies,
+%D author=Hans Hagen\& Taco Hoekwater,
+%D date=\currentdate,
+%D copyright=PRAGMA
+%D ]
+
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+% % % to be added to mult-* files
+%
+% % % todo: \dontcollectseparatedlist via k/v
+
+\definesystemvariable{ls}
+
+\def\c!first {first}
+\def\c!last {last}
+\def\c!quotechar {quotechar}
+
+\let\@NX\noexpand
+
+%D {processquotedlist}
+%D
+%D An even more general list processing macro is the
+%D following one:
+%D
+%D \starttyping
+%D \processquotedlist{beginsym}{endsym}{separator}\docommando list
+%D \stoptyping
+%D
+%D This one supports arbitrary open and close symbols as well
+%D as user defined separators.
+%D
+%D \starttyping
+%D \processquotedlist(){,}{"}\docommando(a=>b=>c=>d)
+%D \stoptyping
+
+\def\processquotedlist#1#2#3#4#5%
+ {\def\csvquotechar{#4}%
+ \edef\doconvertcsvquoteditem#4##1#4##2%
+ {\@NX\ifx##2#3%
+ \let\@NX\next\@NX\doconvertcsvlist
+ \def\@NX\arg{#3}%
+ \edef\@NX\temp{##1}%
+ \@NX\expanded{\@NX#5{\@NX\temp}}%
+ \@NX\else
+ \let\@NX\next\@NX\redoconvertcsvquoteditem
+ \def\@NX\arg{##1\@NX\csvquotechar}%
+ \@NX\fi
+ \@NX\expandafter\@NX\next\@NX\arg}%
+ \edef\redoconvertcsvquoteditem##1#4##2%
+ {\@NX\ifx##2#3%
+ \let\@NX\next\@NX\doconvertcsvlist
+ \def\@NX\arg{#3}%
+ \edef\@NX\temp{##1}%
+ \@NX\expanded{\@NX#5{\@NX\temp}}%
+ \@NX\else
+ \let\@NX\next\@NX\redoconvertcsvquoteditem
+ \def\@NX\arg{##1\@NX\csvquotechar}%
+ \@NX\fi
+ \@NX\expandafter\@NX\next\@NX\arg}%
+ \edef\doconvertcsvitem##1#3%
+ {\edef\@NX\temp{##1}%
+ \@NX\expanded{\@NX#5{\@NX\temp}}%
+ \@NX\doconvertcsvlist#3}%
+ \edef\doconvertcsvlist#3##1%
+ {\@NX\ifx##1\@NX#2%
+ \let\@NX\next \@NX\gobbleoneargument
+ \@NX\else\@NX\ifx##1#4%
+ \let\@NX\next \@NX\doconvertcsvquoteditem
+ \@NX\else
+ \let\@NX\next \@NX\doconvertcsvitem
+ \@NX\fi\@NX\fi \@NX\next##1}%
+ \doconvertcsvitem}
+
+\gdef\doprocessseparatedquoteditem#1%
+ {\appendseparatedlistparameter\c!left%
+ \appendseparatedlistcontent{#1}%
+ \appendseparatedlistparameter\c!right}
+
+
+% % % so far
+
+% \def\dodefineprocessseplist#1#2% separator \docommand
+% {\def\dodoprocessseplist##1##2#1%
+% {\ifx\relax##1%
+% \expandafter\nodoprocessseplist
+% \else\ifx##1#1%
+% #2{}%
+% #2{##2}%
+% \expandafter\expandafter\expandafter\dodoprocessseplist
+% \else
+% #2{##1##2}%
+% \expandafter\expandafter\expandafter\dodoprocessseplist
+% \fi\fi}%
+% \def\doprocessseplist##1\relax
+% {\dodoprocessseplist##1#1\relax#1\relax\relax\end}}
+%
+% a version more robust with regard to {a a} b c d situations
+
+\def\edef@relax{\relax}
+
+\def\dodefineprocessseplist#1#2% separator \docommand
+ {\def\dodoprocessseplist##1##2#1%
+ {\edef\!!stringa{##1}%
+ \ifx\edef@relax\!!stringa
+ \expandafter\nodoprocessseplist
+ \else\ifx\!!stringa#1%
+ #2{}%
+ #2{##2}%
+ \expandafter\expandafter\expandafter\dodoprocessseplist
+ \else
+ #2{##1##2}%
+ \expandafter\expandafter\expandafter\dodoprocessseplist
+ \fi\fi}%
+ \def\doprocessseplist##1\relax
+ {\dodoprocessseplist##1#1\relax#1\relax\relax\end}}
+
+\def\nodoprocessseplist#1\end
+ {}
+
+\long\def\processseplist#1#2#3\relax raw version
+ {\dodefineprocessseplist{#1}{#2}%
+ \dodoprocessseplist#3#1\relax#1\relax\relax\end}
+
+% \dodefineprocessseplist{,}\test
+% \dodoprocessseplist{,}a,b,c\relax,\relax\relax\end
+% \doprocessseplista,b,c\relax
+
+% \def\test#1{[#1]}
+% \startlines
+% \processseplist{,}\test ,2,,\relax
+% \processseplist{,}\test ,,,44\relax
+% \processseplist{,}\test ,,33,44\relax
+% \processseplist{,}\test 11,,33,44\relax
+% \processseplist{,}\test 1,2,3,4\relax
+% \stoplines
+
+\newtoks\separatedlistdata
+
+\def\appendseparatedlistparameter#1%
+ {\@EAEAEA\appendtoks\csname\??ls\currentseparatedlist#1\endcsname\to\separatedlistdata}
+
+\def\appendseparatedlistcontent#1%
+ {\appendtoks#1\to\separatedlistdata}
+
+\def\flushseparatedlistdata
+ {\the\separatedlistdata
+ \separatedlistdata\emptytoks}
+
+\def\initializeseparatedlistdata
+ {\separatedlistdata{\egroup}}
+
+\def\dontcollectseparatedlist
+ {\def\dodoprocessseparatedfileline
+ {\the\separatedlistdata
+ \separatedlistdata\emptytoks
+ \doprocessseparatedfileline}%
+ \def\dodoprocessseparatedline
+ {\the\separatedlistdata
+ \separatedlistdata\emptytoks
+ \doprocessseparatedline}%
+ \let\flushseparatedlistdata\egroup
+ \let\initializeseparatedlistdata\donothing}
+
+\chardef\separatedlistmode\zerocount
+
+\def\setcurrentlistseparator
+ {\edef\currentlistseparator
+ {\executeifdefined
+ {\??ls::\csname\??ls\currentseparatedlist\c!separator\endcsname}%
+ {\csname\??ls\currentseparatedlist\c!separator\endcsname}}%
+ \doifvalue{\??ls\currentseparatedlist\c!separator}{tab}
+ {\catcode`\^^I=12\relax}%
+ \ifx\currentlistseparator\empty\def\currentlistseparator{,}\fi}
+
+\bgroup \catcode`\^^I=12
+ \setgvalue{\??ls::tab}{ }
+ \setgvalue{\??ls::space}{ }
+ \setgvalue{\??ls::comma}{,}
+\egroup
+
+\def\doprocessseparatedfileline
+ {\ifeof\scratchread
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!after\fi
+ \immediate\closein\scratchread
+ \expandafter\flushseparatedlistdata
+ \else\ifx\line\empty
+ % skip, can be comment
+ \read\scratchread to\line
+ \@EA\dodoprocessseparatedfileline
+ \else
+ \appendseparatedlistparameter{\ifcase\separatedlistmode\c!first\else\c!command\fi}%
+ \ifx\currentlistquotechar\empty%
+ \expandafter\doprocessseplist\line\relax
+ \else
+ \expanded{\processquotedlist{}{\noexpand\end}%
+ {\currentlistseparator}{\currentlistquotechar}%
+ \noexpand\doprocessseparatedquoteditem \line\currentlistseparator\noexpand\end}%
+ \fi
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!last\fi
+ \read\scratchread to\line
+ \@EAEAEA\dodoprocessseparatedfileline
+ \fi\fi}
+
+\def\dodoprocessseparatedfileline
+ {\doprocessseparatedfileline}
+
+\def\doprocessseparatedfile[#1][#2]%
+ {\bgroup
+ \edef\currentseparatedlist{#1}%
+ \doifdefined{\??ls\currentseparatedlist\c!command}{\chardef\separatedlistmode\plusone}%
+ \setcurrentlistseparator
+ \edef\currentlistquotechar{\csname\??ls\currentseparatedlist\c!quotechar\endcsname}%
+ \expandafter\dodefineprocessseplist\expandafter{\currentlistseparator}\doprocessseparateditem
+ \initializeseparatedlistdata
+ \directsetup{\currentseparatedlist:\executeifdefined{\??ls\currentseparatedlist\c!setups}\s!default}%
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!before\fi
+ \endlinechar\minusone
+ \ignorelines
+ \catcode`\#\@@comment
+ \immediate\openin\scratchread=#2\relax % todo: \doopenin
+ \read\scratchread to\line
+ \doprocessseparatedfileline}
+
+\def\dostartseparatedlist#1[#2]%
+ {\bgroup
+ \edef\currentseparatedlist{#2}%
+ \doifdefined{\??ls\currentseparatedlist\c!command}{\chardef\separatedlistmode\plusone}%
+ \obeylines
+ \let#1\relax
+ \def\separateslistend{#1}%
+ \setcurrentlistseparator
+ \edef\currentlistquotechar{\csname\??ls\currentseparatedlist\c!quotechar\endcsname}%
+ \expandafter\dodefineprocessseplist\expandafter{\currentlistseparator}\doprocessseparateditem
+ \directsetup{\currentseparatedlist:\executeifdefined{\??ls\currentseparatedlist\c!setups}\s!default}%
+ \initializeseparatedlistdata
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!before\fi
+ \dodostartseparatedlist}
+
+\def\redoprocessseparatedline#1%
+ {\def\!!stringa{#1}%
+ \ifx\!!stringa\separateslistend
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!after\fi
+ \expandafter\flushseparatedlistdata
+ \else%
+ \appendseparatedlistparameter{\ifcase\separatedlistmode\c!first\else\c!command\fi}%
+ \ifx\currentlistquotechar\empty%
+ \doprocessseplist#1\relax
+ \else%
+ \convertargument#1\to\csvdata%
+ \expanded{\processquotedlist{}{\noexpand\end}%
+ {\currentlistseparator}{\currentlistquotechar}%
+ \noexpand\doprocessseparatedquoteditem \csvdata\currentlistseparator\noexpand\end}%
+ \fi
+ \ifcase\separatedlistmode\appendseparatedlistparameter\c!last\fi
+ \expandafter\dodoprocessseparatedline
+ \fi}
+
+\def\doprocessseparatedline
+ {\doifnextcharelse\bgroup\xdoprocessseparatedline\ydoprocessseparatedline}
+
+\def\dodoprocessseparatedline
+ {\doprocessseparatedline}
+
+\def\doprocessseparateditem#1%
+ {\ifcase\separatedlistmode
+ \appendseparatedlistparameter\c!left
+ \appendseparatedlistcontent{#1}%
+ \appendseparatedlistparameter\c!right
+ \else
+ \appendseparatedlistcontent{{#1}}%
+ \fi}
+
+
+\bgroup \obeylines
+
+ \gdef\dodostartseparatedlist#1
+ {\doprocessseparatedline}
+
+ \gdef\xdoprocessseparatedline#1#2
+ {\redoprocessseparatedline{{{#1}}#2}}
+
+ \gdef\ydoprocessseparatedline#1
+ {\redoprocessseparatedline{#1}}
+
+\egroup
+
+\startsetups CSV:unix
+ \catcode`\#=\@@comment
+\stopsetups
+
+\def\defineseparatedlist
+ {\dodoubleempty\dodefineseparatedlist}
+
+\def\dodefineseparatedlist[#1][#2]%
+ {\setvalue{\e!start#1}{\expandafter\dostartseparatedlist\csname\e!stop#1\endcsname[#1]}%
+ \getparameters
+ [\??ls#1]
+ [\c!separator=,
+ \c!quotechar=,
+ \c!first=,
+ \c!left=,
+ \c!before=,
+ \c!right=,
+ \c!last=,
+ \c!after=,
+% \c!command=,
+ #2]}
+
+\def\setupseparatedlist
+ {\dodoubleempty\dosetupseparatedlist}
+
+\def\dosetupseparatedlist[#1]% [#2]
+ {\getparameter[\??ls#1]} % [#2]
+
+\def\startseparatedlist[#1]%
+ {\dostartseparatedlist\stopseparatedlist[#1]}
+
+\def\processseparatedfile
+ {\dodoubleargument\doprocessseparatedfile}
+
+\protect \doifnotmode{demo}{\endinput}
+
+\defineseparatedlist
+ [CSV]
+ [separator={,},
+ first=\bTR,last=\eTR,
+ left=\bTD,right=\eTD,
+ before=\bTABLE,after=\eTABLE]
+
+\startseparatedlist[CSV]
+a,b,c
+d,e,f
+\stopseparatedlist
+
+\startCSV
+a,b,c
+d,e,f
+\stopCSV
+
+\defineseparatedlist
+ [CSV]
+ [separator={,},
+ quotechar={"},
+ first=\NC,last=\NR,
+ left=,right=\NC,
+ before={\starttabulate[|l|l|l|]},after=\stoptabulate]
+
+\startCSV
+a,b,"c,d"
+d,"""",f
+\stopCSV
+
+\defineseparatedlist
+ [CSV]
+ [separator={ },
+ first=\NC,last=\NR,
+ left=,right=\NC,
+ before={\starttabulate[|l|l|l|]},after=\stoptabulate]
+
+\startCSV
+a b c
+d e f
+\stopCSV
+
+\defineseparatedlist
+ [CSV]
+ [setups=unix,
+ first=\NC,last=\NR,
+ left=,right=\NC,
+ before={\starttabulate[|l|l|l|]},after=\stoptabulate]
+
+% \startsetups CSV:unix
+% \catcode`\#=\@@comment
+% \stopsetups
+
+% %1,2,3
+% 1,2,3
+% # 4,5,6
+% 4,5,6
+
+\processseparatedfile[CSV][test.dat]
+
+\defineseparatedlist
+ [CSVX]
+ [command=\Whatever,
+ separator={,},
+ first=\bTR,last=\eTR,
+ left=\bTD,right=\eTD,
+ before=\bTABLE,after=\eTABLE]
+
+\def\Whatever#1#2#3{[#1][#2][#3]\endgraf}
+
+\startseparatedlist[CSVX]
+a,b,c
+d,e,f
+\stopseparatedlist
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/m-dratex.tex b/Master/texmf-dist/tex/context/base/m-dratex.tex
new file mode 100644
index 00000000000..6c088daf98a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-dratex.tex
@@ -0,0 +1,21 @@
+%D \module
+%D [ file=m-dratex,
+%D version=2005.11.25,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=\DRATEX\ Loading Macros,
+%D author=Hans Hagen,
+%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
+
+\readfile{DraTex.sty}{}{\readfile{dratex.sty}{}{\endinput}}
+
+\letvalue{:NewCount}\newcount
+\letvalue{:NewDimen}\newdimen
+
+\readfile{AlDraTex.sty}{}{\readfile{aldratex.sty}{}{\endinput}}
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/m-gamma.tex b/Master/texmf-dist/tex/context/base/m-gamma.tex
index 698613db91b..05f5d3a4254 100644
--- a/Master/texmf-dist/tex/context/base/m-gamma.tex
+++ b/Master/texmf-dist/tex/context/base/m-gamma.tex
@@ -2,21 +2,21 @@
%D [ file=m-gamma,
%D version=2002.05.15,
%D title=\CONTEXT\ Extra Modules,
-%D subtitle=Basic \OMEGA\ Support,
+%D subtitle=Basic \OMEGA\ Support,
%D author={Idris Samawi Hamid, Hans Hagen},
%D date=\currentdate,
%D copyright={PRAGMA-ADE, Idris Samawi Hamid}]
%D
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D Most of this module is written by Idris Samawi Hamid.
+%D Most of this module is written by Idris Samawi Hamid.
-%D We define a couple of symbolic \OTP\ filters and
-%D sequences. First the filters:
-%D
-%D Todo: better names, no funny abbreviations.
+%D We define a couple of symbolic \OTP\ filters and
+%D sequences. First the filters:
+%D
+%D Todo: better names, no funny abbreviations.
\definefiltersynonym [utf8 to unicode16] [inutf8]
\definefiltersynonym [IdOCP] [id]
@@ -90,12 +90,12 @@
[SindhiOCP]
[SindhiUni,UniCUni,CUniArab]
-%D We wrap a couple of languages in environmen tmacros.
+%D We wrap a couple of languages in environmen tmacros.
%D beware: this solution is far from perfect!
-%D
-%D Todo: better interface to directional primitives.
%D
-%D Todo: proper language support (labels etc).
+%D Todo: better interface to directional primitives.
+%D
+%D Todo: proper language support (labels etc).
\definestartstop
[latin]
@@ -108,7 +108,7 @@
[commands=%
{\usefiltersequence[GreekOCP]%
\switchtobodyfont[omlgc]%
- \language=3\lefthyphenmin=2\righthyphenmin=2}]
+ \language=3\lefthyphenmin2\righthyphenmin=2}]
\definestartstop
[arab]
@@ -183,14 +183,14 @@
\let\typeout\message \input grlccode.tex
-%D We (pre)define a couple of fonts:
+%D We (pre)define a couple of fonts:
\usetypescriptfile[type-omg]
\usetypescript[OmegaArab]
\usetypescript[OmegaLGC]
-%D Dangerous definitions:
+%D Dangerous definitions:
\startencoding[omega]
@@ -201,7 +201,7 @@
\definecharacter dotlessi {^^^^0131}
\definecharacter ssharp {^^^^00df}
-\stopencoding
+\stopencoding
\enableencoding [omega]
@@ -210,20 +210,20 @@
\unexpanded \def\OMEGA {{\switchtobodyfont[omlgc]^^^^03a9}}
\unexpanded \def\OTP {\OMEGA TP}
-%D A few funny definitions:
+%D A few funny definitions:
\def\#{^^^^f023}
\def\${^^^^f024}
\def\%{^^^^f025}
\def\&{^^^^f026}
-%D I have no idea what this has to do with omega:
+%D I have no idea what this has to do with omega:
\def\heshe {\lohi{he} {she}}
\def\himher{\lohi{him}{her}}
\def\hisher{\lohi{his}{her}}
-% Brrr
+% Brrr
\setuptolerance [verytolerant]
diff --git a/Master/texmf-dist/tex/context/base/m-gnuplot.tex b/Master/texmf-dist/tex/context/base/m-gnuplot.tex
new file mode 100644
index 00000000000..8da9317b664
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-gnuplot.tex
@@ -0,0 +1,168 @@
+%D \module
+%D [ file=m-gnuplot,
+%D version=2006.01.04,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=\GNUPLOT\ Inclusion,
+%D author={Tobias Burnus, Hans Hagen, Taco Hoekwater, Mojca Miklavec},
+%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.
+
+% todo: reuse (only if really needed)
+
+% \enablemode[demo]
+
+%D example:
+%D
+%D \starttyping
+%D texexec --pdf --mode=demo m-gnuplot
+%D \stoptyping
+
+\unprotect
+
+\ifx\operatingsystem\undefined \def\operatingsystem{unix} \fi % texexec will set that
+
+\newcounter\GNUPLOTnumber
+
+\def\startGNUPLOTinclusions
+ {\bgroup
+ \obeylines
+ \catcode`\%=\@@letter
+ \dostartGNUPLOTinclusions}
+
+\def\dostartGNUPLOTinclusions#1\stopGNUPLOTinclusions
+ {\gdef\GNUPLOTinclusions{#1}%
+ \egroup}
+
+\let\GNUPLOTinclusions\empty
+
+\def\startGNUPLOTgraphic#1%
+ {\bgroup
+ \obeylines
+ \catcode`\%=\@@letter
+ \dostartGNUPLOTgraphic{#1}}
+
+\def\dostartGNUPLOTgraphic#1#2\stopGNUPLOTgraphic
+ {\doglobal\increment\GNUPLOTnumber
+ \letgvalue{gpg:n:#1}\GNUPLOTnumber
+ \setgvalue{gpg:d:\GNUPLOTnumber}{#2}%
+ \egroup}
+
+\def\useGNUPLOTgraphic
+ {\dodoubleempty\douseGNUPLOTgraphic}
+
+\def\douseGNUPLOTgraphic[#1][#2]%
+ {\iffirstargument
+ \@EA\dodouseGNUPLOTgraphic % like \externalfigure[name][optional args]
+ \else
+ \@EA\redouseGNUPLOTgraphic % like \useMPgraphic{name}
+ \fi[#1][#2]}
+
+\def\redouseGNUPLOTgraphic[#1][#2]#3%
+ {\dodouseGNUPLOTgraphic[#3][]}
+
+% \bgroup
+% \obeylines
+% \gdef\fixGNUPLOTnewlines%
+% {\def\par{;\@@svline}%
+% \def ^^M{;\@@svline}}
+% \egroup
+
+\ifx\systemendofline\undefined \def\systemendofline{\rawcharacter{10}} \fi
+
+\newtoks\everyGNUPLOTgraphic
+
+% gnuplot only seems to handle lf so we cannot use \mappartolineend
+% also, in order to prevent fuzzy runs (or no runs) we add a ; to
+% each line
+
+\appendtoks
+ \obeylines
+ \def\obeyedline{;\systemendofline}%
+\to \everyGNUPLOTgraphic
+
+\appendtoks
+ \let\%\letterpercent
+ \def\ {\letterbackslash\systemendofline}%
+\to \everyGNUPLOTgraphic
+
+\def\dodouseGNUPLOTgraphic[#1][#2]%
+ {\bgroup
+ \doifdefined{gpg:n:#1}
+ {\edef\GNUPLOTnumber{\getvalue{gpg:n:#1}}%
+ \edef\GNUPLOTfile {\bufferprefix gnuplot-\GNUPLOTnumber}%
+ \bgroup
+ \the\everyGNUPLOTgraphic
+ \immediate\openout\scratchwrite=\GNUPLOTfile.gpd
+ \immediate\write\scratchwrite{set terminal \@@GNUPLOToutput\space\@@GNUPLOToption}%
+ \doifnotempty
+ {\GNUPLOTinclusions}{\immediate\write\scratchwrite{\GNUPLOTinclusions}}%
+ \immediate\write\scratchwrite{set output "\GNUPLOTfile.\@@GNUPLOTsuffix"}%
+ \immediate\write\scratchwrite{\getvalue{gpg:d:\GNUPLOTnumber}}%
+ \immediate\write\scratchwrite{quit}%
+ \immediate\closeout\scratchwrite
+ \egroup
+ \processGNUPLOTgraphic
+ \convertGNUPLOTgraphic
+ \externalfigure[\@@GNUPLOTresult][#2]}%
+ \egroup}
+
+% we assume pdf inclusion, eps wil be implemented when applicable
+
+\def\setupGNUPLOT
+ {\dodoubleempty\getparameters[@@GNUPLOT]}
+
+\def\processGNUPLOTgraphic
+ {\doifelse\operatingsystem{mswin}
+ {\executesystemcommand{start /MIN pgnuplot \GNUPLOTfile.gpd}} % start is needed else gp fails
+ {\executesystemcommand{gnuplot \GNUPLOTfile.gpd}}}
+
+\def\convertGNUPLOTgraphic
+ {\doifsomething\@@GNUPLOThandle{\executesystemcommand{\@@GNUPLOThandle}}}
+
+\def\defineGNUPLOThandle#1#2#3#4#5% name output suffix conversion-method result
+ {\setvalue{@@GNUPLOT-#1}{{#2}{#3}{#4}{#5}}}
+
+\def\@@GNUPLOToutput{\filterfromvalue{@@GNUPLOT-\@@GNUPLOTmethod}41}
+\def\@@GNUPLOTsuffix{\filterfromvalue{@@GNUPLOT-\@@GNUPLOTmethod}42}
+\def\@@GNUPLOThandle{\filterfromvalue{@@GNUPLOT-\@@GNUPLOTmethod}43}
+\def\@@GNUPLOTresult{\filterfromvalue{@@GNUPLOT-\@@GNUPLOTmethod}44}
+
+\defineGNUPLOThandle{postscript}{postscript}{ps} {texmfstart newpstopdf --method=raw \GNUPLOTfile.ps}{\GNUPLOTfile.pdf}
+\defineGNUPLOThandle{ps} {postscript}{ps} {texmfstart newpstopdf --method=raw \GNUPLOTfile.ps}{\GNUPLOTfile.pdf}
+\defineGNUPLOThandle{pdf} {pdf} {pdf}{} {\GNUPLOTfile.pdf}
+\defineGNUPLOThandle{metapost} {mp} {mp} {texmfstart mptopdf \GNUPLOTfile.mp} {\GNUPLOTfile-0.pdf}
+\defineGNUPLOThandle{mp} {mp} {mp} {texmfstart mptopdf \GNUPLOTfile.mp} {\GNUPLOTfile-0.pdf}
+\defineGNUPLOThandle{png} {png} {png}{} {\GNUPLOTfile.png}
+
+\setupGNUPLOT[\c!method=ps,\c!option=]
+
+\protect \doifnotmode{demo}{\endinput}
+
+\starttext
+
+\startGNUPLOTinclusions
+ set title "trigonometry"
+\stopGNUPLOTinclusions
+
+\startGNUPLOTgraphic{sin}
+ plot sin(x)
+\stopGNUPLOTgraphic
+
+\startGNUPLOTgraphic{cos}
+ plot cos(x)
+\stopGNUPLOTgraphic
+
+\useGNUPLOTgraphic{sin} \endgraf
+\useGNUPLOTgraphic{cos} \endgraf
+\useGNUPLOTgraphic[cos] \endgraf
+
+\setupGNUPLOT[method=ps] \useGNUPLOTgraphic[sin][object=no,height=2cm] \blank
+%setupGNUPLOT[method=pdf] \useGNUPLOTgraphic[sin][object=no,height=2cm] \blank
+\setupGNUPLOT[method=png] \useGNUPLOTgraphic[sin][object=no,height=2cm] \blank
+\setupGNUPLOT[method=mp] \useGNUPLOTgraphic[sin][object=no,height=2cm,option=color] \blank
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/m-graph.tex b/Master/texmf-dist/tex/context/base/m-graph.tex
index 5e45f255b6f..dd30cef468d 100644
--- a/Master/texmf-dist/tex/context/base/m-graph.tex
+++ b/Master/texmf-dist/tex/context/base/m-graph.tex
@@ -8,55 +8,57 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D I finally finished graph support, if only because I could
-%D not stand the idea that Karel Wesseling would revert to
-%D \PiCTeX.
+%D I finally finished graph support, if only because I could
+%D not stand the idea that Karel Wesseling would revert to
+%D \PiCTeX.
-% pre 2000.08.06 version
+% pre 2000.08.06 version
%
-% \forceMPTEXgraphictrue
-%
-% \appendtoks
+% \forceMPTEXgraphictrue
+%
+% \startMPinitializations
% initialize_numbers ; % make sure that pseudo typesetting is set up
-% input graph ; % load the graph package
-% Autoform := "@g" ; % change the % template char into @
-% \to \MPinitializations
+% input graph ; % load the graph package
+% Autoform := "@g" ; % change the % template char into @
+% \stopMPinitializations
-%D The latest version does things more automatically (and
-%D efficiently when no text processing is needed). For
-%D definitions embedded in your document, you need to
-%D use \type {@} as template character, in external files,
-%D \type {%} is also supported.
+%D The latest version does things more automatically (and
+%D efficiently when no text processing is needed). For
+%D definitions embedded in your document, you need to
+%D use \type {@} as template character, in external files,
+%D \type {%} is also supported.
-\appendtoks input graph ; \to \MPinitializations
+\startMPinitializations
+ input graph ;
+\stopMPinitializations
-%D Graphics that have \type {begingraph} in them are
-%D recognized as such and force handling of embedded \TEX\
-%D code.
+%D Graphics that have \type {begingraph} in them are
+%D recognized as such and force handling of embedded \TEX\
+%D code.
\forceMPTEXcheck{begingraph}
-
-%D If you run into troubles, try:
-%D
-%D \starttyping
-%D \forceMPTEXgraphictrue
-%D \stoptyping
+
+%D If you run into troubles, try:
+%D
+%D \starttyping
+%D \forceMPTEXgraphictrue
+%D \stoptyping
%D
%D A demo can be run with:
%D
%D \starttyping
%D texexec --mode=demo --pdf m-graph
-%D \stoptyping
-
-% No longer needed, since John will fix it.
-%
-% %D For the moment we need the following patch. Adam T. Lindsay
-% %D found out that the following code produced an error:
-% %D
-% %D \starttyping
+%D \stoptyping
+
+% No longer needed, since John will fix it.
+%
+% %D For the moment we need the following patch. Adam T. Lindsay
+% %D found out that the following code produced an error:
+% %D
+% %D \starttyping
% %D \startMPcode
% %D draw begingraph(130mm,35mm);
% %D setrange(0,0,10,22000);
@@ -64,7 +66,7 @@
% %D autogrid(itick.bot,grid.lft) withcolor .75white ;
% %D endgraph;
% %D \stopMPcode
-% %D
+% %D
% %D \startMPcode
% %D draw begingraph(130mm,35mm);
% %D setrange(0,50,10,22000);
@@ -72,7 +74,7 @@
% %D autogrid(itick.bot,grid.lft) withcolor .75white ;
% %D endgraph;
% %D \stopMPcode
-% %D
+% %D
% %D \startMPcode
% %D draw begingraph(130mm,35mm);
% %D setrange(0,110,10,30000);
@@ -80,42 +82,41 @@
% %D autogrid(itick.bot,grid.lft) withcolor .75white ;
% %D endgraph;
% %D \stopMPcode
-% %D \stoptyping
+% %D \stoptyping
+% %D
+% %D The bug is a rather nasty one and needs some tweaking in
+% %D the low level graph code. John Hobby suggested for the
+% %D moment to initialize \type {setrange} as follows:
% %D
-% %D The bug is a rather nasty one and needs some tweaking in
-% %D the low level graph code. John Hobby suggested for the
-% %D moment to initialize \type {setrange} as follows:
-% %D
-% %D \starttyping
+% %D \starttyping
% %D setrange(0,0,"22000","22000")
-% %D \stoptyping
-% %D
-% %D Folowing this suggesion, I provide the following
-% %D extension:
-%
-% % \appendtoks
+% %D \stoptyping
+% %D
+% %D Folowing this suggesion, I provide the following
+% %D extension:
+
% def begingraph(expr w, h) =
% begingroup
% save X_, Y_, Gfin_, Gcur_, Gcbb_, Gneedgr_, Gneedfr_, Gdidsc_;
% save Gdpic_, Gppic_, Ggl_, Garw_;
% picture Gfin_, Gcur_, Gcbb_, Gdpic_, Gppic_, Ggl_[];
% boolean Gneedgr_, Gneedfr_, Gdidsc_;
-% Gfin_ = nullpicture;
-% Gcur_ = nullpicture;
-% Gcbb_ = nullpicture;
-% X_.ctyp = Y_.ctyp = linear;
-% Z_.gdim = (w,h);
-% X_.sc = Y_.sc = 0;
-% Gneedgr_ = true;
-% Gneedfr_ = true;
-% Gdidsc_ = false;
-% Gdpic_ = nullpicture;
-% Garw_ = 0;
-% scantokens everybegingraph ;
+% Gfin_ = nullpicture;
+% Gcur_ = nullpicture;
+% Gcbb_ = nullpicture;
+% X_.ctyp = Y_.ctyp = linear;
+% Z_.gdim = (w,h);
+% X_.sc = Y_.sc = 0;
+% Gneedgr_ = true;
+% Gneedfr_ = true;
+% Gdidsc_ = false;
+% Gdpic_ = nullpicture;
+% Garw_ = 0;
+% scantokens everybegingraph ;
% enddef;
-%
-% boolean fixsetrange ; fixsetrange := true ;
-%
+%
+% boolean fixsetrange ; fixsetrange := true ;
+%
% vardef dosetrange(text t) =
% interim warningcheck:=0;
% save r_; r_=0;
@@ -130,19 +131,18 @@
% exitif r_=4;
% endfor
% enddef;
-%
+%
% vardef setrange(text t) =
-% if fixsetrange : dosetrange(0,0,20000,20000) ; fi ;
+% if fixsetrange : dosetrange(0,0,20000,20000) ; fi ;
% dosetrange(t) ;
-% enddef ;
-%
-% if unknown everybegingraph :
+% enddef ;
+%
+% if unknown everybegingraph :
% string everybegingraph ;
-% % everybegingraph := "setrange(0,0,20000,20000)" ;
-% fi ;
-% \to \MPinitializations
+% % everybegingraph := "setrange(0,0,20000,20000)" ;
+% fi ;
-\appendtoks
+\startMPinitializations
% @# is X_ or Y_; $ is Gxcvlin_ or Gycvlin_; l and h are numeric or string
% It would not be OK to set (@#low,@#high) to a pair expression because $ might
% try to rescale @#low when evaluating the right-hand side for @#high.
@@ -156,19 +156,19 @@
-@\#low = if abs @\#ctyp<>log: $ fi Mlog_Str h ;
fi
enddef ;
-\to \MPinitializations
+\stopMPinitializations
-\doifnotmode {demo} {\endinput}
+\doifnotmode {demo} {\endinput}
-%D You need to have the data files in your path,
+%D You need to have the data files in your path,
%D otherwise the run is aborted.
\doiffileelse {agepop91.d}
{} {\writestatus{graph}{no data files found}\wait\end}
-%D The test:
+%D The test:
-\starttext
+\starttext
\startMPpage
draw begingraph(3in,2in);
diff --git a/Master/texmf-dist/tex/context/base/m-newmat.tex b/Master/texmf-dist/tex/context/base/m-newmat.tex
index 6f5f3586a69..eb3208d9458 100644
--- a/Master/texmf-dist/tex/context/base/m-newmat.tex
+++ b/Master/texmf-dist/tex/context/base/m-newmat.tex
@@ -189,7 +189,7 @@
%D
%D [HH] Another macro that users expect (slightly adapted):
-\def\boxed%
+\def\boxed
{\ifmmode\expandafter\mframed\else\expandafter\framed\fi}
%D \macros
diff --git a/Master/texmf-dist/tex/context/base/m-plus.tex b/Master/texmf-dist/tex/context/base/m-plus.tex
index a38c73129fa..312d9f93105 100644
--- a/Master/texmf-dist/tex/context/base/m-plus.tex
+++ b/Master/texmf-dist/tex/context/base/m-plus.tex
@@ -23,7 +23,8 @@
%D \usemodule[plus]
%D \stoptyping
-\readfile {plus-rul} \donothing \donothing
-\readfile {plus-pag} \donothing \donothing
+% \readfile {plus-rul} \donothing \donothing
+% \readfile {page-str} \donothing \donothing
+% \readfile {page-plg} \donothing \donothing
\endinput
diff --git a/Master/texmf-dist/tex/context/base/m-pstric.tex b/Master/texmf-dist/tex/context/base/m-pstric.tex
index 707984d288f..ac018fe074e 100644
--- a/Master/texmf-dist/tex/context/base/m-pstric.tex
+++ b/Master/texmf-dist/tex/context/base/m-pstric.tex
@@ -65,45 +65,45 @@
\def\startPSTRICKS
{\dosingleempty\dostartPSTRICKS}
-\ifx\startTEXapplication\undefined
-
-\long\def\dostartPSTRICKS[#1]#2\stopPSTRICKS
- {\doifelse{\jobsuffix}{dvi}
- {#2}
- {\bgroup
- \setbuffer[pstricks]%
- \usemodule[pstric]%
- \setbox\scratchbox\hbox{#2}%
- % There is probably a nicer way to handle this
- \immediate\openout\scratchwrite=\bufferprefix dim.tmp
- \immediate\write\scratchwrite{\dimen0=\the\ht\scratchbox}%
- \immediate\write\scratchwrite{\dimen2=\the\wd\scratchbox}%
- \immediate\closeout\scratchwrite
- % Quick and dirty
- \startTEXpage[#1]\box\scratchbox\stopTEXpage
- \endbuffer
- % Here we go!
- %\immediate\write18{texexec \bufferprefix pstricks.tmp --once --batch}%
- %\immediate\write18{dvips -G0 -Ppdf \bufferprefix pstricks -o}%
- %\immediate\write18{ps2pdf \bufferprefix pstricks.ps \bufferprefix pstricks.pdf}%
- \executesystemcommand{texexec \bufferprefix pstricks.tmp --once --batch}%
- \executesystemcommand{dvips -G0 -Ppdf \bufferprefix pstricks -o}%
- \executesystemcommand{ps2pdf \bufferprefix pstricks.ps \bufferprefix pstricks.pdf}%
- % We pick up the dimensions from the scratch file.
- \readlocfile{\bufferprefix pstricks-dim.tmp}{}{}%
- % Since the graphic is put on a page (sigh) by dvips/gs
- % we need to shift it around a bit.
- \setbox\scratchbox\hbox
- {\externalfigure[\bufferprefix pstricks.pdf][\c!object=\v!no]}%
- \setbox\scratchbox\hbox
- {\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}%
- \wd\scratchbox\dimen0
- \ht\scratchbox\dimen2
- \dp\scratchbox\zeropoint
- \box\scratchbox
- \egroup}}
-
-\fi
+% \ifx\startTEXapplication\undefined
+%
+% \long\def\dostartPSTRICKS[#1]#2\stopPSTRICKS
+% {\doifelse{\jobsuffix}{dvi}
+% {#2}
+% {\bgroup
+% \setbuffer[pstricks]%
+% \usemodule[pstric]%
+% \setbox\scratchbox\hbox{#2}%
+% % There is probably a nicer way to handle this
+% \immediate\openout\scratchwrite=\bufferprefix dim.tmp
+% \immediate\write\scratchwrite{\dimen0=\the\ht\scratchbox}%
+% \immediate\write\scratchwrite{\dimen2=\the\wd\scratchbox}%
+% \immediate\closeout\scratchwrite
+% % Quick and dirty
+% \startTEXpage[#1]\box\scratchbox\stopTEXpage
+% \endbuffer
+% % Here we go!
+% %\immediate\write18{texexec \bufferprefix pstricks.tmp --once --batch}%
+% %\immediate\write18{dvips -G0 -Ppdf \bufferprefix pstricks -o}%
+% %\immediate\write18{ps2pdf \bufferprefix pstricks.ps \bufferprefix pstricks.pdf}%
+% \executesystemcommand{texexec \bufferprefix pstricks.tmp --once --batch}%
+% \executesystemcommand{dvips -G0 -Ppdf \bufferprefix pstricks -o}%
+% \executesystemcommand{texmfstart pstopdf \bufferprefix pstricks.ps \bufferprefix pstricks.pdf}%
+% % We pick up the dimensions from the scratch file.
+% \readlocfile{\bufferprefix pstricks-dim.tmp}{}{}%
+% % Since the graphic is put on a page (sigh) by dvips/gs
+% % we need to shift it around a bit.
+% \setbox\scratchbox\hbox
+% {\externalfigure[\bufferprefix pstricks.pdf][\c!object=\v!no]}%
+% \setbox\scratchbox\hbox
+% {\lower\ht\scratchbox\hbox{\raise\dimen2\box\scratchbox}}%
+% \wd\scratchbox\dimen0
+% \ht\scratchbox\dimen2
+% \dp\scratchbox\zeropoint
+% \box\scratchbox
+% \egroup}}
+%
+% \fi
\long\def\dostartPSTRICKS[#1]#2\stopPSTRICKS
{\doifelse{\jobsuffix}{dvi} % will some day move to app as switch
diff --git a/Master/texmf-dist/tex/context/base/m-r.tex b/Master/texmf-dist/tex/context/base/m-r.tex
new file mode 100644
index 00000000000..244b62c3653
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-r.tex
@@ -0,0 +1,216 @@
+%D \module
+%D [ file=m-r,
+%D version=2006.06.06,
+%D title=\CONTEXT\ Modules,
+%D subtitle=R Support,
+%D author={Johan Sandblom \& Hans Hagen},
+%D date=\currentdate,
+%D copyright={PRAGMA / Johan Sandblom}]
+%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 The following R-processor is a variation on Johan Sandblom's
+%D prototype.
+%D
+%D We can combine both variants in one macro definition. Also, we
+%D can minimize the number of runs by checking for a change.
+
+%D \starttyping
+%D \newcounter\Rnumber
+%D \newtoks\everyR
+%D
+%D \appendtoks
+%D \obeylines
+%D \to \everyR
+%D
+%D \def\startR {\dostartR\stopR \plusone}
+%D \def\startRhidden{\dostartR\stopRhidden\zerocount}
+%D
+%D \def\dostartR#1#2%
+%D {\bgroup
+%D \ifcase#2\relax\let\typeRout\relax\fi
+%D \obeylines
+%D \catcode`\%=\@@letter
+%D \catcode`\#=\@@letter
+%D \def\dostartR##1#1%
+%D {\doglobal\increment\Rnumber
+%D \edef\Rfile{\bufferprefix R-\Rnumber}%
+%D \bgroup
+%D \the\everyR
+%D \def\par{\rawcharacter{10}}%
+%D \immediate\openout\scratchwrite=\Rfile.r
+%D \immediate\write\scratchwrite{##1}%
+%D \immediate\closeout\scratchwrite
+%D \egroup
+%D \doifmode{*\v!first}\runR
+%D \typefile{\Rfile.rout}%
+%D \egroup}%
+%D \doifnextcharelse\relax\dostartR\dostartR}
+%D
+%D \def\runR
+%D {\executesystemcommand{texmfstart
+%D --ifchanged=\Rfile.r bin:R
+%D "-q --save --restore < \Rfile.r > \Rfile.rout"}}
+%D \stoptyping
+
+%D JS: The call to R has \type {-q} in order to prevent banner,
+%D \type {--save} to make sure it saves the workspace after the run,
+%D \type {--restore} to make sure it reads any workspace from a
+%D previous session.
+
+%D An easier and better solution is to use the buffering mechanisms:
+
+\def\Rbufferprefix{r-}
+\newcounter\nofRfiles
+
+\def\Rfile{\TEXbufferfile{\Rbufferprefix\nofRfiles}}%
+
+\def\startR
+ {\doglobal\increment\nofRfiles
+ \dostartbuffer[\Rbufferprefix\nofRfiles][startR][stopR]}
+
+\def\stopR
+ {\doifmode{*\v!first}\runR
+ \typefile{\Rfile.out}}
+
+\def\startRhidden
+ {\doglobal\increment\nofRfiles
+ \dostartbuffer[\Rbufferprefix\nofRfiles][startRhidden][stopRhidden]}
+
+\def\stopRhidden
+ {\doifmode{*\v!first}\runR}
+
+% \def\runR % " " needed to preserve < >
+% {\executesystemcommand{texmfstart
+% --ifchanged=\Rfile\space --direct R
+% "-q --save --restore < \Rfile\space > \Rfile.out"}}
+
+\def\runR
+ {\executesystemcommand{texmfstart
+ --ifchanged=\Rfile\space --direct R
+ CMD BATCH -q --save --restore \Rfile\space \Rfile.out}}
+
+\protect \doifnotmode{demo}{\endinput}
+
+% Johan's test file:
+
+\usemodule[r]
+
+\def\R{R}
+
+\setupcolors[state=start]
+
+\setuptyping
+ [Rtype]
+ [color=darkgreen]
+
+\starttext
+
+First a test of whether the workspace is persistent:
+bla
+
+\startR
+a <- "bla"
+b <- "blabla"
+ls()
+\stopR
+
+One \R run ends, another begins.
+
+\startR
+ls()
+\stopR
+
+Now follows a hidden \R run which cleans the R workspace
+
+\startRhidden
+rm(list=ls())
+save.image()
+\stopRhidden
+
+What is in the workspace now?
+
+\startR
+ls()
+\stopR
+
+Then a small test of generating a graphic, in this case a pdf
+\startR
+ushape <- c(rexp(500000), 12-rexp(500000))
+pdf("ushape.pdf")
+par(mfrow=c(1,2))
+hist(ushape)
+plot(density(ushape), main="Density")
+dev.off()
+\stopR
+
+The graphic \type{ushape.pdf} can be included in the standard \CONTEXT\ way
+\startbuffer
+\placefigure{An ugly distribution}{\externalfigure[ushape]}
+\stopbuffer
+\typebuffer
+\getbuffer
+
+\startR
+x <- rnorm(900)
+y <- rexp(900)
+# test comment
+f <- gl(9,9,900)
+summary(aov(y~x+Error(f)))
+library(lattice)
+pdf("lattice.pdf")
+xyplot(y~x|f)
+dev.off()
+\stopR
+
+With \type{Sweave} lattice graphics calls must be enclosed in
+\type{print()} statements but that is not necessary here.
+
+\startbuffer
+\placefigure[here]{Lattice graphics}{\externalfigure[lattice]}
+\stopbuffer
+\typebuffer
+\getbuffer
+
+A test string with nasty characters. In \R, the result of a statement
+is not printed by default. Enclosing the statement in parentheses,
+however causes the parser to see only the value of the statement and
+applying the \type{print()} method.
+\startR
+(test <- ".*\\\\ [[{[{]{[{[{}\]\}=?!+%#|<|>@$")
+cat(test)
+\stopR
+
+A combination
+\startbuffer
+\placefigure{A combination of two previously used graphics}{
+\startcombination[2*1]
+ {\externalfigure[ushape][width=.4\textwidth]}{The first graphic, rescaled}
+ {\externalfigure[lattice][width=.4\textwidth]}{The second graphic, rescaled}}
+\stopcombination
+\stopbuffer
+\typebuffer
+\getbuffer
+
+Testing a function definition.
+
+\startR
+a.df <- data.frame(a=1:2, b=rnorm(2))
+a.df$a
+testfunction <- function(a=NULL, ...) {
+ for(i in 1:length(a)) {
+ gsub(a[[i]], "([a-r]|[A-R])", "bla")}
+ print(a)}
+\stopR
+
+What is in the workspace now?
+
+\startR
+ls()
+\stopR
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/m-steps.tex b/Master/texmf-dist/tex/context/base/m-steps.tex
index deda373eefe..8129d66996b 100644
--- a/Master/texmf-dist/tex/context/base/m-steps.tex
+++ b/Master/texmf-dist/tex/context/base/m-steps.tex
@@ -11,6 +11,9 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D When I need this module, I will reimplement it by using the new
+%D sometxt macro. Anyhow, it reflects the state of 2001.
+
\unprotect
% temp hack :
@@ -28,8 +31,8 @@
\def\@@STPC{@@STPC} % charts
\def\@@STPT{@@STPT} % tables
-\def\@@STEC{@@STEC} % cells
-\def\@@STET{@@STET} % tables
+\def\@@STEC{@@STEC} % cells
+\def\@@STET{@@STET} % tables
\def\@@STEL{@@STEL} % lines
\def\setupSTEPcharts{\dodoubleargument\getparameters[\@@STPC]}
@@ -41,7 +44,7 @@
\setupSTEPcharts
[\c!before=\blank,
\c!after=\blank,
- %\c!distance=.25em, % nvt
+ %\c!distance=.25em, % nvt
\c!hoffset=1em,
\c!voffset=1ex,
\c!method=1,
@@ -52,7 +55,7 @@
[\c!before=\blank,
\c!after=\blank,
\c!distance=.25em,
- %\c!hoffset=1em, % nvt
+ %\c!hoffset=1em, % nvt
\c!voffset=1ex,
\c!method=1,
\c!width=4em,
@@ -90,14 +93,14 @@
{\freezedimenmacro\@@STPCoffset
\startMPdrawing
line_v_offset := \@@STPCoffset ;
- line_method := \@@STPCmethod ; % only charts
+ line_method := \@@STPCmethod ; % only charts
\stopMPdrawing}
\def\initializeSTPT
- {\freezedimenmacro\@@STPToffset
+ {\freezedimenmacro\@@STPToffset
\startMPdrawing
line_h_offset := \@@STPToffset ;
- line_method := \@@STPTmethod ; % only charts
+ line_method := \@@STPTmethod ; % only charts
\stopMPdrawing}
\def\initializeSTET
@@ -111,7 +114,7 @@
\def\initializeSTEL
{\freezedimenmacro\@@STELrulethickness}
-%D ...
+%D ...
\defineXMLdirective [stepchart] [charts] \setupSTEPcharts
\defineXMLdirective [stepchart] [cells] \setupSTEPcells
@@ -123,7 +126,7 @@
\defineXMLdirective [steptable] [texts] \setupSTEPtexts
\defineXMLdirective [steptable] [lines] \setupSTEPlines
-%D ...
+%D ...
\presetlocalframed[\@@STPF]
@@ -149,8 +152,8 @@
%D \METAPOST. This method is the cleanest, but has the
%D disadvantage that one cannot embed hyperlinks or document
%D dependent definitions in the cells. The implementation
-%D roughly looks as follows:
-%D
+%D roughly looks as follows:
+%D
%D \starttyping
%D \def\startSTEPchart%
%D {\bgroup
@@ -194,15 +197,15 @@
%D
%D The second attempt was based on tabulations and used the
%D build in position tracking mechanism, which uses two
-%D position nodes per cell.
-%D
+%D position nodes per cell.
+%D
%D This method collects the content in token list registers
%D and build a table from them. In the collecting pass, the
%D graphics are build stepwise. We need to collect because the
%D order of definitions is not the same as the order of
%D typesetting. We show this alternative too because it
-%D demonstrates how to apply backgrounds to table cells.
-%D
+%D demonstrates how to apply backgrounds to table cells.
+%D
%D \starttyping
%D \newtoks\stepsonetop \newtoks\stepstwotop
%D \newtoks\stepsonebot \newtoks\stepstwobot
@@ -254,7 +257,7 @@
%D {\getMPdrawing}
%D \resetMPdrawing
%D \increment(\cellcounter,\cellcounter)\decrement\cellcounter
-%D \setbox2=\vbox
+%D \setbox2=\vbox
%D {\definetabulate[chart][|*{\cellcounter}{ck0|}] % k0 nills space
%D \startchart
%D \ifcase\somesteptwotop \the\stepstwotop \NC \NR \noalign{\kern2ex} \fi
@@ -352,30 +355,30 @@
%D \def\textcellposition#1{\GSC[#1:text]}
%D \def\stepidentifierposition#1{\GSC[#1:step]}
%D \stoptyping
-%D
-%D We abandoned this method after some testing and went for
-%D a third one. It was this third method that evolved into the
-%D current mechanism.
-%D
+%D
+%D We abandoned this method after some testing and went for
+%D a third one. It was this third method that evolved into the
+%D current mechanism.
+%D
%D Since this method was not that efficient, a third one was
-%D implemented, which used one position per cell. So,
+%D implemented, which used one position per cell. So,
%D
%D \blank {\bf Here starts the real implementation!} \blank
%D
%D Because we want to build one graphic only we need to store
%D the graphic directives. We also need to collect the cells,
-%D which are not defined in the order they show up. This
-%D solution uses multiple passes over the definitions. First
-%D the cells and texts are processed and the associated
-%D graphics are defined in the \METAPOST\ file. Next the
-%D lines are flushed. We need to do that in a second pass,
-%D because in order to determine the nature of the line,
+%D which are not defined in the order they show up. This
+%D solution uses multiple passes over the definitions. First
+%D the cells and texts are processed and the associated
+%D graphics are defined in the \METAPOST\ file. Next the
+%D lines are flushed. We need to do that in a second pass,
+%D because in order to determine the nature of the line,
%D \METAPOST\ needs to know if the start and end cells exist.
-%D This need comes from the fact that we store the shapes
-%D and lines kind of directly with their associated colors and
+%D This need comes from the fact that we store the shapes
+%D and lines kind of directly with their associated colors and
%D types, so that we can change the settings in between. So,
-%D changing for instance the line color, can take place
-%D locally.
+%D changing for instance the line color, can take place
+%D locally.
\newbox\stepboxone \newbox\stepboxtwo
\newbox\textboxone \newbox\textboxtwo
@@ -395,11 +398,11 @@
{\dosingleempty\dostartSTEPchart}
\long\def\dostartSTEPchart[#1]#2\stopSTEPchart
- {\ifinsidefloat
- \else
- \whitespace
- \@@STPCbefore
- \startbaselinecorrection
+ {\ifinsidefloat
+ \else
+ \whitespace
+ \@@STPCbefore
+ \startbaselinecorrection
\setlocalhsize
\noindent
\fi
@@ -457,7 +460,7 @@
\setbox2\vbox
{\offinterlineskip
\scratchdimen\@@STPCheight
- \advance\scratchdimen\@@STPCoffset
+ \advance\scratchdimen\@@STPCoffset
\advance\scratchdimen\@@STPCoffset
\ifcase\sometextboxone \box\textboxone \vskip\scratchdimen \fi
\ifcase\somestepboxone \box\stepboxone \vskip\@@STPCvoffset \fi
@@ -573,7 +576,7 @@
\def\dodoSTEPcharttextsA#1#2#3#4% #1=number #2=setup
{\dodoSTEPcharttextsAB{#1}{#2}{#3}{#4}\dodoSTEPcharttextsA
- \ifnum\textcounter>\cellcounter\relax
+ \ifnum\textcounter>\cellcounter\relax
\doglobal\decrement\textcounter\relax
\else
\setbox0\hbox{\doifsomething{#3}{\@@steptext{#3}}}%
@@ -585,7 +588,7 @@
\startMPdrawing
texts[t][#1][\textcounter] := nullpicture ;
\stopMPdrawing
- \else
+ \else
\global\chardef\sometextboxone\zerocount
\edef\stepidentifier{\stepchartprefix#1-\textcounter-t-t}%
\setbox0\hbox to \@@STPChoffset
@@ -627,7 +630,7 @@
\def\dodoSTEPcharttextsB#1#2#3#4% #1=number #2=setup
{\dodoSTEPcharttextsAB{#1}{#2}{#3}{#4}\dodoSTEPcharttextsB
- \ifnum\textcounter>\cellcounter\relax
+ \ifnum\textcounter>\cellcounter\relax
\doglobal\decrement\textcounter\relax
\else
\bgroup
@@ -653,36 +656,36 @@
\def\MPcharttoplinesgraphic#1#2%
{image(drawline(
- \@@STELalternative, get_step_chart_top_line(#1,#2),
+ \@@STELalternative, get_step_chart_top_line(#1,#2),
\@@STELrulethickness, \MPcolor{\@@STELcolor} ) )}
\def\MPchartbotlinesgraphic#1#2%
- {image(drawline(
- \@@STELalternative, get_step_chart_bot_line(#1,#2),
+ {image(drawline(
+ \@@STELalternative, get_step_chart_bot_line(#1,#2),
\@@STELrulethickness, \MPcolor{\@@STELcolor} ) )}
-%D \XML\ coupling.
+%D \XML\ coupling.
-\defineXMLpickup[stepchart][@@STPC]
+\defineXMLpickup[stepchart][@@STPC]
{\bgroup
\defineXMLpush[top]%
\defineXMLpush[bot]%
- \defineXMLenvironment[lines][@@STEL]
- {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
+ \defineXMLenvironment[lines][@@STEL]
+ {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
{\stoplines}%
- \defineXMLenvironment[cells][@@STEC]
+ \defineXMLenvironment[cells][@@STEC]
{\XMLerase{top}\XMLerase{bot}}
{\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{top}}{\XMLpop{bot}}}}%
- \defineXMLenvironment[texts][@@STET]
+ \defineXMLenvironment[texts][@@STET]
{\XMLerase{top}\XMLerase{bot}}
{\expanded{\texts[\theXMLarguments{@@STET}]{\XMLpop{top}}{\XMLpop{bot}}}}%
- \defineXMLenvironmentpush[cell][@@STEC]
+ \defineXMLenvironmentpush[cell][@@STEC]
{\XMLerase{cell}}
{\expanded{\cell [\theXMLarguments{@@STEC}]{\XMLpop{cell}}}}%
- \defineXMLenvironmentpush [text] [@@STET]
+ \defineXMLenvironmentpush [text] [@@STET]
{\XMLerase{text}}
{\expanded{\text [\theXMLarguments{@@STET}]{\XMLpop{text}}}}%
- \expanded{\startSTEPchart[\theXMLarguments{@@STPC}]}}
+ \expanded{\startSTEPchart[\theXMLarguments{@@STPC}]}}
{\stopSTEPchart
\egroup}
@@ -702,11 +705,11 @@
{\dodoubleempty\dostartSTEPaligntable[1]}
\def\dostartSTEPaligntable[#1][#2]#3\stopSTEPaligntable % flag settings data
- {\ifinsidefloat
- \else
- \whitespace
- \@@STPTbefore
- \startbaselinecorrection
+ {\ifinsidefloat
+ \else
+ \whitespace
+ \@@STPTbefore
+ \startbaselinecorrection
\setlocalhsize
\noindent
\fi
@@ -723,7 +726,7 @@
\initializeSTPT
\def\startlines{\bgroup\setupSTEPlines}%
\def\stoplines {\egroup}%
- \def\prep##1{\ignorespaces##1\unskip\enspace\ignorespaces}%
+ \def\prep##1{\ignorespaces##1\unskip\enspace\ignorespaces}%
\def\cell {\dosingleempty\docell}%
\def\cells {\dosingleempty\docells}%
\def\text {\dosingleempty\dotext}%
@@ -761,18 +764,18 @@
\stopMPdrawing
\egroup}
\doglobal\newcounter\cellcounter#3
- % second graphic pass pass, drawing lines
+ % second graphic pass pass, drawing lines
\def\docells[##1]##2##3##4%
{\doglobal\increment\cellcounter}
\def\dotext[##1]##2%
{\bgroup
\initializeSTEL
\startMPdrawing
- lines[\cellcounter] := \MPtablelinesgraphic ;
+ lines[\cellcounter] := \MPtablelinesgraphic ;
\stopMPdrawing
- \egroup}
+ \egroup}
\doglobal\newcounter\cellcounter#3
- % finishing graphic touch
+ % finishing graphic touch
\startMPdrawing
nofcells := \cellcounter ;
end_step_table ;
@@ -783,7 +786,7 @@
{\setbox0\null}
{\setbox0\vbox{\MPstaticgraphictrue\getMPdrawing}}%
\resetMPdrawing
- % typesetting pass
+ % typesetting pass
\dimen6=\@@STPTdistance \dimen6=2\dimen6
% cell width
\dimen8=\dimen1
@@ -801,8 +804,8 @@
{\hbox to \dimen####1{####2\@@stepfake{####3}\strut####4}}%
\setbox8\hbox
{\ifcase#1\else
- \do1\hss{##2}\relax \hskip\@@STPTdistance
- \do3\hss{##3}\hss \hskip\@@STPTdistance
+ \do1\hss{##2}\relax \hskip\@@STPTdistance
+ \do3\hss{##3}\hss \hskip\@@STPTdistance
\fi
\do5\relax{##4}\hss}%
\hpos{\steptableprefix\cellcounter-c}{\@@stepcell{\box8}}
@@ -815,11 +818,11 @@
\advance\hsize-\dimen8
\advance\hsize-\dimen6 % twice the offset
\setbox0\hbox{\@@steptext{##2}}%
-% to do
+% to do
% \ifdim\wd0>\hsize
% \setbox0=\vbox{\@@steptext{##2}}%
% \fi
-% align
+% align
\hpos{\steptableprefix\cellcounter-t}{\box0}%
\endgraf
\egroup
@@ -839,47 +842,47 @@
\ifinsidefloat \else \stopbaselinecorrection \@@STPTafter \fi}
\def\MPtablelinesgraphic
- {image ( drawline (
- \@@STELalternative, get_step_table_line(\cellcounter),
+ {image ( drawline (
+ \@@STELalternative, get_step_table_line(\cellcounter),
\@@STELrulethickness, \MPcolor{\@@STELcolor} ) )}
\defineXMLpickup[steptable][@@STPT]
{\bgroup
- \defineXMLenvironment[lines][@@STEL]
- {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
+ \defineXMLenvironment[lines][@@STEL]
+ {\expanded{\startlines[\theXMLarguments{@@STEL}]}}
{\stoplines}%
- \defineXMLargument[cell][@@STEC]
- {\expanded{\cell[\theXMLarguments{@@STEC}]}}%
+ \defineXMLargument[cell][@@STEC]
+ {\expanded{\cell[\theXMLarguments{@@STEC}]}}%
\defineXMLargument[text][@@STET]
- {\expanded{\text[\theXMLarguments{@@STET}]}}%
+ {\expanded{\text[\theXMLarguments{@@STET}]}}%
\defineXMLargument[prep]
{\prep}%
- \expanded{\startSTEPtable[\theXMLarguments{@@STPT}]}}
+ \expanded{\startSTEPtable[\theXMLarguments{@@STPT}]}}
{\stopSTEPtable
\egroup}
\defineXMLpickup[stepaligntable][@@STPT]
{\bgroup
- \defineXMLenvironment[lines][@@STEL]
- {\expanded{\setupSTEPlines[\theXMLarguments{@@STEL}]}}
+ \defineXMLenvironment[lines][@@STEL]
+ {\expanded{\setupSTEPlines[\theXMLarguments{@@STEL}]}}
{}%
\defineXMLpush[c1]\defineXMLpush[c2]\defineXMLpush[c3]%
\defineXMLenvironment[cells][@@STEC]
{\XMLerase{c1}\XMLerase{c1}\XMLerase{c3}}
{\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{c1}}{\XMLpop{c2}}{\XMLpop{c3}}}}%
\defineXMLargument[text][@@STET]
- {\expanded{\text[\theXMLarguments{@@STET}]}}%
+ {\expanded{\text[\theXMLarguments{@@STET}]}}%
\defineXMLargument[prep]
{\prep}%
- \expanded{\startSTEPaligntable[\theXMLarguments{@@STPT}]}}
+ \expanded{\startSTEPaligntable[\theXMLarguments{@@STPT}]}}
{\stopSTEPaligntable
\egroup}
\protect \endinput
-% A simple paragraph-flow test:
+% A simple paragraph-flow test:
-\starttext
+\starttext
\startbuffer
\startSTEPchart
@@ -892,10 +895,10 @@
\stopSTEPchart
\stopbuffer
-\getbuffer
+\getbuffer
\startnarrower \getbuffer \stopnarrower
\placefigure[left]{}{} \getbuffer
-\stoptext
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/m-streams.tex b/Master/texmf-dist/tex/context/base/m-streams.tex
new file mode 100644
index 00000000000..181c82d331c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/m-streams.tex
@@ -0,0 +1,439 @@
+%D \module
+%D [ file=m-streams,
+%D version=2006.03.21,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Streams,
+%D author=Hans Hagen,
+%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.
+
+%D First we implement a simple left||right synchronization
+%D mechanism, which we may perfect and extend over time.
+
+\unprotect
+
+\defineoutputstream [\v!left]
+\defineoutputstream [\v!right]
+
+\definemarknote[\v!left]
+\definemarknote[\v!right]
+
+\startsetups stream:\v!left:bottom
+ \flushmarknotes[\v!left]
+\stopsetups
+\startsetups stream:\v!right:bottom
+ \flushmarknotes[\v!right]
+\stopsetups
+\startsetups stream:\v!left:reset
+ \erasemarknotes[\v!left]
+\stopsetups
+\startsetups stream:\v!right:reset
+ \erasemarknotes[\v!right]
+\stopsetups
+
+\def\LeftNote {\setmarknote [\v!left]} % {#1}
+\def\RightNote {\setmarknote [\v!right]} % {#1}
+\def\SwitchToLeft {\enableoutputstream [\v!left]}
+\def\SwitchToRight {\enableoutputstream [\v!right]}
+\def\SwitchToNormal {\enableoutputstream [\s!default]}
+\def\SynchronizeLeftAndRight{\synchronizeoutputstreams[\v!left,\v!right]}
+\def\FlushLeftAndRight {\flushoutputstreampages [\v!left,\v!right]}
+
+\protect
+
+% \topskip \strutheight
+% \splittopskip\strutheight
+
+%D Example of usage:
+%D
+%D \starttyping
+%D \nopenalties \setupinterlinespace[top=height] \setupcolors[state=start]
+%D
+%D \showgrid \showstruts
+%D
+%D \starttext
+%D
+%D \title{Whatever} \page
+%D
+%D \dorecurse {5} {
+%D \let\RecurseLevel\recurselevel
+%D \SwitchToLeft \dorecurse{10}{\dontleavehmode{\tf\RecurseLevel:l \begstrut \input tufte \endstrut \endgraf}}
+%D \SwitchToRight \dorecurse{10}{\dontleavehmode{\sl\RecurseLevel:r \begstrut \input knuth \endstrut \endgraf}}
+%D \SwitchToNormal \SynchronizeLeftAndRight
+%D \SwitchToLeft \dorecurse{10}{\dontleavehmode{\bf\RecurseLevel:l \begstrut \input zapf \endstrut \endgraf}}
+%D \SwitchToRight \dorecurse{10}{\dontleavehmode{\bs\RecurseLevel:r \begstrut \input davis \endstrut \endgraf}}
+%D \SwitchToNormal \SynchronizeLeftAndRight
+%D }
+%D \stoptext
+%D \stoptyping
+%D
+%D Another example:
+%D
+%D \starttyping
+%D \nopenalties \setupinterlinespace[top=height] \setupcolors[state=start]
+%D
+%D \showgrid \showstruts
+%D
+%D \starttext
+%D
+%D \SwitchToNormal \FlushLeftAndRight \page
+%D
+%D \def\StartCouple{\page\SwitchToNormal}
+%D \def\StopCouple {\SwitchToNormal \SynchronizeLeftAndRight \FlushLeftAndRight}
+%D
+%D \def\Original {\SwitchToNormal\SynchronizeLeftAndRight\SwitchToLeft}
+%D \def\Translation{\SwitchToRight}
+%D
+%D \StartCouple
+%D \dorecurse{10} {
+%D \Original o: \begstrut \inright{\blackrule}\input tufte \endstrut \LeftNote {tufte} \endgraf
+%D \Translation t: \begstrut \inleft {\blackrule}\input zapf \endstrut \RightNote{zapf} \endgraf
+%D \Original o: \begstrut \inright{\blackrule}\input knuth \endstrut \LeftNote {knuth} \endgraf
+%D \Translation t: \begstrut \inleft {\blackrule}\input davis \endstrut \RightNote{davis} \endgraf
+%D \Original o: \begstrut \inright{\blackrule}\input douglas \endstrut \LeftNote {douglas} \endgraf
+%D \Translation t: \begstrut \inleft {\blackrule}\input bryson \endstrut \RightNote{bryson} \endgraf
+%D }
+%D \StopCouple
+%D \stoptext
+%D \stoptyping
+
+%D Next we implement stream layers.
+
+\unprotect
+
+\startsetups streamlayer:default:settings
+ % set hsize etc
+\stopsetups
+
+\startsetups streamlayer:default:extras
+ % flush goodies, like local floats
+\stopsetups
+
+\startsetups streamlayer:default:place
+ \setlayer
+ [\currentstreamlayer]
+ [\c!preset=\v!left\v!top]
+ {\outputstreambox[\currentstreamlayer]}%
+\stopsetups
+
+\startsetups streamlayer:default:copy
+ \setlayer
+ [\currentstreamlayer]
+ [\c!preset=\v!left\v!top]
+ {\outputstreamcopy[\currentstreamlayer]}%
+\stopsetups
+
+
+\startsetups streamlayer:default:reset
+ \outputstreambox[\currentstreamlayer]
+\stopsetups
+
+\startsetups streamlayer:default:flush
+ \tightlayer[\currentstreamlayer]
+\stopsetups
+
+\def\definestreamlayer
+ {\dodoubleempty\dodefinestreamlayer}
+
+\def\dodefinestreamlayer[#1][#2]%
+ {\defineoutputstream[#1]%
+ \defineoutputstream[main]%
+ \definelayer[#1][\c!method=\v!fit,\c!width=\textwidth,#2]}
+
+\def\dostreamsetups#1%
+ {\doifsetupselse{streamlayer:\currentstreamlayer:#1}
+ {\directsetup{streamlayer:\currentstreamlayer:#1}}
+ {\directsetup{streamlayer:\s!default:#1}}}
+
+\def\startstreamlayer[#1]%
+ {\bgroup
+% \def\startstreamlayer[##1]{\bgroup\let\stopstreamlayer\egroup}%
+ \edef\currentstreamlayer{#1}%
+ \enableoutputstream[main]%
+ \synchronizeoutput
+ \enableoutputstream[\currentstreamlayer]%
+ \bgroup
+ \dostreamsetups{settings}}
+
+\def\stopstreamlayer
+ {\endgraf
+ \egroup
+ \disableoutputstream % \enableoutputstream[\s!default]%
+ \outputstreambox[main]%
+% \dostreamsetups{place}%
+% \dostreamsetups{extras}%
+% \dostreamsetups{flush}%
+ \egroup}
+
+\def\preparestreamlayer{\dosingleempty\dopreparestreamlayer}
+\def\flushstreamlayer {\dosingleempty\doflushstreamlayer }
+\def\placestreamlayer {\dosingleempty\doplacestreamlayer }
+
+\def\dopreparestreamlayer[#1]%
+ {\bgroup
+ \edef\currentstreamlayer{\iffirstargument#1\else\currentstreamlayer\fi}%
+ \dostreamsetups{place}%
+ \dostreamsetups{extras}%
+% \dostreamsetups{flush}%
+ \egroup}
+
+\def\doflushstreamlayer[#1]%
+ {\bgroup
+ \edef\currentstreamlayer{\iffirstargument#1\else\currentstreamlayer\fi}%
+ \dostreamsetups{flush}%
+ \egroup}
+
+\def\doplacestreamlayer[#1]%
+ {\preparestreamlayer[#1]%
+ \flushstreamlayer[#1]}
+
+\protect
+
+%D Usage:
+
+%D \starttyping
+%D \setupinterlinespace[top=height]
+%D
+%D \setupcolors[state=start]
+%D
+%D \definestreamlayer[block]
+%D
+%D \definemeasure[localtextwidth] [\dimexpr.7\textwidth\relax]
+%D \definemeasure[localfloatwidth][\dimexpr.3\textwidth-2\bodyfontsize\relax]
+%D
+%D \startsetups streamlayer:block:settings
+%D \hsize=\measure{localtextwidth}
+%D \setupfloat[figure][maxwidth=\measure{localfloatwidth}]
+%D \stopsetups
+%D
+%D \startsetups streamlayer:block:extras
+%D \setuplocalfloats
+%D [before=\blank,
+%D after=\blank,
+%D inbetween=\blank]
+%D \setbox\scratchbox\vbox{\hsize\measure{localfloatwidth}\getlocalfloats}
+%D \ifdim\ht\scratchbox>\thelayerheight\currentstreamlayer\relax
+%D % more float than text
+%D \setlayerframed
+%D [\currentstreamlayer]
+%D [preset=righttop]
+%D [frame=off,
+%D offset=overlay]
+%D {\box\scratchbox}
+%D \else
+%D % more text than float
+%D \setuplocalfloats
+%D [before=\vfill,
+%D after=\removedepth\vfill,
+%D inbetween=\removedepth\vfill]
+%D \setlayerframed
+%D [\currentstreamlayer]
+%D [preset=righttop]
+%D [frame=off,
+%D offset=overlay]
+%D {\vbox to \thelayerheight\currentstreamlayer {\hsize\measure{localfloatwidth}\getlocalfloats}}
+%D \fi
+%D \resetlocalfloats
+%D \stopsetups
+%D
+%D \startsetups streamlayer:block:place
+%D \setlayerframed
+%D [\currentstreamlayer]
+%D [preset=lefttop]
+%D [frame=off,
+%D offset=overlay]
+%D {\outputstreambox[\currentstreamlayer]}%
+%D \stopsetups
+%D
+%D \startsetups streamlayer:block:flush
+%D \framed
+%D [offset=overlay,
+%D frame=off,
+%D background=color,
+%D backgroundcolor=red]
+%D {\tightlayer[\currentstreamlayer]}
+%D \stopsetups
+%D
+%D \setupbodyfont[small]
+%D
+%D \starttext
+%D
+%D \dorecurse {10} {
+%D \startstreamlayer[block]
+%D \title{Sample \recurselevel}
+%D \input tufte \endgraf
+%D \placefigure[local]{}{}
+%D \placefigure[local]{}{}
+%D \ifodd\recurselevel\relax \placefigure[local]{}{} \fi
+%D \startitemize[columns]
+%D \item xxx
+%D \item xxx
+%D \item xxx
+%D \item xxx
+%D \item xxx
+%D \stopitemize
+%D \stopstreamlayer
+%D \placestreamlayer[block]
+%D }
+%D
+%D \dorecurse {10} {
+%D \startstreamlayer[block]
+%D \title{Sample \recurselevel}
+%D \startcolumns
+%D \input tufte
+%D \stopcolumns
+%D \stopstreamlayer
+%D \placestreamlayer[block]
+%D }
+%D
+%D \stoptext
+%D \stoptyping
+
+\def\starttextstreamlayer
+ {\startstreamlayer}
+
+\def\stoptextstreamlayer
+ {\endgraf
+ % maybe depth if no proper depth and no skip
+ \removelastskip
+ \stopstreamlayer}
+
+\def\placetextstreamlayer{\placestreamlayer}
+
+%D \starttyping
+%D \definestreamlayer[whatever][width=12cm]
+%D
+%D \startstreamlayer[whatever]
+%D \startitemize[columns,two][after=]
+%D \item one
+%D \item two
+%D \item three
+%D \item four
+%D \stopitemize
+%D \stopstreamlayer
+%D
+%D \framed[strut=no,align=normal]{\placestreamlayer[whatever]\obeydepth}
+%D
+%D \starttextstreamlayer[whatever]
+%D \startitemize[columns,two]
+%D \item one
+%D \item two
+%D \item three
+%D \item four
+%D \stopitemize
+%D \stoptextstreamlayer
+%D
+%D \framed[strut=no]{\placetextstreamlayer[whatever]}
+%D \stoptyping
+
+\endinput
+
+\setupinterlinespace[top=height]
+
+\setupcolors[state=start]
+
+\definestreamlayer[block]
+
+\definemeasure[localtextwidth] [\dimexpr.7\textwidth\relax]
+\definemeasure[localfloatwidth][\dimexpr.3\textwidth-2\bodyfontsize\relax]
+
+\startsetups streamlayer:block:settings
+ \hsize=\measure{localtextwidth}
+ \setupfloat[figure][maxwidth=\measure{localfloatwidth}]
+\stopsetups
+
+\startsetups streamlayer:block:extras
+ \setuplocalfloats
+ [before=\whitespace\blank,
+ after=\whitespace\blank,
+ inbetween=\whitespace\blank]
+ \setbox\scratchbox\vbox{\hsize\measure{localfloatwidth}\getlocalfloats}
+ \ifdim\ht\scratchbox>\thelayerheight\currentstreamlayer\relax
+ % more float than text
+ \setlayerframed
+ [\currentstreamlayer]
+ [preset=righttop]
+ [frame=off,
+ offset=overlay]
+ {\box\scratchbox}
+ \else
+ % more text than float
+ \setuplocalfloats
+ [before=\vfill,
+ after=\removedepth\vfill,
+ inbetween=\removedepth\vfill]
+ \setlayerframed
+ [\currentstreamlayer]
+ [preset=righttop]
+ [frame=off,
+ offset=overlay]
+ {\vbox to \thelayerheight\currentstreamlayer {\hsize\measure{localfloatwidth}\getlocalfloats}}
+ \fi
+ \resetlocalfloats
+\stopsetups
+
+\startsetups streamlayer:block:place
+ \setlayerframed
+ [\currentstreamlayer]
+ [preset=lefttop]
+ [frame=off,
+ offset=overlay]
+ {\outputstreambox[\currentstreamlayer]}%
+\stopsetups
+
+\startsetups streamlayer:block:flush
+ \framed
+ [offset=overlay,
+ frame=off,
+ background=color,
+ backgroundcolor=red]
+ {\tightlayer[\currentstreamlayer]}
+\stopsetups
+
+\setupbodyfont[small]
+
+\starttext
+
+% \definestreamlayer[block]
+%
+% \startstreamlayer[block]
+% \title{Sample \recurselevel}
+% \startcolumns
+% \dorecurse{4}{\input tufte \par}
+% \stopcolumns
+% \stopstreamlayer
+% \placestreamlayer[block]
+
+\dorecurse {10} {
+ \startstreamlayer[block]
+ \title{Sample \recurselevel}
+ \input tufte \endgraf
+ \placefigure[local]{}{}
+ \placefigure[local]{}{}
+ \ifodd\recurselevel\relax \placefigure[local]{}{} \fi
+ \startitemize[columns]
+ \item xxx
+ \item xxx
+ \item xxx
+ \item xxx
+ \item xxx
+ \stopitemize
+ \stopstreamlayer
+ \placestreamlayer[block]
+}
+
+\dorecurse {10} {
+ \startstreamlayer[block]
+ \title{Sample \recurselevel}
+ \startcolumns
+ \input tufte
+ \stopcolumns
+ \stopstreamlayer
+ \placestreamlayer[block]
+}
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/m-subsub.tex b/Master/texmf-dist/tex/context/base/m-subsub.tex
index 3a29bc69f09..3fc71cd505d 100644
--- a/Master/texmf-dist/tex/context/base/m-subsub.tex
+++ b/Master/texmf-dist/tex/context/base/m-subsub.tex
@@ -59,35 +59,35 @@ subsubsubsubsubsubsubsubsubsubject: subsubsubsubsubsubsubsubsubonderwerp
\stopvariables
-\definesection[\v!sectionlevel-8]
-\definesection[\v!sectionlevel-9]
-\definesection[\v!sectionlevel-10]
-\definesection[\v!sectionlevel-11]
-\definesection[\v!sectionlevel-12]
+\definesection[\s!section-8]
+\definesection[\s!section-9]
+\definesection[\s!section-10]
+\definesection[\s!section-11]
+\definesection[\s!section-12]
\definehead
[\v!subsubsubsubsubsection]
- [\c!section=\v!sectionlevel-8,
+ [\c!section=\s!section-8,
\c!default=\v!subsubsubsubsection]
\definehead
[\v!subsubsubsubsubsubsection]
- [\c!section=\v!sectionlevel-9,
+ [\c!section=\s!section-9,
\c!default=\v!subsubsubsubsubsection]
\definehead
[\v!subsubsubsubsubsubsubsection]
- [\c!section=\v!sectionlevel-10,
+ [\c!section=\s!section-10,
\c!default=\v!subsubsubsubsubsubsection]
\definehead
[\v!subsubsubsubsubsubsubsubsection]
- [\c!section=\v!sectionlevel-11,
+ [\c!section=\s!section-11,
\c!default=\v!subsubsubsubsubsubsubsection]
\definehead
[\v!subsubsubsubsubsubsubsubsubsection]
- [\c!section=\v!sectionlevel-12,
+ [\c!section=\s!section-12,
\c!default=\v!subsubsubsubsubsubsubsubsection]
\definehead
diff --git a/Master/texmf-dist/tex/context/base/m-tryout.tex b/Master/texmf-dist/tex/context/base/m-tryout.tex
index ef6c502ba07..89ffc46782b 100644
--- a/Master/texmf-dist/tex/context/base/m-tryout.tex
+++ b/Master/texmf-dist/tex/context/base/m-tryout.tex
@@ -24,6 +24,10 @@
\startmode[activecolon]
+\endinput
+
+% this is now default
+
\gdef\sectionseparator{-}
\gdef\@@filterfirstpart [#1--#2]{#1}
diff --git a/Master/texmf-dist/tex/context/base/m-units.tex b/Master/texmf-dist/tex/context/base/m-units.tex
index 35f870bbf62..50b1a48997e 100644
--- a/Master/texmf-dist/tex/context/base/m-units.tex
+++ b/Master/texmf-dist/tex/context/base/m-units.tex
@@ -59,6 +59,11 @@
1: folositi \string\Degrees\space\string\Celsius\space in locul \string\Celsius !
\stopmessages
+\startmessages french library: units
+ title: unités
+ 1: utilisez \string\Degrees\space\string\Celsius\space à la place de \string\Celsius !
+\stopmessages
+
\unprotect
%D This runtime loadable module implements a way of defining
@@ -185,9 +190,9 @@
\def\dodimensionpower#1%
{\iftextdimensions\expandafter\high\else\expandafter^\fi{#1}}
-\def\ustartmathmode {\iftextdimensions\else\startmathmode \fi}
-\def\ustopmathmode {\iftextdimensions\else\stopmathmode \fi}
-\def\umathematicstypeface{\iftextdimensions\else\mathematicstypeface\fi}
+\def\ustartmathmode {\iftextdimensions\else\expandafter\startmathmode \fi}
+\def\ustopmathmode {\iftextdimensions\else\expandafter\stopmathmode \fi}
+\def\umathematicstypeface{\iftextdimensions\else\expandafter\mathematicstypeface\fi}
%D In forced text mode, we ignore spacing in monospaced fonts.
@@ -197,8 +202,8 @@
\def\dodimensionspace
{\iftextdimensions
\begingroup
- \setbox0=\hbox{i}%
- \setbox2=\hbox{m}%
+ \setbox0\hbox{i}%
+ \setbox2\hbox{m}%
\ifdim\wd0=\wd2
\endgroup
\@EAEAEA\gobbleoneargument
@@ -217,7 +222,7 @@
\let\dimensionsuffix\dimension
\let\dimensionpower \dimension
\global\nesteddimensionfalse
- \setbox0=\hbox{\ustartmathmode#1\ustopmathmode}%
+ \setbox\scratchbox\hbox{\ustartmathmode#1\ustopmathmode}% pre-roll
\global\let\thedimensionprefix\savedthedimensionprefix
\global\let\thedimensionpower \savedthedimensionpower
\endgroup
@@ -233,8 +238,13 @@
\ustartmathmode\dimensiontypeface
\else
\ustartmathmode\dimensiontypeface
- \ifdim\scratchdimen=\dimensionsignal\relax
- \ifspaceddimensions\udimensionhalfspace\fi
+ \ifspaceddimensions
+ \ifdim\scratchdimen=\dimensionsignal\relax
+ \udimensionhalfspace
+\else\ifdim\scratchdimen=\dimensionpowersignal\relax
+ \udimensionhalfspace
+\fi
+ \fi
\fi
\fi
\umathematicstypeface\thedimensionprefix#1%
@@ -263,6 +273,7 @@
\global\let\thedimensionprefix\empty
\global\let\thedimensionpower\empty}
+
%D \macros
%D {dontbreakdimension,
%D dimensionprefix, dimensionaddfix,
@@ -271,8 +282,8 @@
%D
%D Here are some auxilliary macros.
-\def\dontbreakdimension%
- {\scratchdimen=\lastskip
+\def\dontbreakdimension
+ {\scratchdimen\lastskip
\unskip
\nobreak
\hskip\scratchdimen
@@ -641,7 +652,7 @@
\setuplabeltext
[\s!en]
[u:vac=alternating current,
- u:vdc=different current]
+ u:vdc=direct current]
\setuplabeltext
[\s!de]
diff --git a/Master/texmf-dist/tex/context/base/m-visual.tex b/Master/texmf-dist/tex/context/base/m-visual.tex
index 8e992b8557e..5ff273f5c3a 100644
--- a/Master/texmf-dist/tex/context/base/m-visual.tex
+++ b/Master/texmf-dist/tex/context/base/m-visual.tex
@@ -17,6 +17,27 @@
%D needed them for manuals and styles. The macros are documented
%D in a my way document.
+%D For Mojca:
+%D
+%D \starttyping
+%D \def\simplethesis
+%D {\setupsystem[random=1234]
+%D \title{\fakewords{3}{4}}
+%D \placelist[chapter,section]
+%D \dorecurse{6}
+%D {\chapter{\fakewords{5}{10}}
+%D \dorecurse{5}
+%D {\section{\fakewords{2}{5}}
+%D \dorecurse{2}
+%D {\dorecurse{3}{\fakewords{100}{200}\endgraf}
+%D \placefigure{\fakewords{8}{15}}{\fakefigure{5cm}{3cm}{10cm}{5cm}}
+%D \dorecurse{2}{\fakewords{100}{200}\endgraf}}}}}
+%D
+%D \starttext
+%D \simplethesis
+%D \stoptext
+%D \stoptyping
+
\definecolor[fakerulecolor] [black]
\definecolor[fakebaselinecolor] [green]
\definecolor[fakeparindentcolor][blue]
diff --git a/Master/texmf-dist/tex/context/base/math-cow.tex b/Master/texmf-dist/tex/context/base/math-cow.tex
new file mode 100644
index 00000000000..016221f2da2
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/math-cow.tex
@@ -0,0 +1,30 @@
+%D \module
+%D [ file=math-cow,
+%D version=2006.06.23,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Cow Math,
+%D author={Hans Hagen \& Taco Hoekwater},
+%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
+
+\let\COWsqrt\mthsqrt
+\let\COWfrac\mthfrac
+
+\startmathcollection [cow]
+ % todo
+\stopmathcollection
+
+\startrawmathcollection[cow]
+ \definemathcommand [frac] {\COWfrac}
+ \definemathcommand [sqrt] {\COWsqrt}
+ %definemathcommand [r@@t] {\COWroot}
+ %definemathcommand [matrix] {\COWmatrix}
+\stoprawmathcollection
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/math-eul.tex b/Master/texmf-dist/tex/context/base/math-eul.tex
index 230f7ae119e..6acc33356ca 100644
--- a/Master/texmf-dist/tex/context/base/math-eul.tex
+++ b/Master/texmf-dist/tex/context/base/math-eul.tex
@@ -89,59 +89,59 @@
\startmathcollection [eul]
% Ugh. no way around this to keep it compact in the font defs.
-\definemathcharacter [a] [nothing] [mr] ["61]
-\definemathcharacter [b] [nothing] [mr] ["62]
-\definemathcharacter [c] [nothing] [mr] ["63]
-\definemathcharacter [d] [nothing] [mr] ["64]
-\definemathcharacter [e] [nothing] [mr] ["65]
-\definemathcharacter [f] [nothing] [mr] ["66]
-\definemathcharacter [g] [nothing] [mr] ["67]
-\definemathcharacter [h] [nothing] [mr] ["68]
-\definemathcharacter [i] [nothing] [mr] ["69]
-\definemathcharacter [j] [nothing] [mr] ["6A]
-\definemathcharacter [k] [nothing] [mr] ["6B]
-\definemathcharacter [l] [nothing] [mr] ["6C]
-\definemathcharacter [m] [nothing] [mr] ["6D]
-\definemathcharacter [n] [nothing] [mr] ["6E]
-\definemathcharacter [o] [nothing] [mr] ["6F]
-\definemathcharacter [p] [nothing] [mr] ["70]
-\definemathcharacter [q] [nothing] [mr] ["71]
-\definemathcharacter [r] [nothing] [mr] ["72]
-\definemathcharacter [s] [nothing] [mr] ["73]
-\definemathcharacter [t] [nothing] [mr] ["74]
-\definemathcharacter [u] [nothing] [mr] ["75]
-\definemathcharacter [v] [nothing] [mr] ["76]
-\definemathcharacter [w] [nothing] [mr] ["77]
-\definemathcharacter [x] [nothing] [mr] ["78]
-\definemathcharacter [y] [nothing] [mr] ["79]
-\definemathcharacter [z] [nothing] [mr] ["7A]
-
-\definemathcharacter [A] [nothing] [mr] ["41]
-\definemathcharacter [B] [nothing] [mr] ["42]
-\definemathcharacter [C] [nothing] [mr] ["43]
-\definemathcharacter [D] [nothing] [mr] ["45]
-\definemathcharacter [E] [nothing] [mr] ["45]
-\definemathcharacter [F] [nothing] [mr] ["46]
-\definemathcharacter [G] [nothing] [mr] ["47]
-\definemathcharacter [H] [nothing] [mr] ["48]
-\definemathcharacter [I] [nothing] [mr] ["49]
-\definemathcharacter [J] [nothing] [mr] ["4A]
-\definemathcharacter [K] [nothing] [mr] ["4B]
-\definemathcharacter [L] [nothing] [mr] ["4C]
-\definemathcharacter [M] [nothing] [mr] ["4D]
-\definemathcharacter [N] [nothing] [mr] ["4E]
-\definemathcharacter [O] [nothing] [mr] ["4F]
-\definemathcharacter [P] [nothing] [mr] ["50]
-\definemathcharacter [Q] [nothing] [mr] ["51]
-\definemathcharacter [R] [nothing] [mr] ["52]
-\definemathcharacter [S] [nothing] [mr] ["53]
-\definemathcharacter [T] [nothing] [mr] ["54]
-\definemathcharacter [U] [nothing] [mr] ["55]
-\definemathcharacter [V] [nothing] [mr] ["56]
-\definemathcharacter [W] [nothing] [mr] ["57]
-\definemathcharacter [X] [nothing] [mr] ["58]
-\definemathcharacter [Y] [nothing] [mr] ["59]
-\definemathcharacter [Z] [nothing] [mr] ["5A]
+\definemathcharacter [a] [alpha] [mr] ["61]
+\definemathcharacter [b] [alpha] [mr] ["62]
+\definemathcharacter [c] [alpha] [mr] ["63]
+\definemathcharacter [d] [alpha] [mr] ["64]
+\definemathcharacter [e] [alpha] [mr] ["65]
+\definemathcharacter [f] [alpha] [mr] ["66]
+\definemathcharacter [g] [alpha] [mr] ["67]
+\definemathcharacter [h] [alpha] [mr] ["68]
+\definemathcharacter [i] [alpha] [mr] ["69]
+\definemathcharacter [j] [alpha] [mr] ["6A]
+\definemathcharacter [k] [alpha] [mr] ["6B]
+\definemathcharacter [l] [alpha] [mr] ["6C]
+\definemathcharacter [m] [alpha] [mr] ["6D]
+\definemathcharacter [n] [alpha] [mr] ["6E]
+\definemathcharacter [o] [alpha] [mr] ["6F]
+\definemathcharacter [p] [alpha] [mr] ["70]
+\definemathcharacter [q] [alpha] [mr] ["71]
+\definemathcharacter [r] [alpha] [mr] ["72]
+\definemathcharacter [s] [alpha] [mr] ["73]
+\definemathcharacter [t] [alpha] [mr] ["74]
+\definemathcharacter [u] [alpha] [mr] ["75]
+\definemathcharacter [v] [alpha] [mr] ["76]
+\definemathcharacter [w] [alpha] [mr] ["77]
+\definemathcharacter [x] [alpha] [mr] ["78]
+\definemathcharacter [y] [alpha] [mr] ["79]
+\definemathcharacter [z] [alpha] [mr] ["7A]
+
+\definemathcharacter [A] [alpha] [mr] ["41]
+\definemathcharacter [B] [alpha] [mr] ["42]
+\definemathcharacter [C] [alpha] [mr] ["43]
+\definemathcharacter [D] [alpha] [mr] ["44]
+\definemathcharacter [E] [alpha] [mr] ["45]
+\definemathcharacter [F] [alpha] [mr] ["46]
+\definemathcharacter [G] [alpha] [mr] ["47]
+\definemathcharacter [H] [alpha] [mr] ["48]
+\definemathcharacter [I] [alpha] [mr] ["49]
+\definemathcharacter [J] [alpha] [mr] ["4A]
+\definemathcharacter [K] [alpha] [mr] ["4B]
+\definemathcharacter [L] [alpha] [mr] ["4C]
+\definemathcharacter [M] [alpha] [mr] ["4D]
+\definemathcharacter [N] [alpha] [mr] ["4E]
+\definemathcharacter [O] [alpha] [mr] ["4F]
+\definemathcharacter [P] [alpha] [mr] ["50]
+\definemathcharacter [Q] [alpha] [mr] ["51]
+\definemathcharacter [R] [alpha] [mr] ["52]
+\definemathcharacter [S] [alpha] [mr] ["53]
+\definemathcharacter [T] [alpha] [mr] ["54]
+\definemathcharacter [U] [alpha] [mr] ["55]
+\definemathcharacter [V] [alpha] [mr] ["56]
+\definemathcharacter [W] [alpha] [mr] ["57]
+\definemathcharacter [X] [alpha] [mr] ["58]
+\definemathcharacter [Y] [alpha] [mr] ["59]
+\definemathcharacter [Z] [alpha] [mr] ["5A]
\stopmathcollection
diff --git a/Master/texmf-dist/tex/context/base/math-ext.tex b/Master/texmf-dist/tex/context/base/math-ext.tex
new file mode 100644
index 00000000000..9f74ce4a9d9
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/math-ext.tex
@@ -0,0 +1,229 @@
+%D \module
+%D [ file=math-ext,
+%D version=2006.01.14,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Extra Macros,
+%D author={Hans Hagen \& Taco Hoekwater \& Aditya Mahajan},
+%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
+
+%D These will be generalized!
+
+\def\exmthfont#1{\symbolicsizedfont#1\plusone{MathExtension}}
+
+\def\domthfrac#1#2#3#4#5#6#7%
+ {\begingroup
+ \mathsurround\zeropoint
+ \setbox0\hbox{$#1 #6$}%
+ \setbox2\hbox{$#1 #7$}%
+ \dimen0\wd0
+ \ifdim\wd2>\dimen0 \dimen0\wd2 \fi
+ \setbox4\hbox to \dimen0{\exmthfont#2#3\leaders\hbox{#4}\hss#5}%
+ \mathord{\vcenter{{\offinterlineskip
+ \hbox to \dimen0{\hss\box0\hss}%
+ \kern \ht4%
+ \hbox to \dimen0{\hss\copy4\hss}%
+ \kern \ht4%
+ \hbox to \dimen0{\hss\box2\hss}}}}%
+ \endgroup}
+
+\def\domthsqrt#1#2#3#4#5%
+ {\begingroup
+ \mathsurround\zeropoint
+ \setbox0\hbox{$#1 #5$}%
+ \dimen0=1.05\ht0 \advance\dimen0 1pt \ht0 \dimen0
+ \dimen0=1.05\dp0 \advance\dimen0 1pt \dp0 \dimen0
+ \dimen0\wd0
+ \setbox4\hbox to \dimen0{\exmthfont#2\leaders\hbox{#3}\hfill#4}%
+ \delimitershortfall=0pt
+ \nulldelimiterspace=0pt
+ \setbox2\hbox{$\left\delimiter"0270370 \vrule height\ht0 depth \dp0 width0pt
+ \right.$}%
+ \mathord{\vcenter{\hbox{\copy2
+ \rlap{\raise\dimexpr\ht2-\ht4\relax\copy4}\copy0}}}%
+ \endgroup}
+
+\def\mthfrac#1#2#3#4#5{\mathchoice
+ {\domthfrac\displaystyle \textface {#1}{#2}{#3}{#4}{#5}}
+ {\domthfrac\textstyle \textface {#1}{#2}{#3}{#4}{#5}}
+ {\domthfrac\scriptstyle \scriptface {#1}{#2}{#3}{#4}{#5}}
+ {\domthfrac\scriptscriptstyle\scriptscriptface{#1}{#2}{#3}{#4}{#5}}}
+
+\def\mthsqrt#1#2#3{\mathchoice
+ {\domthsqrt\displaystyle \textface {#1}{#2}{#3}}
+ {\domthsqrt\textstyle \textface {#1}{#2}{#3}}
+ {\domthsqrt\scriptstyle \textface {#1}{#2}{#3}}
+ {\domthsqrt\scriptscriptstyle\textface {#1}{#2}{#3}}}
+
+% temp here
+
+\def\mtharrfactor{1}
+\def\mtharrextra {0}
+
+\def\domthxarr#1#2#3#4#5% hm, looks like we do a double mathrel
+ {\begingroup
+ \def\mtharrfactor{1}%
+ \def\mtharrextra {0}%
+ \processaction[#1] % will be sped up
+ [ \v!none=>\def\mtharrfactor{0},
+ \v!small=>\def\mtharrextra{10},
+ \v!medium=>\def\mtharrextra{15},
+ \v!big=>\def\mtharrextra{20},
+ \v!normal=>,
+ \v!default=>,
+ \v!unknown=>\doifnumberelse{#1}{\def\mtharrextra{#1}}\donothing]%
+ \mathsurround\zeropoint
+ \muskip0=\thirdoffourarguments #2mu
+ \muskip2=\fourthoffourarguments #2mu
+ \muskip4=\firstoffourarguments #2mu
+ \muskip6=\secondoffourarguments #2mu
+ \muskip0=\mtharrfactor\muskip0 \advance\muskip0 \mtharrextra mu
+ \muskip2=\mtharrfactor\muskip2 \advance\muskip2 \mtharrextra mu
+ \setbox0\hbox{$\scriptstyle
+ \mkern\muskip4\relax
+ \mkern\muskip0\relax
+ #5\relax
+ \mkern\muskip2\relax
+ \mkern\muskip6\relax
+ $}%
+ \setbox4\hbox{#3}%
+ \dimen0\wd0
+ \ifdim\wd4>\dimen0 \dimen0\wd4 \fi
+ \setbox2\hbox{$\scriptstyle
+ \mkern\muskip4\relax
+ \mkern\muskip0\relax
+ #4\relax
+ \mkern\muskip2\relax
+ \mkern\muskip6\relax
+ $}%
+ \ifdim\wd2>\dimen0 \dimen0\wd2 \fi
+ \setbox4\hbox to \dimen0{#3}%
+ \mathrel{\mathop{\hbox to \dimen0{\hss\copy4\hss}}\limits^{\box0}_{\box2}}
+ \endgroup}
+
+\let\domthxarrsingle\domthxarr
+
+\def\domthxarrdouble#1#2#3#4#5#6#7% opt l r sp rs top bot
+ {\mathrel
+ {\scratchdimen.22ex\relax
+ \setbox0\hbox{$\domthxarr{#1}{#2}{#4}{\phantom{#6}}{#7}$}%
+ \setbox2\hbox{$\domthxarr{#1}{#3}{#5}{#6}{\phantom{#7}}$}%
+ \raise\scratchdimen\box0
+ \kern-\wd2
+ \lower\scratchdimen\box2}}
+
+\def\definematharrow
+ {\doquadrupleargument\dodefinematharrow}
+
+\def\dodefinematharrow[#1][#2][#3][#4]% name type[none|both] template command
+ {\iffourthargument
+ \executeifdefined{dodefine#2arrow}\gobblethreearguments{#1}{#3}{#4}%
+ \else\ifthirdargument
+ \dodefinebotharrow{#1}{#2}{#3}%
+ \else\ifsecondargument
+ \redefinebotharrow{#1}{#2}{#3}%
+ \fi\fi\fi}
+
+\def\redefinebotharrow#1#2#3% real dirty, this overload!
+ {\doifdefined{#1}
+ {\pushmacro\dotripleempty
+ \def\dotripleempty##1[##2][##3]{\setvalue{#1}{\dotripleempty\xmtharrow[#2][##3]}}%
+ \getvalue{#1}%
+ \popmacro\dotripleempty}}
+
+\def\dodefinebotharrow#1#2#3%
+ {\setvalue{#1}{\dotripleempty\xmtharrow[#2][#3]}}
+
+\def\xmtharrow[#1][#2][#3]% #3 == optional arg
+ {\def\doxmtharrow{\dodoxmtharrow[#1,\empty,\empty][#2,\empty,\empty][#3]}% {##1}{##2}
+ \dodoublegroupempty\doxmtharrow}
+
+\def\dodoxmtharrow[#1,#2,#3][#4,#5,#6][#7]#8#9% [3] is the optional arg
+ {\edef\!!stringa{#2}%
+ \ifx\!!stringa\empty
+ \ifsecondargument
+ \mathrel{\domthxarrsingle{#7}{#1}{#4}{#8}{#9}}%
+ \else
+ \mathrel{\domthxarrsingle{#7}{#1}{#4}{}{#8}}%
+ \fi
+ \else
+ \ifsecondargument
+ \mathrel{\domthxarrdouble{#7}{#1}{#2}{#4}{#5}{#8}{#9}}%
+ \else
+ \mathrel{\domthxarrdouble{#7}{#1}{#2}{#4}{#5}{}{#8}}%
+ \fi
+ \fi}
+
+% Adapted from amsmath.
+
+\def\mtharrowfill#1#2#3#4#5#6#7%
+ {$\mathsurround 0pt
+ \thickmuskip0mu\medmuskip\thickmuskip\thinmuskip\thickmuskip
+ \relax#5%
+ \mkern-#1mu
+ \cleaders\hbox{$\mkern -#2mu#6\mkern -#3mu$}\hfill
+ \mkern-#4mu#7$}
+
+\def\defaultmtharrowfill{\mtharrowfill 7227}
+
+% Maybe redefine leftarrowfill and rightarrowfill using arrowfill
+
+\def\rightarrowfill {\defaultmtharrowfill \relbar \relbar \rightarrow }
+\def\leftarrowfill {\defaultmtharrowfill \leftarrow \relbar \relbar }
+\def\equalfill {\defaultmtharrowfill \Relbar \Relbar \Relbar }
+\def\Rightarrowfill {\defaultmtharrowfill \Relbar \Relbar \Rightarrow }
+\def\Leftarrowfill {\defaultmtharrowfill \Leftarrow \Relbar \Relbar }
+\def\Leftrightarrowfill {\defaultmtharrowfill \Leftarrow \Relbar \Rightarrow }
+\def\leftrightarrowfill {\defaultmtharrowfill \leftarrow \relbar \rightarrow }
+\def\mapstofill {\defaultmtharrowfill {\mapstochar\relbar} \relbar \rightarrow }
+\def\twoheadrightarrowfill{\defaultmtharrowfill \relbar \relbar \twoheadrightarrow}
+\def\twoheadleftarrowfill {\defaultmtharrowfill \twoheadleftarrow \relbar \relbar }
+\def\rightharpoondownfill {\defaultmtharrowfill \relbar \relbar \rightharpoondown }
+\def\rightharpoonupfill {\defaultmtharrowfill \relbar \relbar \rightharpoonup }
+\def\leftharpoondownfill {\defaultmtharrowfill \leftharpoondown \relbar \relbar }
+\def\leftharpoonupfill {\defaultmtharrowfill \leftharpoonup \relbar \relbar }
+
+
+\def\hookleftfill {\defaultmtharrowfill \leftarrow \relbar{\relbar\joinrel\rhook}}
+\def\hookrightfill{\defaultmtharrowfill{\lhook\joinrel\relbar}\relbar \rightarrow}
+
+% From amsmath.sty, extarrows.sty, extpfel.sty and mathtools.sty(ams)
+
+\definematharrow [xrightarrow] [0359] [\rightarrowfill]
+\definematharrow [xleftarrow] [3095] [\leftarrowfill]
+\definematharrow [xequal] [0099] [\equalfill]
+\definematharrow [xRightarrow] [0359] [\Rightarrowfill]
+\definematharrow [xLeftarrow] [3095] [\Leftarrowfill]
+\definematharrow [xLeftrightarrow] [0099] [\Leftrightarrowfill]
+\definematharrow [xleftrightarrow] [0099] [\leftrightarrowfill]
+\definematharrow [xmapsto] [3599] [\mapstofill]
+\definematharrow [xtwoheadrightarrow] [5009] [\twoheadrightarrowfill]
+\definematharrow [xtwoheadleftarrow] [0590] [\twoheadleftarrowfill]
+\definematharrow [xrightharpoondown] [0359] [\rightharpoondownfill]
+\definematharrow [xrightharpoonup] [0359] [\rightharpoonupfill]
+\definematharrow [xleftharpoondown] [3095] [\leftharpoondownfill]
+\definematharrow [xleftharpoonup] [3095] [\leftharpoonupfill]
+
+\definematharrow [xleftrightharpoons] [3399,3399] [\leftharpoonupfill,\rightharpoondownfill]
+\definematharrow [xrightleftharpoons] [3399,3399] [\rightharpoonupfill,\leftharpoondownfill]
+
+\definematharrow [xhdefaultookleftarrow] [3095] [\hookleftfill]
+\definematharrow [xhdefaultookrightarrow] [0395] [\hookrightfill]
+
+% \startformula \xrightarrow{stuff on top}\stopformula
+% \startformula \xrightarrow{}{stuff on top}\stopformula
+% \startformula \xrightarrow{stuff below}{}\stopformula
+% \startformula \xrightarrow{stuff below}{stuff on top}\stopformula
+
+% \startformula \xleftarrow [none]{stuff below}{stuff on top}\stopformula
+% \startformula \xleftarrow [small]{stuff below}{stuff on top}\stopformula
+% \startformula \xleftarrow [medium]{stuff below}{stuff on top}\stopformula
+% \startformula \xleftarrow [big]{stuff below}{stuff on top}\stopformula
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/math-ini.tex b/Master/texmf-dist/tex/context/base/math-ini.tex
index d78a9e4fcbb..7f50749470d 100644
--- a/Master/texmf-dist/tex/context/base/math-ini.tex
+++ b/Master/texmf-dist/tex/context/base/math-ini.tex
@@ -328,8 +328,42 @@
\def\definemathcharacter
{\dosixtupleempty\dodefinemathcharacter}
+% \def\dodefinemathcharacter[#1][#2][#3][#4][#5][#6]%
+% {\setmathtoks
+% \ifdynamicmathfamilies \let\purefamilyhex\relax \fi
+% \doifnumberelse{#1}
+% {\scratchcounter#1}
+% {\scratchcounter\@EA`\string#1}%
+% \appendetoks
+% \ifsixthargument
+% \delcode\the\scratchcounter="%
+% \ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi
+% \purefamilyhex{#3}\uchexnumbers{#4}%
+% \purefamilyhex{#5}\uchexnumbers{#6}\space
+% \else\iffourthargument
+% \mathcode\the\scratchcounter="%
+% \ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi
+% \purefamilyhex{#3}\uchexnumbers{#4}\space
+% \fi\fi\to\mathtoks
+% \let\purefamilyhex\normalpurefamilyhex
+% \tracemathcharacter{#1}}
+
+\newtoks\mathscratchtoks
+
+\def\definemathcharacter
+ {\chardef\mathcharactermode\zerocount
+ \dosixtupleempty\dodefinemathcharacter}
+
+\def\redefinemathcharacter
+ {\chardef\mathcharactermode\plusone
+ \dosixtupleempty\dodefinemathcharacter}
+
\def\dodefinemathcharacter[#1][#2][#3][#4][#5][#6]%
- {\setmathtoks
+ {\ifcase\mathcharactermode
+ \setmathtoks
+ \or
+ \let\mathtoks\mathscratchtoks \mathtoks\emptytoks
+ \fi
\ifdynamicmathfamilies \let\purefamilyhex\relax \fi
\doifnumberelse{#1}
{\scratchcounter#1}
@@ -344,9 +378,16 @@
\mathcode\the\scratchcounter="%
\ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi
\purefamilyhex{#3}\uchexnumbers{#4}\space
- \fi\fi\to\mathtoks
+ \fi\fi
+ \to \mathtoks
\let\purefamilyhex\normalpurefamilyhex
- \tracemathcharacter{#1}}
+ \ifcase\mathcharactermode
+ \expandafter\tracemathcharacter
+ \or
+ \the\mathtoks
+ \mathtoks\emptytoks
+ \expandafter\gobbleoneargument
+ \fi{#1}} % maybe lookahead
\def\tracemathcharacter#1%
{\iftracemathcollection
@@ -461,25 +502,52 @@
%D {ifmathpunctuation, enablemathpunctuation,
%D definemathpunctuation}
%D
+%D This will replace periods by comma's:
+%D
%D \starttyping
-%D \definemathpunctuation . mathperiod textperiod
-%D \definemathpunctuation , mathcomma textcomma
+%D \definemathpunctuation . textcomma textperiod
+%D \definemathpunctuation , textcomma textcomma
+%D
+%D \appendtoks
+%D \redefinemathcharacter [.] [ord] [mi] ["3B]%
+%D \to \everymathpunctuation
%D \stoptyping
-\newif\ifmathpunctuation
+% \newif\ifmathpunctuation
+%
+% \def\enablemathpunctuation{\mathpunctuationtrue}
+%
+% \def\definemathpunctuation #1 #2 #3 %
+% {\appendtoks
+% \initializemathpunctuation{#1}{#2}{#3}%
+% \to\everymathematics}
+%
+% \def\initializemathpunctuation#1#2#3% sloowww
+% {\ifmathpunctuation % hm move thsi test to everymath, or better a separate token list
+% \mathcode`#1="8000
+% \defineactivecharacter #1 {\dohandlemathpunctuation{#2}{#3}}%
+% \fi}
+%
+% \unexpanded\def\dohandlemathpunctuation#1#2% \if fails in mathml interval
+% {\def\next{\csname\ifx\space\nexttoken#2\else#1\fi\endcsname}%
+% \futurelet\nexttoken\next}
+
+\newtoks\everymathpunctuation
-\def\enablemathpunctuation{\mathpunctuationtrue}
+\def\enablemathpunctuation % can be called inside math, so after \everymathematics
+ {\the\everymathpunctuation
+ \appendtoksonce
+ \the\everymathpunctuation
+ \to\everymathematics}
\def\definemathpunctuation #1 #2 #3 %
{\appendtoks
\initializemathpunctuation{#1}{#2}{#3}%
- \to\everymath}
+ \to\everymathpunctuation}
\def\initializemathpunctuation#1#2#3% sloowww
- {\ifmathpunctuation
- \mathcode`#1="8000
- \defineactivecharacter #1 {\dohandlemathpunctuation{#2}{#3}}%
- \fi}
+ {\mathcode`#1="8000
+ \defineactivecharacter #1 {\dohandlemathpunctuation{#2}{#3}}}
\unexpanded\def\dohandlemathpunctuation#1#2% \if fails in mathml interval
{\def\next{\csname\ifx\space\nexttoken#2\else#1\fi\endcsname}%
@@ -500,13 +568,42 @@
%D Taco posted this solution as response to a mail by Olivier, so
%D let's integrate it here.
-\def\setmathfunctionstyle#1% \rm \ss \tt
- {\def\mfunction##1% no families, just scaling a la text
- {\mathchoice
- {\hbox{\csname#1\endcsname\tf ##1}}
- {\hbox{\csname#1\endcsname\tf ##1}}
- {\hbox{\csname#1\endcsname\tfx ##1}}
- {\hbox{\csname#1\endcsname\tfxx##1}}}}
+% \def\setmathfunctionstyle#1% rm ss tt
+% {\def\mfunction##1% no families, just scaling a la text
+% {\mathchoice
+% {\hbox{\csname#1\endcsname\tf ##1}}
+% {\hbox{\csname#1\endcsname\tf ##1}}
+% {\hbox{\csname#1\endcsname\tfx ##1}}
+% {\hbox{\csname#1\endcsname\tfxx##1}}}}
+
+\def\currentmscaledstyle{rm} % will be plugged into the typeface text=ss option
+
+\def\setmathfunctionstyle#1% rm ss tt
+ {\doifsomething{#1}
+ {\def\currentmscaledstyle{#1}%
+ \def\mathopnolimits##1{\mathop{\mscaledtext{##1}}\nolimits}%
+ \def\mfunction##1{\mscaledtext{##1}}}}
+
+\def\mscaledtext#1%
+ {\mathchoice
+ {\hbox{\csname\currentmscaledstyle\endcsname\tf #1}}
+ {\hbox{\csname\currentmscaledstyle\endcsname\tf #1}}
+ {\hbox{\csname\currentmscaledstyle\endcsname\tfx #1}}
+ {\hbox{\csname\currentmscaledstyle\endcsname\tfxx#1}}}
+
+%D We can force the way functions are typeset by manipulating the text
+%D option:
+%D
+%D \starttyping
+%D \definetypeface[iwona][ss][sans][iwona][default][encoding=texnansi]
+%D \definetypeface[iwona][mm][math][iwona][default][encoding=texnansi,text=ss]
+%D \stoptyping
+%D
+%D This hooks into the math handler with:
+
+\appendtoks
+ \setmathfunctionstyle\currentmathtextstyle
+\to \everybodyfont
%D Usage:
%D
diff --git a/Master/texmf-dist/tex/context/base/math-mis.tex b/Master/texmf-dist/tex/context/base/math-mis.tex
new file mode 100644
index 00000000000..b5a605cea53
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/math-mis.tex
@@ -0,0 +1,49 @@
+%D \module
+%D [ file=math-mis,
+%D version=2001.04.12,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Miscelaneous Symbols,
+%D author=Hans Hagen,
+%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
+
+%D \starttyping
+%D \usemathcollection[mis]
+%D \stoptyping
+
+\def\styledmathcommand#1%
+ {\mathchoice
+ {\let\currentmathstyle\displaystyle#1}%
+ {\let\currentmathstyle\textstyle#1}%
+ {\let\currentmathstyle\scriptstyle#1}%
+ {\let\currentmathstyle\scriptscriptstyle#1}}
+
+%D For Hong Feng:
+
+\def\geneq
+ {\styledmathcommand\dogeneq}
+
+\def\dogeneq
+ {\begingroup
+ \setbox\scratchbox\hbox{$\currentmathstyle=$}%
+ \hbox to \wd\scratchbox
+ {\copy\scratchbox
+ \hskip-\wd\scratchbox
+ \hss\incolortrue\localcolortrue
+ \color[white]{\vrule\!!height.6\ht\scratchbox\!!depth\zeropoint\!!width.2\wd\scratchbox}%
+ \hss}%
+ \endgroup}
+
+%D \startbuffer
+%D $a\geneq b^{a\geneq b^{a\geneq b}}$
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/math-pln.tex b/Master/texmf-dist/tex/context/base/math-pln.tex
index 73c12c973da..b8148491f1f 100644
--- a/Master/texmf-dist/tex/context/base/math-pln.tex
+++ b/Master/texmf-dist/tex/context/base/math-pln.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=math-pln,
-%D version=2001.11.16,
+%D version=2001.11.16,
%D title=\CONTEXT\ System Macros,
%D subtitle=Efficient \PLAIN\ \TEX\ loading,
%D author=Hans Hagen,
@@ -8,17 +8,17 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D This is a temporary module, some of this code will move to
-%D the other math modules.
+%D This is a temporary module, some of this code will move to
+%D the other math modules.
-\unprotect
+\unprotect
\def\m@th{\mathsurround\z@}
-\newbox\rootbox
+\newbox\rootbox
\def\root#1\of%
{\setbox\rootbox\hbox{$\m@th\scriptscriptstyle{#1}$}%
@@ -27,7 +27,7 @@
\def\r@@t#1#2% will be overloaded
{\setbox\z@\hbox{$\m@th#1\sqrt{#2}$}\dimen@\ht\z@
\advance\dimen@-\dp\z@
- \mkern5mu\raise.6\dimen@\copy\rootbox
+ \mkern5mu\raise.6\dimen@\copy\rootbox
\mkern-10mu\box\z@}
\def\mathhexbox#1#2#3%
@@ -38,13 +38,13 @@
{\leavevmode
\vtop
{\baselineskip\z@skip \lineskip.25ex%
- \ialign{##\crcr#1\crcr}}}
+ \ialign{##\crcr#1\crcr}}}
\def\o@lign
{\lineskiplimit\z@ \oalign}
\def\ooalign % chars over each other
- {\lineskiplimit-\maxdimen
+ {\lineskiplimit-\maxdimen
\oalign}
{\catcode`p=12 \catcode`t=12 \gdef\\#1pt{#1}} \let\getf@ctor=\\
@@ -52,9 +52,9 @@
\def\sh@ft#1% kern by #1 times the current slant
{\dimen@#1%
\kern\expandafter\getf@ctor\the\fontdimen1\font
- \dimen@}
+ \dimen@}
-% \def\copyright % will be overloaded
+% \def\copyright % will be overloaded
% {{\ooalign{\hfil\raise.07ex\hbox{c}\hfil\crcr\Orb}}}
\def\dots
@@ -76,11 +76,11 @@
\cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill
\mkern-7mu\smash-$}
-% must go to math-tex
+% must go to math-tex
-\mathchardef\braceld="37A
+\mathchardef\braceld="37A
\mathchardef\bracerd="37B
-\mathchardef\bracelu="37C
+\mathchardef\bracelu="37C
\mathchardef\braceru="37D
\def\downbracefill
@@ -95,7 +95,7 @@
\def\bye{\par\vfill\supereject\end}
-\let\sp=^
+\let\sp=^
\let\sb=_
\def\,{\mskip\thinmuskip}
\def\>{\mskip\medmuskip}
@@ -110,14 +110,14 @@
% \def\pr@m@s
% {\ifx'\next
-% \let\nxt\pr@@@s
+% \let\nxt\pr@@@s
% \else
% \ifx^\next
% \let\nxt\pr@@@t
% \else
% \let\nxt\egroup
% \fi
-% \fi
+% \fi
% \nxt}
\def\pr@m@s
@@ -130,7 +130,7 @@
\fi\fi}
\def\pr@@@s#1%
- {\prim@s}
+ {\prim@s}
\def\pr@@@t#1#2%
{#2\egroup}
@@ -258,7 +258,7 @@
% \setbox0=\hbox{\tenex B} \p@renwd=\wd0 % width of the big left (
\def\bordermatrix#1%
- {\begingroup
+ {\begingroup
\m@th
\setbox\z@\vbox
{\def\cr{\crcr\noalign{\kern2\p@\global\let\cr\endline}}%
@@ -279,18 +279,30 @@
\vbox{\kern\ht\@ne\box\tw@}%
\endgroup}
-\def\openup{\afterassignment\@penup\dimen@=}
+% \def\openup{\afterassignment\@penup\dimen@=}
+%
+% \def\@penup{\advance\lineskip\dimen@
+% \advance\baselineskip\dimen@
+% \advance\lineskiplimit\dimen@}
-\def\@penup{\advance\lineskip\dimen@
- \advance\baselineskip\dimen@
- \advance\lineskiplimit\dimen@}
+\def\openup
+ {\afterassignment\doopenup\scratchdimen=}
+
+\def\doopenup
+ {\advance\lineskip \scratchdimen
+ \advance\baselineskip \scratchdimen
+ \advance\lineskiplimit\scratchdimen}
+
+% \def\jot{.25\bodyfontsize} % plain tex: 3 pt (todo: better name and configurable)
+
+\def\displayopenupvalue{.25\bodyfontsize}
\def\eqalign#1%
{\null
\,%
\vcenter
- {\openup
- \jot\m@th
+ {\openup\displayopenupvalue % was \openup\jot
+ \m@th
\ialign
{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil\crcr
#1\crcr}}%
@@ -300,32 +312,32 @@
\def\displ@y
{\global\dt@ptrue
- \openup\jot\m@th
+ \openup\displayopenupvalue % was \openup\jot
\everycr
{\noalign
- {\ifdt@p
- \global\dt@pfalse
+ {\ifdt@p
+ \global\dt@pfalse
\ifdim\prevdepth>-1000\p@
- \vskip-\lineskiplimit
- \vskip\normallineskiplimit
+ \vskip-\lineskiplimit
+ \vskip\normallineskiplimit
\fi
- \else
- \penalty\interdisplaylinepenalty
+ \else
+ \penalty\interdisplaylinepenalty
\fi}}}
\def\@lign % restore inside \displ@y
{\tabskip\z@skip
- \everycr{}}
+ \everycr{}}
\def\displaylines#1%
- {\displ@y
+ {\displ@y
\tabskip\z@skip
\halign
{\hbox to \displaywidth{$\@lign\hfil\displaystyle##\hfil$}\crcr
#1\crcr}}
\def\eqalignno#1%
- {\displ@y
+ {\displ@y
\tabskip\centering
\halign to \displaywidth
{\hfil$\@lign\displaystyle{##}$\tabskip\z@skip
@@ -334,7 +346,7 @@
#1\crcr}}
\def\leqalignno#1%
- {\displ@y
+ {\displ@y
\tabskip\centering
\halign to \displaywidth
{\hfil$\@lign\displaystyle{##}$\tabskip\z@skip
diff --git a/Master/texmf-dist/tex/context/base/math-tex.tex b/Master/texmf-dist/tex/context/base/math-tex.tex
index 8b547d00016..d2516bc62c6 100644
--- a/Master/texmf-dist/tex/context/base/math-tex.tex
+++ b/Master/texmf-dist/tex/context/base/math-tex.tex
@@ -466,7 +466,7 @@
\def\notsosqrt[#1]{\root#1\of}
-\def\sqrt{\doifnextcharelse[\notsosqrt\normalsqrt}
+\unexpanded\def\sqrt{\doifnextcharelse[\notsosqrt\normalsqrt}
\def\PLAINbig {\@@dobig{0.85}}
\def\PLAINBig {\@@dobig{1.15}}
diff --git a/Master/texmf-dist/tex/context/base/math-uni.tex b/Master/texmf-dist/tex/context/base/math-uni.tex
index 88698243fc3..e8fd3f05def 100644
--- a/Master/texmf-dist/tex/context/base/math-uni.tex
+++ b/Master/texmf-dist/tex/context/base/math-uni.tex
@@ -3,21 +3,180 @@
%D version=2005.06.11,
%D title=\CONTEXT\ Math Macros,
%D subtitle=unicode support,
-%D author=Nikolai Weibull,
+%D author={Nikolai Weibull \& Taco Hoekwater},
%D date=\currentdate,
-%D copyright={PRAGMA / Nikolai Weibull}]
+%D copyright=PRAGMA]
\unprotect
-% needed for unic-033
+% needed for unic-032 % TH
\startmathcollection[default]
- \definemathcommand [unic@leftarrowtobar] {\mapstochar\leftarrow}
+ \definemathcommand [unic@doubleverticalline] {\mathord{\parallel}}
+ \definemathcommand [unic@doublelowline] {\underline{\textunderscore}}
+
+ \definemathcommand [unic@doubleprime] {''}
+ \definemathcommand [unic@tripleprime] {'''}
+
+ \definemathcommand [unic@reverseddoubleprime] {\mathord{\backprime\backprime}}
+ \definemathcommand [unic@reversedtripleprime] {\mathord{\backprime\backprime\backprime}}
+
+ \definemathcommand [unic@fractionslash] {\vulgarfraction{}{}}
+ \definemathcommand [unic@lowasterisk] {\mathord{\lower-.2em\hbox{$\ast$}}}
+
+ \definemathcommand [unic@functionapplication] {\mathop{}}
+ \definemathcommand [unic@invisibletimes] {\mathbin{}}
+ \definemathcommand [unic@invisibleseparator] {\mathpunct{}}
+
+\stopmathcollection
+
+% needed for unic-033 % TH
+
+\def\unic@vulgarfraction#1#2%
+ {\hbox
+ {\high{{\tfx\it #1}\kern -.2em}%
+ \symbol[vulgarfraction]%
+ \kern -.2em\low{{\tfx\it #2}}}}
+
+\startmathcollection[default]
+
+ \definemathcommand [unic@accountof] {\unic@vulgarfraction{a}{c}}
+ \definemathcommand [unic@addressedtothesubject] {\unic@vulgarfraction{a}{s}}
+ \definemathcommand [unic@doublestruckC] {{\Bbb C}}
+ \definemathcommand [unic@degreecelsius] {{\textdegree \tf C}}
+ \definemathcommand [unic@centrelinesymbol] {\unknownchar}
+ \definemathcommand [unic@careof] {\unic@vulgarfraction{c}{o}}
+ \definemathcommand [unic@cadauna] {\unic@vulgarfraction{c}{u}}
+ \definemathcommand [unic@eulerconstant] {{\rm e}}
+ \definemathcommand [unic@scruple] {\unknownchar}
+ \definemathcommand [unic@degreefahrenheit] {{\textdegree \tf F}}
+ \definemathcommand [unic@scriptg] {\unknownchar}
+ \definemathcommand [unic@scriptH] {{\cal H}}
+ \definemathcommand [unic@blackletterH] {{\fraktur H}}
+ \definemathcommand [unic@doublestruckH] {{\Bbb H}}
+ \definemathcommand [unic@planckconstant] {h}
+ \definemathcommand [unic@planckconstantovertwopi] {\hslash}
+ \definemathcommand [unic@scriptI] {{\cal I}}
+ \definemathcommand [unic@blackletterI] {{\fraktur I}}
+ \definemathcommand [unic@scriptL] {{\cal L}}
+ \definemathcommand [unic@scriptl] {\ell}
+ \definemathcommand [unic@lbbarsymbol] {\unknownchar}
+ \definemathcommand [unic@doublestruckN] {{\Bbb N}}
+ \definemathcommand [unic@numerosign] {\hbox{\symbol[numero]}}
+ \definemathcommand [unic@soundrecordingcopyright] {\encircled{{\tfx P}}}
+ \definemathcommand [unic@scriptP] {{\cal P}}
+ \definemathcommand [unic@doublestruckP] {{\Bbb P}}
+ \definemathcommand [unic@doublestruckQ] {{\Bbb Q}}
+ \definemathcommand [unic@scriptR] {{\cal R}}
+ \definemathcommand [unic@blackletterR] {{\fraktur R}}
+ \definemathcommand [unic@doublestruckR] {{\Bbb R}}
+ \definemathcommand [unic@prescriptiontake] {\unknownchar}
+ \definemathcommand [unic@response] {\unknownchar}
+ \definemathcommand [unic@servicemark] {\high{\txx SM}}
+ \definemathcommand [unic@telephonesign] {\high{\txx TEL}}
+ \definemathcommand [unic@trademarksign] {\trademark}
+ \definemathcommand [unic@versickle] {\unknownchar}
+ \definemathcommand [unic@doublestruckZ] {{\Bbb Z}}
+ \definemathcommand [unic@ouncesign] {\unknownchar}
+ \definemathcommand [unic@ohmsign] {\Omega}
+ \definemathcommand [unic@invertedohmsign] {\rotate[\c!rotation=180]{\Omega}}
+ \definemathcommand [unic@blackletterZ] {{\fraktur Z}}
+ \definemathcommand [unic@turnedgreekletteriota] {\rotate[\c!rotation=180]{\iota}}
+ \definemathcommand [unic@kelvinsign] {{\tf K}}
+ \definemathcommand [unic@angstromsign] {\Angstrom}
+ \definemathcommand [unic@scriptB] {{\cal B}}
+ \definemathcommand [unic@blackletterC] {{\fraktur C}}
+ \definemathcommand [unic@estimatedsymbol] {\unknownchar}
+ \definemathcommand [unic@scripte] {\unknownchar}
+ \definemathcommand [unic@scriptE] {{\cal E}}
+ \definemathcommand [unic@scriptF] {{\cal F}}
+ \definemathcommand [unic@turnedF] {\rotate[\c!rotation=180]{{\tf F}}}
+ \definemathcommand [unic@scriptM] {{\cal M}}
+ \definemathcommand [unic@scripto] {\unknownchar}
+
+ \definemathcommand [unic@informationsource] {{\bf i}}
+ \definemathcommand [unic@rotatedQ] {\rotate[\c!rotation=90]{{\tf Q}}}
+ \definemathcommand [unic@facsimilesign] {\unknownchar}
+ \definemathcommand [unic@doublestruckpi] {\pi}%{\unknownchar}
+ \definemathcommand [unic@doublestruckgamma] {\gamma}%{\unknownchar}
+ \definemathcommand [unic@doublestruckGamma] {\Gamma}%{\unknownchar}
+ \definemathcommand [unic@doublestruckPi] {\Pi}%{\unknownchar}
+ \definemathcommand [unic@doublestrucknarysummation] {\unknownchar}
+ \definemathcommand [unic@turnedsansserifG] {\rotate[\c!rotation=180]{{\ss G}}}
+ \definemathcommand [unic@turnedsansserifL] {\rotate[\c!rotation=180]{{\ss L}}}
+ \definemathcommand [unic@reversedsansserifL] {\mirror{{\ss L}}}
+ \definemathcommand [unic@turnedsansserifY] {\rotate[\c!rotation=180]{{\ss Y}}}
+ \definemathcommand [unic@doublestruckitalicD] {D}%{\unknownchar}
+ \definemathcommand [unic@doublestruckitalicd] {d}%{\unknownchar}
+ \definemathcommand [unic@doublestruckitalice] {e}%{\unknownchar}
+ \definemathcommand [unic@doublestruckitalici] {i}%{\unknownchar}
+ \definemathcommand [unic@doublestruckitalicj] {j}%{\unknownchar}
+ \definemathcommand [unic@propertyline] {\unknownchar}
+ \definemathcommand [unic@turnedampersand] {\rotate[\c!rotation=180]{\&}}
+ \definemathcommand [unic@persign] {\unknownchar}
+
+ \definemathcommand [unic@fractiononethird] {\vulgarfraction{1}{3}}
+ \definemathcommand [unic@fractiontwothirds] {\vulgarfraction{2}{3}}
+ \definemathcommand [unic@fractiononefifth] {\vulgarfraction{1}{5}}
+ \definemathcommand [unic@fractiontwofifths] {\vulgarfraction{2}{5}}
+ \definemathcommand [unic@fractionthreefifths] {\vulgarfraction{3}{5}}
+ \definemathcommand [unic@fractionfourfifths] {\vulgarfraction{4}{5}}
+ \definemathcommand [unic@fractiononesixth] {\vulgarfraction{1}{6}}
+ \definemathcommand [unic@fractionfivesixths] {\vulgarfraction{5}{6}}
+ \definemathcommand [unic@fractiononeeighth] {\vulgarfraction{1}{8}}
+ \definemathcommand [unic@fractionthreeeighths] {\vulgarfraction{3}{8}}
+ \definemathcommand [unic@fractionfiveeighths] {\vulgarfraction{5}{8}}
+ \definemathcommand [unic@fractionseveneighths] {\vulgarfraction{7}{8}}
+ \definemathcommand [unic@fractionnumeratorone] {\vulgarfraction{1}{}}
+ \definemathcommand [unic@romannumeralOne] {{\tf I}}
+ \definemathcommand [unic@romannumeralTwo] {{\tf II}}
+ \definemathcommand [unic@romannumeralThree] {{\tf III}}
+ \definemathcommand [unic@romannumeralFour] {{\tf IV}}
+ \definemathcommand [unic@romannumeralFive] {{\tf V}}
+ \definemathcommand [unic@romannumeralSix] {{\tf VI}}
+ \definemathcommand [unic@romannumeralSeven] {{\tf VII}}
+ \definemathcommand [unic@romannumeralEight] {{\tf VIII}}
+ \definemathcommand [unic@romannumeralNine] {{\tf IX}}
+ \definemathcommand [unic@romannumeralTen] {{\tf X}}
+ \definemathcommand [unic@romannumeralEleven] {{\tf XI}}
+ \definemathcommand [unic@romannumeralTwelve] {{\tf XII}}
+ \definemathcommand [unic@romannumeralFifty] {{\tf L}}
+ \definemathcommand [unic@romannumeralOnehundred] {{\tf C}}
+ \definemathcommand [unic@romannumeralFivehundred] {{\tf D}}
+ \definemathcommand [unic@romannumeralOnethousand] {{\tf M}}
+ \definemathcommand [unic@romannumeralone] {{\tf i}}
+ \definemathcommand [unic@romannumeraltwo] {{\tf ii}}
+ \definemathcommand [unic@romannumeralthree] {{\tf iii}}
+ \definemathcommand [unic@romannumeralfour] {{\tf iv}}
+ \definemathcommand [unic@romannumeralfive] {{\tf v}}
+ \definemathcommand [unic@romannumeralsix] {{\tf vi}}
+ \definemathcommand [unic@romannumeralseven] {{\tf vii}}
+ \definemathcommand [unic@romannumeraleight] {{\tf viii}}
+ \definemathcommand [unic@romannumeralnine] {{\tf ix}}
+ \definemathcommand [unic@romannumeralten] {{\tf x}}
+ \definemathcommand [unic@romannumeraleleven] {{\tf xi}}
+ \definemathcommand [unic@romannumeraltwelve] {{\tf xii}}
+ \definemathcommand [unic@romannumeralfifty] {{\tf l}}
+ \definemathcommand [unic@romannumeralonehundred] {{\tf c}}
+ \definemathcommand [unic@romannumeralfivehundred] {{\tf d}}
+ \definemathcommand [unic@romannumeralonethousand] {{\tf m}}
+ \definemathcommand [unic@romannumeralonethousandCD] {\unknownchar}
+ \definemathcommand [unic@romannumeralfivethousand] {\unknownchar}
+ \definemathcommand [unic@romannumeraltenthousand] {\unknownchar}
+ \definemathcommand [unic@romannumeralreversedonehundred] {\mirror{C}}
+
+\stopmathcollection
+
+% needed for unic-033 % NW
+
+\startmathcollection[default]
+
+ \definemathcommand [unic@leftarrowtobar] {\mapstochar\leftarrow}
\stopmathcollection
-% needed for unic-034
+% needed for unic-034 % NW
\startmathcollection[default]
@@ -64,7 +223,7 @@
\stopmathcollection
-% needed for unic-039
+% needed for unic-039 % NW
\startmathcollection[default]
diff --git a/Master/texmf-dist/tex/context/base/meta-dum.tex b/Master/texmf-dist/tex/context/base/meta-dum.tex
index 47c5504773c..10ce6d99a3f 100644
--- a/Master/texmf-dist/tex/context/base/meta-dum.tex
+++ b/Master/texmf-dist/tex/context/base/meta-dum.tex
@@ -82,14 +82,16 @@
\globallet\figurereplacementcycle\!!plusone
\fi
\weightGRAYfalse % monochrome anyway
+ \MPcmykcolorsfalse
+ \MPspotcolorsfalse
\defineoverlay
[\s!dummy]
[\useMPgraphic
- {placeholder}%
- {width=\figurewidth,
- height=\figureheight,
- reduction=\@@efreduction,
- color=placeholder:\figurereplacementcycle}]%
+ {placeholder}%
+ {width=\figurewidth,
+ height=\figureheight,
+ reduction=\@@efreduction,
+ color=placeholder:\figurereplacementcycle}]%
\expanded{\localframed
[\??ef]
[\c!width=\figurewidth,
diff --git a/Master/texmf-dist/tex/context/base/meta-fig.tex b/Master/texmf-dist/tex/context/base/meta-fig.tex
index 9a46b80d43a..6d4d304f9cd 100644
--- a/Master/texmf-dist/tex/context/base/meta-fig.tex
+++ b/Master/texmf-dist/tex/context/base/meta-fig.tex
@@ -49,11 +49,18 @@
\def\startMPpage
{\dodoubleempty\dostartMPpage}
-\long\def\dostartMPpage[#1][#2]#3\stopMPpage % second arg gobbles space
+\long\def\dostartMPpage[#1][#2]% second arg gobbles space
{\dostartfittingpage[\??mg][#1]%
- \startMPcode#3\stopMPcode
+ \obeyMPlines
+ \dodostartMPpage}
+
+\long\def\dodostartMPpage#1\stopMPpage
+ {\startuseMPgraphic{@@}#1\stopuseMPgraphic
+ \useMPgraphic{@@}%
\dostopfittingpage}
+\let\stopMPpage \relax % so that we can use it in \expanded
+
\setupMPpage
[\c!scale=1000,
\c!strut=\v!no,
@@ -63,14 +70,14 @@
\c!height=\v!fit,
\c!frame=\v!off]
-%D \macros
+%D \macros
%D {MPfigure}
%D
-%D A bit out of place, here but nevertheless:
+%D A bit out of place, here but nevertheless:
\def\MPfigure#1#2% test for dup figure
{\bgroup
- \getfiguredimensionsonly[#1]% [\c!object=\v!no] already set
+ \getfiguredimensionsonly[#1]% [\c!object=\v!no] already set
\freezedimenmacro\naturalfigurewidth
\freezedimenmacro\naturalfigureheight
\startMPcode
diff --git a/Master/texmf-dist/tex/context/base/meta-ini.tex b/Master/texmf-dist/tex/context/base/meta-ini.tex
index d628e5e6c43..3353a9a0bd6 100644
--- a/Master/texmf-dist/tex/context/base/meta-ini.tex
+++ b/Master/texmf-dist/tex/context/base/meta-ini.tex
@@ -55,6 +55,11 @@
1: se incarca biblioteca metapost --
\stopmessages
+\startmessages french library: metapost
+ title: metapost
+ 1: chargement de la bibliothèque metapost --
+\stopmessages
+
%D This module extends the functionality of the support module
%D \type {supp-mps}, the module that is responsible for
%D \METAPOST\ inclusion in \CONTEXT. Some basic macros will be
@@ -64,42 +69,46 @@
\maxnofMPgraphics = 4000 % metafun disables the 4K boundary
-\appendtoks
+\startMPextensions
if unknown context_tool: input mp-tool; fi;
if unknown context_spec: input mp-spec; fi;
if unknown context_grph: input mp-grph; fi;
-\to \MPextensions
+\stopMPextensions
%D Since we want lables to follow the document settings, we
%D also set the font related variables.
-\appendtoks % scale is not yet ok
+\startMPinitializations % scale is not yet ok
defaultfont:="\truefontname{Regular}";
defaultscale:=\the\bodyfontsize/10pt;
-\to \MPinitializations
+\stopMPinitializations
%D In order to support fancy text features (like outline
%D fonts), we set:
-\appendtoks
+\startMPextensions
graphictextformat:="context";
graphictextdirective "\the\everyMPTEXgraphic";
-\to \MPextensions
+\stopMPextensions
-% \appendtoks
+% \startMPextensions
% textextdirective "\the\everyMPTEXgraphic";
-% \to \MPextensions
+% \stopMPextensions
%D A signal that we're in combines \CONTEXT||\METAFUN mode:
-\appendtoks
+\startMPextensions
string contextversion;
contextversion:="\contextversion";
-\to \MPextensions
+\stopMPextensions
%D Some safeguards:
-
-\appendtoks \cleanupfeatures \to \everyMPgraphic
+%D
+%D \starttyping
+%D \appendtoks \cleanupfeatures \to \everyMPgraphic
+%D \stoptyping
+%D
+%D No, we don't want that (else we loose UTF etc).
%D Another one:
@@ -244,11 +253,15 @@
\elabelgroup}
\long\def\startuniqueMPgraphic
- {\dodoublegroupempty\dostartuniqueMPgraphic}
-
-\long\def\dostartuniqueMPgraphic#1#2#3\stopuniqueMPgraphic%
{\blabelgroup
- \long\setgvalue{\@@MPG#1}{\handleuniqueMPgraphic{#1}{#2}{#3}}%
+ \dodoublegroupempty\dostartuniqueMPgraphic}
+
+\long\def\dostartuniqueMPgraphic
+ {\obeyMPlines
+ \dodostartuniqueMPgraphic}
+
+\long\def\dodostartuniqueMPgraphic#1#2#3\stopuniqueMPgraphic%
+ {\long\setgvalue{\@@MPG#1}{\handleuniqueMPgraphic{#1}{#2}{#3}}%
\elabelgroup}
\unexpanded\def\uniqueMPgraphic
@@ -259,6 +272,8 @@
\setupMPvariables[#1][#2]%
\getvalue{\@@MPG#1}{}%
\elabelgroup}
+
+\let\stopuniqueMPcode \relax % so that we can use it in \expanded
\long\def\handleuseMPgraphic#1#2#3%
{\blabelgroup
@@ -274,19 +289,27 @@
\elabelgroup}
\long\def\startuseMPgraphic
- {\dodoublegroupempty\dostartuseMPgraphic}
-
-\long\def\dostartuseMPgraphic#1#2#3\stopuseMPgraphic
{\blabelgroup
- \long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}%
+ \dodoublegroupempty\dostartuseMPgraphic}
+
+\long\def\dostartuseMPgraphic
+ {\obeyMPlines
+ \dodostartuseMPgraphic}
+
+\long\def\dodostartuseMPgraphic#1#2#3\stopuseMPgraphic
+ {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}%
\elabelgroup}
\long\def\startusableMPgraphic % redundant but handy
- {\dodoublegroupempty\dostartusableMPgraphic}
-
-\long\def\dostartusableMPgraphic#1#2#3\stopusableMPgraphic
{\blabelgroup
- \long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}%
+ \dodoublegroupempty\dostartusableMPgraphic}
+
+\long\def\dostartusableMPgraphic % redundant but handy
+ {\obeyMPlines
+ \dodostartusableMPgraphic}
+
+\long\def\dodostartusableMPgraphic#1#2#3\stopusableMPgraphic
+ {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}{#3}}%
\elabelgroup}
\long\def\handlereusableMPgraphic#1#2#3%
@@ -305,16 +328,15 @@
\elabelgroup}
\long\def\startreusableMPgraphic
- {\dodoublegroupempty\dostartreusableMPgraphic}
+ {\blabelgroup
+ \dodoublegroupempty\dostartreusableMPgraphic}
-% \long\def\dostartreusableMPgraphic#1#2#3\stopreusableMPgraphic%
-% {\ifundefined{\@@MPG#1}%
-% \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}{#3}}%
-% \fi}
+\def\dostartreusableMPgraphic
+ {\obeyMPlines
+ \dodostartreusableMPgraphic}
-\long\def\dostartreusableMPgraphic#1#2#3\stopreusableMPgraphic
- {\blabelgroup
- \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}{#3}}%
+\long\def\dodostartreusableMPgraphic#1#2#3\stopreusableMPgraphic
+ {\long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}{#3}}%
\elabelgroup}
\unexpanded\def\useMPgraphic
@@ -328,6 +350,11 @@
\let\reuseMPgraphic\useMPgraphic
+\let\stopuseMPcode \relax % so that we can use it in \expanded
+\let\stopusableMPcode \relax % so that we can use it in \expanded
+\let\stopreusableMPcode \relax % so that we can use it in \expanded
+\let\stopuniqueMPcode \relax % so that we can use it in \expanded
+
\def\enableincludeMPgraphics
{\let\handleuseMPgraphic \thirdofthreearguments
\let\handlereusableMPgraphic\thirdofthreearguments}
@@ -346,11 +373,15 @@
:\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}}%
+ \dodoublegroupempty\dostartuniqueMPpagegraphic}
+
+\long\def\dostartuniqueMPpagegraphic
+ {\obeyMPlines
+ \dodostartuniqueMPpagegraphic}
+
+\long\def\dodostartuniqueMPpagegraphic#1#2#3\stopuniqueMPpagegraphic
+ {\long\setgvalue{\@@MPG o:#1}{\handleuniqueMPgraphic{o:#1}{#2}{#3}}%
\long\setgvalue{\@@MPG e:#1}{\handleuniqueMPgraphic{e:#1}{#2}{#3}}%
\elabelgroup}
@@ -450,13 +481,13 @@
%D We also have to make sure that \METAPOST\ knows this:
-\appendtoks
+\startMPextensions
if not known _data_prefix_:
string _data_prefix_,_data_suffix_;
fi;
_data_prefix_:="\bufferprefix mpd-";
_data_suffix_:=".mpd";
-\to \MPextensions
+\stopMPextensions
%D \macros
%D {getMPdata}
@@ -482,10 +513,10 @@
%D We have to enable this mechanism with:
-\appendtoks
+\startMPextensions
boolean collapse_data; collapse_data:=true;
_data_suffix_:=".mpd"; % overloads previous one
-\to \MPextensions
+\stopMPextensions
%D For the moment, the next one is a private macro:
@@ -497,6 +528,7 @@
{\doprocessMPbuffer[\jobname]}
{\bgroup
\setnormalcatcodes
+ \obeyMPlines
%\let\par\empty % oeps, this makes dvi mode graphics hang when not found
\!!toksa\emptytoks
\def\copyMPbufferline{\expandafter\appendtoks\fileline\to\!!toksa}%
@@ -544,7 +576,7 @@
\long\def\dostartMPenvironment[#1][#2]#3\stopMPenvironment
{\egroup
\doif{#1}\s!reset\resetMPenvironment % reset mp toks
- \doif{#1}\v!global{#3}% % use in main doc too
+ \doif{#1}\v!global{#3}% % use in main doc too
\doif{#1}+{#3}% % use in main doc too
\convertargument#3\to\ascii
\expandafter\appendtoks\ascii\to\everyMPTEXgraphic}
@@ -635,10 +667,9 @@
\def\douseMPlibrary#1%
{\ifundefined{\c!file\f!javascriptprefix#1}%
\letvalueempty{\c!file\f!javascriptprefix#1}%
- \makeshortfilename[\f!metapostprefix#1]
- \showmessage\m!metapost1{#1}
+ \makeshortfilename[\truefilename{\f!metapostprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename\donothing\donothing
+ \readsysfile\shortfilename{\showmessage\m!metapost1{#1}}\donothing
\stopreadingfile
\fi}
@@ -668,9 +699,13 @@
\convertargument#2\to\ascii
\dodoglobal\letvalue{\@@MPT#1}\ascii}
-\def\MPtext #1{\getvalue{\@@MPT#1}}
-\def\MPstring #1{"\getvalue{\@@MPT#1}"}
-\def\MPbetex #1{btex \getvalue{\@@MPT#1} etex}
+% \def\MPtext #1{\getvalue{\@@MPT#1}}
+% \def\MPstring #1{"\getvalue{\@@MPT#1}"}
+% \def\MPbetex #1{btex \getvalue{\@@MPT#1} etex}
+
+\def\MPtext #1{\executeifdefined{\@@MPT#1}\empty}
+\def\MPstring #1{"\executeifdefined{\@@MPT#1}\empty"}
+\def\MPbetex #1{btex \executeifdefined{\@@MPT#1}\empty\space etex}
%D Unfortunately \METAPOST\ does not have \CMYK\ support
%D built in, but by means of specials we can supply the
@@ -679,21 +714,21 @@
\newif\ifMPcmykcolors \MPcmykcolorstrue
\newif\ifMPspotcolors \MPspotcolorstrue
-\appendtoks
+\startMPinitializations
cmykcolors:=\ifMPcmykcolors true\else false\fi;
spotcolors:=\ifMPspotcolors true\else false\fi;
-\to \MPinitializations
+\stopMPinitializations
%D In order to communicate conveniently with the \TEX\
%D engine, we introduce some typesetting variables.
% todo : backgroundoffsets
-\appendtoks
+\startMPextensions
color OverlayColor,OverlayLineColor;
-\to \MPextensions
+\stopMPextensions
-\appendtoks
+\startMPinitializations
OverlayWidth:=\overlaywidth;
OverlayHeight:=\overlayheight;
OverlayDepth:=\overlayheight;
@@ -718,7 +753,11 @@
PageNumber:=\the\pageno;
RealPageNumber:=\the\realpageno;
LastPageNumber:= lastpage;
-\to \MPinitializations
+\stopMPinitializations
+
+\appendtoks
+ \expanded{\definecolor[currentcolor][\currentcolor]}%
+\to \everyMPgraphic
\appendtoks
\baselineskip1\baselineskip
@@ -758,9 +797,9 @@
\ifx\undefined\MPprologues \def\MPprologues{0} \fi
-\appendtoks
+\startMPinitializations
prologues:=\MPprologues;
-\to \MPinitializations
+\stopMPinitializations
\appendtoks
\def\MPprologues{0}%
@@ -811,7 +850,10 @@
%D However, on a 1 Gig Pentium, the next alternative saves
%D us 20 seconds run time for the 300 page \METAFUN\ manual:
-\def\insertMPfile#1#2{\doinsertMPfile{#1}}
+\let\insertMPfileARG\insertMPfile
+
+\def\insertMPfile#1#2% in context #2 is empty
+ {\doifelsenothing{#2}{\doinsertMPfile{#1}}{\insertMPfileARG{#1}{#2}}}
\def\includeMPasEPS#1%
{\bgroup
@@ -853,25 +895,25 @@
%D One more: (still needed?)
-\appendtoks
+\startMPextensions
def initialize_form_numbers =
do_initialize_numbers;
enddef;
-\to \MPextensions
+\stopMPextensions
-\appendtoks
+\startMPinitializations
HSize:=\the\hsize ;
VSize:=\the\vsize ;
-\to \MPinitializations
+\stopMPinitializations
-\appendtoks
+\startMPextensions
vardef ForegroundBox =
unitsquare xysized(HSize,VSize)
enddef ;
vardef PageFraction =
if \lastpage>1: (\realfolio-1)/(\lastpage-1) else: 1 fi
enddef ;
-\to \MPextensions
+\stopMPextensions
%D And some more. These are not really needed since we
%D don't use the normal figure inclusion macros any longer.
@@ -927,7 +969,7 @@
%D New:
-\definelayerpreset
+\definelayerpreset % no dx,dy - else nasty non-mp placement
[mp]
[\c!y=-\MPury bp,
\c!x=\MPllx bp,
@@ -956,13 +998,106 @@
%D
%D \ruledhbox{\flushlayer[mp]}
%D \stoptyping
+%D
+%D Reusing graphics is also possible (now):
+%D
+%D \starttyping
+%D \startreusableMPgraphic{axis}
+%D tickstep := 1cm ; ticklength := 2mm ;
+%D drawticks unitsquare xscaled 4cm yscaled 3cm shifted (-1cm,-1cm) ;
+%D tickstep := tickstep/2 ; ticklength := ticklength/2 ;
+%D drawticks unitsquare xscaled 4cm yscaled 3cm shifted (-1cm,-1cm) ;
+%D \stopreusableMPgraphic
+%D
+%D \startuseMPgraphic{demo}
+%D drawpoint "1cm,1.5cm" ;
+%D \stopuseMPgraphic
+%D
+%D \definelayer[mp][preset=mp]
+%D \setlayer[mp]{\reuseMPgraphic{axis}}
+%D \setlayer[mp]{\useMPgraphic{demo}}
+%D \ruledhbox{\flushlayer[mp]}
+%D \stoptyping
+
+%D \macros
+%D {startstaticMPfigure,useMPstaticfigure}
+%D
+%D Static figures are processed only when there has been
+%D something changed. Here is Aditya Mahajan's testcase:
+%D
+%D \startbuffer
+%D \startstaticMPfigure{circle}
+%D fill fullcircle scaled 1cm withcolor blue;
+%D \stopstaticMPfigure
+%D
+%D \startstaticMPfigure{axis}
+%D drawarrow (0,0)--(2cm,0) ;
+%D drawarrow (0,0)--(0,2cm) ;
+%D label.llft(textext("(0,0)") ,origin) ;
+%D \stopstaticMPfigure
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+\def\usestaticMPfigure[#1]%
+ {\dodoubleempty\externalfigure[\jobname-#1.pdf]}
+
+\def\startstaticMPfigure
+ {\begingroup
+ \obeyMPlines
+ \dostartstaticMPfigure}
+
+\def\dostartstaticMPfigure#1#2\stopstaticMPfigure
+ {\startstaticMPgraphic{\jobname-#1}#2\stopstaticMPgraphic
+ \endgroup}
+
+% faster, but more tricky
+%
+% \def\startstaticMPfigure
+% {\doifmodeelse{*\v!first}
+% {\begingroup
+% \obeyMPlines
+% \dostartstaticMPfigure}
+% {\gobbleuntil\stopstaticMPfigure}}
+%
+% \def\dostartstaticMPfigure#1#2\stopstaticMPfigure
+% {\startMPstaticgraphic{\jobname-#1}#2\stopMPstaticgraphic
+% % dirty trick, don't register, so no second main run of texexec:
+% \global\advance\nofMPgraphics \minusone
+% \endgroup}}
%D New:
% \appendtoks \closeMPgraphicfiles \to \everystoptext
+%D New:
+
+\newconditional\manyMPspecials % when set to true, > 1000 specials can be used
+
+\settrue \manyMPspecials % per 1/4/2006
+
+\prependtoks
+ _special_div_ := 1000\ifconditional\manyMPspecials0\fi ;
+\to \MPextensions
+
+%D Needed (will become default):
+
+\prependtoks
+ \resetlanguagespecifics
+\to \everyMPgraphic
+
+% Done.
+
\protect \endinput
+%D Experimental:
+
+\appendtoks
+ \ifrunMPgraphics \ifcase\systemcommandmode \or
+ \runMPgraphicsfalse
+ \fi \fi
+\to \everyjob
+
% also:
%
% linecap := rounded ;
diff --git a/Master/texmf-dist/tex/context/base/meta-pag.tex b/Master/texmf-dist/tex/context/base/meta-pag.tex
index 32473cb7499..cda7dbd96cb 100644
--- a/Master/texmf-dist/tex/context/base/meta-pag.tex
+++ b/Master/texmf-dist/tex/context/base/meta-pag.tex
@@ -19,24 +19,24 @@
\unprotect
-\appendtoks
+\startMPextensions
if unknown context_page: input mp-page; fi;
-\to \MPextensions
+\stopMPextensions
%D The next few macros tell \METAPOST\ how the \CONTEXT\
%D pagebody looks.
-\appendtoks
+\startMPextensions
boolean PageStateAvailable,OnRightPage,InPageBody;
PageStateAvailable:=true;
-\to \MPextensions
+\stopMPextensions
-\appendtoks
+\startMPinitializations
OnRightPage:=true;
InPageBody:=\ifinpagebody true \else false \fi;
-\to \MPinitializations
+\stopMPinitializations
-\appendtoks
+\startMPinitializations
def LoadPageState =
OnRightPage:=\MPonrightpage;
OnOddPage:=\MPonoddpage;
@@ -85,7 +85,7 @@
LayoutColumnDistance:=\the\layoutcolumndistance;
LayoutColumnWidth:=\the\layoutcolumnwidth;
enddef;
-\to \MPinitializations
+\stopMPinitializations
\def\MPonrightpage{true}
\def\MPonoddpage {true}
@@ -181,14 +181,35 @@
\hbox{#1}%
\fi}
+% better, so that we can force a key and share with e.g. renumbering
+%
+% \let\namedtextarea\empty
+%
+% \def\registerMPlocaltextarea#1%
+% {\ifpositioning
+% \bgroup
+% \ifx\namedtextarea\empty
+% \doglobal\increment\currentMPtextareadata
+% \edef\namedtextarea{gbd:\currentMPtextareadata}%
+% \fi
+% \hpos\namedtextarea{\iftracetextareas\boxrulewidth3pt\ruledhbox\fi{#1}}%
+% \edef\ascii{RegisterLocalTextArea(%
+% \MPx\namedtextarea,\MPy\namedtextarea,%
+% \MPw\namedtextarea,\MPh\namedtextarea,\MPd\namedtextarea);}%
+% \global\MPlocaltextareadata\@EA{\ascii}%
+% \egroup
+% \else
+% \hbox{#1}%
+% \fi}
+
\def\resetMPlocaltextarea
{\global\MPlocaltextareadata\emptytoks}
-\appendtoks
+\startMPextensions
path PlainTextArea;
-\to \MPextensions
+\stopMPextensions
-\appendtoks
+\startMPinitializations
ResetTextAreas;
\the\MPsavedtextareadata;
SaveTextAreas;
@@ -197,7 +218,7 @@
\the\MPlocaltextareadata;
PlainTextArea:=boundingbox(\MPxy{text:\realfolio}--\MPxy{text:\realfolio}
shifted (\MPw{text:\realfolio},\MPh{text:\realfolio}));
-\to \MPinitializations
+\stopMPinitializations
\appendtoks
\global\MPsavedtextareadata\MPtextareadata
diff --git a/Master/texmf-dist/tex/context/base/meta-pdf.tex b/Master/texmf-dist/tex/context/base/meta-pdf.tex
new file mode 100644
index 00000000000..bddf932efaf
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/meta-pdf.tex
@@ -0,0 +1,3373 @@
+%D \module
+%D [ file=meta-pdf,
+%D version=2006.06.07,
+%D title=\CONTEXT\ Support Macros,
+%D subtitle=\METAPOST\ to \PDF\ conversion,
+%D author=Hans Hagen \& others (see text),
+%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.
+
+%D In due time this file will replace \type {supp-pdf} and
+%D \type {supp-mpe}.
+
+% \input supp-pdf
+% \input supp-mpe
+%
+% \endinput
+
+% we're going to experiment a bit with new code
+
+%D To be tested: texopt.rb on this file.
+
+%D Prelude to an optimized version:
+
+%D \module
+%D [ file=supp-pdf,
+%D version=2004.12.16,
+%D title=\CONTEXT\ Support Macros,
+%D subtitle=\METAPOST\ to \PDF\ conversion,
+%D author=Hans Hagen \& others (see text),
+%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.
+
+%D These macros are written as generic as possible. Some
+%D general support macro's are loaded from a small module
+%D especially made for non \CONTEXT\ use. In this module I
+%D use a matrix transformation macro written by Tanmoy
+%D Bhattacharya. Thanks to extensive testing by Sebastian
+%D Ratz I was able to complete this module within reasonable
+%D time. This module has support for \METAPOST\ extensions
+%D built in.
+%D
+%D Daniel H. Luecking came up with a better (more precise)
+%D transformation method. You can recognize his comment by
+%D his initials. (We keep the old code around because it's a
+%D nice illustration on how a module like this evolves.)
+
+% Beware, we cannot use \zeropoint here since it may be
+% defined in the range \dimen 0 - 20 which we happen to use
+% as scratch registers; inside context we may consider
+% using dedicated registers.
+
+%D This module handles some \PDF\ conversion and insertions
+%D topics. By default, the macros use the \PDFTEX\ primitive
+%D \type{\pdfliteral} when available. Since \PDFTEX\ is now the
+%D default engine for \TEX\ distributions, we need a more complex
+%D test.
+
+\writestatus{loading}{Context Support Macros / PDF (2004.03.26)}
+
+\unprotect
+
+\ifx\PDFcode\undefined
+ \ifx\pdfliteral\undefined
+ \def\PDFcode#1{\special{PDF: #1}}
+ \else\ifx\pdfoutput\undefined
+ \def\PDFcode#1{\special{PDF: #1}}
+ \else\ifcase\pdfoutput
+ \def\PDFcode#1{\special{PDF: #1}}
+ \else % pdftex as well as in pdf mode
+ \let\PDFcode\pdfliteral
+ \fi\fi\fi
+\else
+ % we probably use context
+\fi
+
+%D First we define a handy constant:
+
+\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
+
+%D \macros
+%D {pdfimage,pdfimages,pdfclippedimage}
+%D
+%D Starting with pdftex version 14, images are included more
+%D natural to the form embedding. This enables alternative
+%D images to be embedded.
+%D
+%D \starttyping
+%D \pdfimage <optional dimensions> {file}
+%D \pdfimages <optional dimensions> {high res file} {low res file}
+%D \stoptyping
+%D
+%D The first one replaces the pre||version||14 original,
+%D while the latter provides alternative images.
+%D
+%D The next macro is dedicated to Maarten Gelderman, who
+%D needed to paste prepared \PDF\ pages into conference
+%D proceedings.
+%D
+%D \starttyping
+%D \pdfclippedimage <optional dimensions> {file} {l} {r} {t} {b}
+%D \stoptyping
+
+\ifx\pdftexversion\undefined \else \ifnum\pdftexversion>13
+
+ \def\pdfimage#1#%
+ {\dopdfimage{#1}}
+
+ \def\dopdfimage#1#2%
+ {\immediate\pdfximage#1{#2}%
+ \pdfrefximage\pdflastximage}
+
+ \def\pdfimages#1#%
+ {\dopdfimages{#1}}
+
+ \def\dopdfimages#1#2#3%
+ {\immediate\pdfximage#1{#2}%
+ \immediate\pdfobj
+ {[ << /Image \the\pdflastximage\space0 R
+ /DefaultForPrinting true >> ]}%
+ \immediate\pdfximage#1
+ attr {/Alternates \the\pdflastobj\space0 R}{#3}%
+ \pdfrefximage\pdflastximage}
+
+ \def\pdfclippedimage#1#% specs {file}{left}{right}{top}{bottom}
+ {\dopdfclippedimage{#1}}
+
+ \def\dopdfclippedimage#1#2#3#4#5#6%
+ {\bgroup
+ \pdfximage#1{#2}%
+ \setbox\scratchbox\hbox
+ {\pdfrefximage\pdflastximage}%
+ \hsize\wd\scratchbox
+ \advance\hsize -#3%
+ \advance\hsize -#4%
+ \vsize\ht\scratchbox
+ \advance\vsize -#5%
+ \advance\vsize -#6%
+ \setbox\scratchbox\vbox to \vsize
+ {\vskip-#5\hbox to \hsize{\hskip-#3\box\scratchbox\hss}}%
+ \pdfxform\scratchbox
+ \pdfrefxform\pdflastxform
+ \egroup}
+
+\fi \fi
+
+%D If you want to save a few hash entries, you may prefer the
+%D less readable alternatives, like:
+%D
+%D \starttyping
+%D \def\pdfimage#1#% This one is less readable but needs no additional
+%D {\bgroup % hash entry for the second stage macro.
+%D \def\pdfimage##1%
+%D {\immediate\pdfximage##1{#2}%
+%D \pdfrefximage\pdflastximage\egroup}}
+%D \stoptyping
+
+%D \macros
+%D {convertMPtoPDF}
+%D
+%D The next set of macros implements \METAPOST\ to \PDF\
+%D conversion. Because we want to test as fast as possible, we
+%D first define the \POSTSCRIPT\ operators that \METAPOST\
+%D uses. We don't define irrelevant ones, because these are
+%D skipped anyway.
+
+%D The converter can be made a bit faster by replacing the
+%D two test macros (the ones with the many \type {\if's}) by
+%D a call to named branch macros (something \typ {\getvalue
+%D {xPSmoveto}}. For everyday documents with relatively
+%D small graphics the gain in speed can be neglected.
+
+\def \PScurveto {curveto}
+\def \PSlineto {lineto}
+\def \PSmoveto {moveto}
+\def \PSshowpage {showpage}
+\def \PSnewpath {newpath}
+\def \PSfshow {fshow}
+\def \PSclosepath {closepath}
+\def \PSfill {fill}
+\def \PSstroke {stroke}
+\def \PSclip {clip}
+\def \PSrlineto {rlineto}
+\def \PSsetlinejoin {setlinejoin}
+\def \PSsetlinecap {setlinecap}
+\def \PSsetmiterlimit {setmiterlimit}
+\def \PSsetgray {setgray}
+\def \PSsetrgbcolor {setrgbcolor}
+\def \PSsetcmykcolor {setcmykcolor}
+\def \PSsetdash {setdash}
+\def \PSgsave {gsave}
+\def \PSgrestore {grestore}
+\def \PStranslate {translate}
+\def \PSscale {scale}
+\def \PSconcat {concat}
+\def \PSdtransform {dtransform}
+\def \PSsetlinewidth {setlinewidth}
+\def \PSpop {pop}
+
+\def \PSnfont {nfont} % was needed for TUG98 proceedings
+\def \PSspecial {special} % extensions to MetaPost
+
+%D A previous version set \type {%} to ignore, which
+%D simplified the following definitions. At the start of
+%D conversion the percent character was made active again.
+%D Because the whole graphic is one paragraph (there are no
+%D empty lines) this does not give the desired effect. This
+%D went unnoticed untill Scott Pakin sent me a test file
+%D percent characters in a string. So, from now on we have
+%D to prefix the following strings with percentages.
+
+%D Some day I'll figure out a better solution (line by line reading
+%D using \ETEX).
+
+\edef \PSBoundingBox {\letterpercent\letterpercent BoundingBox:}
+\edef \PSHiResBoundingBox {\letterpercent\letterpercent HiResBoundingBox:}
+\edef \PSExactBoundingBox {\letterpercent\letterpercent ExactBoundingBox:}
+\edef \PSMetaPostSpecial {\letterpercent\letterpercent MetaPostSpecial:}
+\edef \PSMetaPostSpecials {\letterpercent\letterpercent MetaPostSpecials:}
+\edef \PSPage {\letterpercent\letterpercent Page:}
+
+%D By the way, the \type {setcmykcolor} operator is not
+%D output by \METAPOST\ but can result from converting the
+%D \cap{RGB} color specifications, as implemented in
+%D \type{supp-mps}.
+
+%D In \POSTSCRIPT\ arguments precede the operators. Due to the
+%D fact that in some translations we need access to those
+%D arguments, and also because sometimes we have to skip them,
+%D we stack them up. The stack is one||dimensional for non path
+%D operators and two||dimensional for operators inside a path.
+%D This is because we have to save the whole path for
+%D (optional) postprocessing. Values are pushed onto the stack
+%D by:
+%D
+%D \starttyping
+%D \setMPargument {value}
+%D \stoptyping
+%D
+%D They can be retrieved by the short named macros:
+%D
+%D \starttyping
+%D \gMPa {number}
+%D \gMPs {number}
+%D \stoptyping
+%D
+%D When scanning a path specification, we also save the
+%D operator, using
+%D
+%D \starttyping
+%D \setMPkeyword {n}
+%D \stoptyping
+%D
+%D The path drawing operators are coded for speed: \type{clip},
+%D \type{stroke}, \type{fill} and \type{fillstroke} become
+%D 1, 2, 3 and~4.
+%D
+%D When processing the path this code can be retrieved
+%D using
+%D
+%D \starttyping
+%D \getMPkeyword % {n}
+%D \stoptyping
+%D
+%D When setting an argument, the exact position on the stack
+%D depends on the current value of the \COUNTERS\
+%D \type{\nofMPsegments} and \type{\nofMParguments}.
+
+\newcount\nofMPsegments
+\newcount\nofMParguments
+
+%D These variables hold the coordinates. The argument part of
+%D the stack is reset by:
+%D
+%D \starttyping
+%D \resetMPstack
+%D \stoptyping
+%D
+%D We use the prefix \type{@@MP} to keep the stack from
+%D conflicting with existing macros. To speed up things a bit
+%D more, we use the constant \type{\@@MP}.
+
+\def\@@MP{@@MP}
+
+\def\setMPargument% #1%
+ {\advance\nofMParguments \plusone
+ \expandafter\def
+ \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} % {#1}
+
+\def\letMPargument
+ {\advance\nofMParguments \plusone
+ \expandafter\let
+ \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname}
+
+\def\setMPsequence#1 %
+ {\advance\nofMParguments \plusone
+ \expandafter\def
+ \csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname{#1}%
+ \handleMPsequence}
+
+\def\gMPa#1%
+ {\csname\@@MP0\number#1\endcsname}
+
+\def\gMPs#1%
+ {\csname\@@MP\the\nofMPsegments\number#1\endcsname}
+
+\def\dogMPa#1%
+ {\@EAEAEA\do\csname\@@MP0\number#1\endcsname}
+
+\def\setMPkeyword#1 %
+ {\expandafter\def\csname\@@MP\the\nofMPsegments0\endcsname{#1}%
+ \advance\nofMPsegments \plusone
+ \nofMParguments\zerocount}
+
+\def\getMPkeyword% #1%
+ {\csname\@@MP\the\nofMPsegments0\endcsname} % {\csname\@@MP#10\endcsname}
+
+\def\docleanupMPargument#1% we need this because args can have [ or ] pre/appended
+ {\expandafter\edef\csname\@@MP\the\nofMPsegments\number#1\endcsname
+ {\csname\@@MP\the\nofMPsegments\number#1\endcsname}}
+
+%D When we reset the stack, we can assume that all further
+%D comment is to be ignored and handled in strings.
+%D By redefining the reset macro after the first call, we
+%D save some run time. Only use this macro after all
+%D comments are processed and use the simple alternative
+%D when dealing with comments.
+
+\def\doresetMPstack
+ {\nofMParguments\zerocount}
+
+\def\resetMPstack
+ {\let\handleMPgraphic\handleMPendgraphic
+ \let\resetMPstack\doresetMPstack
+ \resetMPstack}
+
+%D The arguments are saved with the preceding command
+%D \type{\do}. By default this command expands to nothing, but
+%D when we deal with strings it's used to strip off the
+%D \type{(} and \type{)}.
+%D
+%D Strings are kind of tricky, because characters can be
+%D passed verbatim \type{(hello)}, by octal number
+%D \type{(\005)} or as command \type{(\()}. We therefore
+%D cannot simply ignore \type{(} and \type{)}, the way we do
+%D with \type{[} and \type{]}. Another complication is that
+%D strings may contain characters that normally have a
+%D special meaning in \TEX, like \type{$} and \type{{}}.
+%D
+%D A previous solution made \type{\} an active character and
+%D let it look ahead for a number or characters. We had to
+%D abandon this scheme because of the need for verbatim
+%D support. The next solution involved some \CATCODE\
+%D trickery but works well.
+
+\def\octalMPcharacter#1#2#3%
+ {\char'#1#2#3\relax}
+
+%D curly braces and squarly brackets are stored in the argument stack
+%D as part of strings, for instance in:
+%D
+%D \starttyping
+%D /fshow {exch findfont exch scalefont setfont show}bind def
+%D [3 3 ] 0 setdash
+%D \stoptyping
+%D
+%D but we need to keep them in situation like
+%D
+%D \starttyping
+%D ([bla bla] bla bla) ec-lmr10 9.96265 fshow
+%D ({bla bla} bla bla) ec-lmr10 9.96265 fshow
+%D \stoptyping
+%D
+%D So, when we store the snippets, we keep the special tokens, and
+%D when needed we either ignore or obey them
+
+\bgroup
+\catcode`\|=\@@comment
+\catcode`\%=\@@active
+\catcode`\[=\@@active
+\catcode`\]=\@@active
+\catcode`\{=\@@active
+\catcode`\}=\@@active
+\catcode`B=\@@begingroup
+\catcode`E=\@@endgroup
+\gdef\keepMPspecials|
+ B\let%\letterpercent|
+ \def[B\noexpand[E|
+ \def]B\noexpand]E|
+ \def{B\noexpand{E|
+ \def}B\noexpand}EE
+\gdef\ignoreMPspecials|
+ B\let%\letterpercent|
+ \def[BE|
+ \def]BE|
+ \def{BE|
+ \def}BEE
+\gdef\obeyMPspecials|
+ B\def%B\char 37\relax E|
+ \def[B\char 91\relax E|
+ \def]B\char 93\relax E|
+ \def{B\char123\relax E|
+ \def}B\char125\relax EE
+\gdef\setMPspecials|
+ B\setnaturalcatcodes
+ \catcode`\\=\@@escape
+ \catcode`\%=\@@active
+ \catcode`\[=\@@active
+ \catcode`\]=\@@active
+ \catcode`\{=\@@active
+ \catcode`\}=\@@active
+ \lccode`\-=0 | latex sets this to `\-
+ \lccode`\%=`\% | otherwise it's seen as a number
+ \def\(B\char40\relax E|
+ \def\)B\char41\relax E|
+ \def\\B\char92\relax E|
+ \def\0B\octalMPcharacter0E|
+ \def\1B\octalMPcharacter1E|
+ \def\2B\octalMPcharacter2E|
+ \def\3B\octalMPcharacter3E|
+ \def\4B\octalMPcharacter4E|
+ \def\5B\octalMPcharacter5E|
+ \def\6B\octalMPcharacter6E|
+ \def\7B\octalMPcharacter7E|
+ \def\8B\octalMPcharacter8E|
+ \def\9B\octalMPcharacter9EE
+\egroup
+
+%D We use the comment symbol as a sort of trigger. Beware!
+%D The whole graphic is seen as on eparagraph, which means
+%D that we cannot change the catcodes in between.
+
+\bgroup
+\catcode`\%=\@@active
+\gdef\startMPscanning{\let%=\startMPconversion}
+\egroup
+
+%D In earlier versions we used the sequence
+%D
+%D \starttyping
+%D \expandafter\handleMPsequence\input filename\relax
+%D \stoptyping
+%D
+%D Persistent problems in \LATEX\ however forced us to use a
+%D different scheme. Every \POSTSCRIPT\ file starts with a
+%D \type{%}, so we temporary make this an active character
+%D that starts the scanning and redefines itself. (The problem
+%D originates in the redefinition by \LATEX\ of the
+%D \type{\input} primitive.)
+
+\def\startMPconversion
+ {\keepMPspecials
+ \handleMPsequence}
+
+%D Here comes the main loop. Most arguments are numbers. This
+%D means that they can be recognized by their \type{\lccode}.
+%D This method saves a lot of processing time. We could
+%D speed up the conversion by handling the \type{path}
+%D seperately.
+
+\def\@EAEAEA{\expandafter\expandafter\expandafter} % to be sure
+
+\def\dohandleMPsequence#1%
+ {\ifdone
+ \ifcase\lccode`#1\relax
+ \@EAEAEA\dohandleMPsequenceA
+ \else
+ \@EAEAEA\dohandleMPsequenceB
+ \fi
+ \else
+ \@EA\dohandleMPsequenceC
+ \fi#1}
+
+\let\dohandleMPsequenceA\setMPsequence
+
+\def\dohandleMPsequenceB#1 %
+ {\edef\somestring{#1}%
+ \ifx\somestring\PSmoveto
+ \edef\lastMPmoveX{\gMPa1}%
+ \edef\lastMPmoveY{\gMPa2}%
+ \PDFcode{\!MPgMPa1 \!MPgMPa2 m}%
+ \resetMPstack
+ \else\ifx\somestring\PSnewpath
+ \let\handleMPsequence\handleMPpath
+ \else\ifx\somestring\PSgsave
+ \PDFcode{q}%
+ \resetMPstack
+ \else\ifx\somestring\PSgrestore
+ \PDFcode{Q}%
+ \resetMPstack
+ \else\ifx\somestring\PSdtransform % == setlinewidth
+ \let\handleMPsequence\handleMPdtransform
+ % after that we will encounter more tokens until setlinewidth+pop
+ % or pop+setlinewidth which we catch next; we explicitly need to
+ % reset the stack since [] n setdash may follow; a more clever
+ % approach would be to read on till the condition is met, but it's
+ % the only pop / setlinewidth we will encounter so ...
+ \else\ifx\somestring\PSsetlinewidth
+ % already handled in dtransform
+ \resetMPstack
+ \else\ifx\somestring\PSpop
+ % already handled in dtransform
+ \resetMPstack
+ \else\ifx\somestring\PSconcat
+ \cleanupMPconcat
+ \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}%
+ \resetMPstack
+ \else\ifx\somestring\PSsetrgbcolor
+ \handleMPrgbcolor
+ \resetMPstack
+ \else\ifx\somestring\PSsetcmykcolor
+ \handleMPcmykcolor
+ \resetMPstack
+ \else\ifx\somestring\PSsetgray
+ \handleMPgraycolor
+ \resetMPstack
+ \else\ifx\somestring\PStranslate
+ \PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}%
+ \resetMPstack
+ \else\ifx\somestring\PSsetdash
+ \handleMPsetdash
+ \resetMPstack
+ \else\ifx\somestring\PSsetlinejoin
+ \PDFcode{\gMPa1 j}%
+ \resetMPstack
+ \else\ifx\somestring\PSsetmiterlimit
+ \PDFcode{\gMPa1 M}%
+ \resetMPstack
+ \else\ifx\somestring\PSfshow
+ \PDFcode{n}%
+ \handleMPfshow
+ \resetMPstack
+ \else\ifx\somestring\PSsetlinecap
+ \PDFcode{\gMPa1 J}%
+ \resetMPstack
+ \else\ifx\somestring\PSrlineto
+ \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
+ \resetMPstack
+ \else\ifx\somestring\PSscale
+ \PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}%
+ \resetMPstack
+ \else\ifx\somestring\PSspecial
+ \handleMPspecialcommand
+ \resetMPstack
+ \else
+ \handleMPgraphic% {#1}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \handleMPsequence}
+
+\def\dohandleMPsequenceC#1 %
+ {\edef\somestring{#1}%
+ \handleMPgraphic % {#1}%
+ \handleMPsequence}
+
+%D Since colors are not sensitive to transformations, they
+%D are sometimes used for signaling. Therefore, we handle them
+%D separately. The next macro can be redefined if needed.
+
+\def\handleMPrgbcolor
+ {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 rg
+ \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 RG}}
+
+\def\handleMPcmykcolor
+ {\PDFcode{\!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 k
+ \!MPgMPa1 \!MPgMPa2 \!MPgMPa3 \!MPgMPa4 K}}
+
+\def\handleMPgraycolor
+ {\PDFcode{\!MPgMPa1 g
+ \!MPgMPa1 G}}
+
+\def\handleMPspotcolor
+ {\PDFcode{0 g
+ 0 G}}
+
+%D Beginning and ending the graphics is taken care of by the
+%D macro \type{\handleMPgraphic}, which is redefined when
+%D the first graphics operator is met.
+
+\def\handleMPendgraphic % #1%
+ {\ifx\somestring\PSshowpage
+ \let\handleMPsequence\finishMPgraphic
+ \else
+ \letMPargument\somestring % {#1}%
+ \fi}
+
+\def\handleMPbegingraphic % #1%
+ {\ifx\somestring\PSBoundingBox
+ \def\handleMPsequence{\handleMPboundingbox1}%
+ \else\ifx\somestring\PSHiResBoundingBox
+ \def\handleMPsequence{\handleMPboundingbox2}%
+ \else\ifx\somestring\PSExactBoundingBox
+ \def\handleMPsequence{\handleMPboundingbox3}%
+ \else\ifx\somestring\PSshowpage
+ \let\handleMPsequence\finishMPgraphic
+ \else\ifx\somestring\PSPage
+ \let\handleMPsequence\handleMPpage
+ \else\ifx\somestring\PSMetaPostSpecials
+ \let\handleMPsequence\handleMPspecialscomment
+ \else\ifx\somestring\PSMetaPostSpecial
+ \let\handleMPsequence\handleMPspecialcomment
+ \else
+ \letMPargument\somestring % {#1}%
+ \fi\fi\fi\fi\fi\fi\fi}
+
+\let\handleMPgraphic=\handleMPbegingraphic
+
+%D We check for three kind of bounding boxes: the normal one
+%D and two high precision ones:
+%D
+%D \starttyping
+%D BoundingBox: llx lly ucx ucy
+%D HiResBoundingBox: llx lly ucx ucy
+%D ExactBoundingBox: llx lly ucx ucy
+%D \stoptyping
+%D
+%D The original as well as the recalculated dimensions are
+%D saved for later use.
+
+\newif\ifskipemptyMPgraphic \skipemptyMPgraphicfalse
+
+\chardef\currentMPboundingbox=0
+
+\def\handleMPboundingbox#1#2 #3 #4 #5
+ {\ifnum#1>\currentMPboundingbox
+ \xdef\MPllx{#2}\xdef\MPlly{#3}%
+ \xdef\MPurx{#4}\xdef\MPury{#5}%
+ \dimen0=#2\onepoint
+ \dimen0=-\MPxscale\dimen0
+ \dimen2=#3\onepoint
+ \dimen2=-\MPyscale\dimen2
+ \xdef\MPxoffset{\withoutpt\the\dimen0}%
+ \xdef\MPyoffset{\withoutpt\the\dimen2}%
+ \dimen0=#2\onebasepoint
+ \dimen0=-\dimen0
+ \dimen2=#3\onebasepoint
+ \dimen2=-\dimen2
+ \advance\dimen0 #4\onebasepoint
+ \dimen0=\MPxscale\dimen0
+ \xdef\MPwidth{\the\dimen0}%
+ \advance\dimen2 #5\onebasepoint
+ \xdef\MPyshift{\the\dimen2}% unscaled
+ \dimen2=\MPyscale\dimen2
+ \xdef\MPheight{\the\dimen2}%
+ \chardef\currentMPboundingbox#1\relax
+ \fi
+ \doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \let\next\handleMPsequence
+ \ifskipemptyMPgraphic
+ \ifdim\MPheight=\zeropoint\relax\ifdim\MPwidth=\zeropoint\relax
+ \def\next{\endinput\finishMPgraphic}%
+ \fi\fi
+ \fi
+ \next}
+
+%D Unless defined otherwise, we simply ignore specialcomments.
+
+\def\handleMPspecialcomment
+ {\doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \handleMPsequence}
+
+\let\handleMPspecialscomment\handleMPspecialcomment
+
+%D We use the \type{page} comment as a signal that
+%D stackbuilding can be started.
+
+\def\handleMPpage #1 #2
+ {\doresetMPstack
+ \donetrue
+ \let\handleMPsequence\dohandleMPsequence
+ \handleMPsequence}
+
+%D The same applies to the special extensions.
+
+\def\handleMPspecialcommand
+ {\doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \handleMPsequence}
+
+%D \METAPOST\ draws its dots by moving to a location and
+%D invoking \type{0 0 rlineto}. This operator is not
+%D available in \PDF. Our solution is straightforward: we draw
+%D a line from $(current\_x, current\_y)$ to itself. This
+%D means that the arguments of the preceding \type{moveto} have
+%D to be saved.
+
+\def\lastMPmoveX{0}
+\def\lastMPmoveY{0}
+
+%D These saved coordinates are also used when we handle the
+%D texts. Text handling proved to be a bit of a nuisance, but
+%D finally I saw the light. It proved that we also had to
+%D take care of \type{(split arguments)}.
+
+\def\setMPfshowfont#1#2%
+ {\font\temp=#1\space at #2\relax\temp}
+
+\let\MPfshowcommand\empty
+
+% \def\dohandleMPfshow
+% {\bgroup
+% \setbox\scratchbox\hbox
+% {\obeyMPspecials
+% \let\ \relax % mp breaks long lines and appends a \
+% \edef\size{\gMPa\nofMParguments}%
+% \ifx\size\PSnfont % round font size (to pt)
+% \advance\nofMParguments \minusone
+% \expandafter\scratchdimen\gMPa\nofMParguments\onepoint\relax
+% \ifdim\scratchdimen<\onepoint
+% \def\size{1pt}%
+% \else
+% \advance\scratchdimen .5\onepoint
+% \def\size##1.##2\relax{\def\size{##1pt}}%
+% \expandafter\size\the\scratchdimen\relax
+% \fi
+% \else
+% \edef\size{\size bp}%
+% \fi
+% \advance\nofMParguments \minusone
+% %\font\temp=\gMPa\nofMParguments\space at \size
+% \let\temp\relax % to be sure
+% \setMPfshowfont{\gMPa\nofMParguments}\size
+% \advance\nofMParguments \minusone
+% \temp
+% \MPfshowcommand
+% {\ifnum\nofMParguments=\plusone
+% \def\do(##1){##1}%
+% \dogMPa1%
+% \else
+% % we need to catch ( a ) (a a a) (\123 \123 \123) etc
+% \scratchcounter\plusone
+% \def\dodo##1% Andreas Fieger's bug: (\304...)
+% {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
+% \ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}%
+% \def\do(##1{\dodo{##1}}%
+% \dogMPa\scratchcounter\MPspacechar
+% \let\do\relax
+% \loop
+% \advance\scratchcounter \plusone
+% \ifnum\scratchcounter<\nofMParguments\relax
+% \gMPa\scratchcounter\MPspacechar
+% \repeat
+% \def\do##1){\dodo{##1}}%
+% \dogMPa\scratchcounter
+% \fi
+% \unskip}}%
+% %
+% % this fails in some versions of pdftex
+% %
+% % \dimen0=\lastMPmoveY bp
+% % \advance\dimen0 by \ht0
+% % \ScaledPointsToBigPoints{\number\dimen0}\lastMPmoveY
+% % \PDFcode{n q 1 0 0 1 \lastMPmoveX\space\lastMPmoveY\space cm}%
+% % \dimen0=\ht0
+% % \advance\dimen0 by \dp0
+% % \box0
+% % \vskip-\dimen0
+% % \PDFcode{Q}%
+% % \egroup}
+% %
+% \setbox\scratchbox\hbox
+% {\hskip\lastMPmoveX\onebasepoint\raise\lastMPmoveY\onebasepoint\box\scratchbox}%
+% \ht\scratchbox\zeropoint
+% \dp\scratchbox\zeropoint
+% \wd\scratchbox\zeropoint
+% \box\scratchbox
+% \egroup}
+%
+% \let\handleMPfshow\dohandleMPfshow % so we can overload this one later
+%
+% we will support plug-ins:
+
+\def\dohandleMPfshow
+ {\setbox\scratchbox\hbox
+ {\obeyMPspecials
+ \edef\MPtextsize{\gMPa\nofMParguments}%
+ \def\do(##1){##1}%
+ \edef\MPtextdata{\dogMPa1}% beware, stack can have more
+ \handleMPtext}%
+ \setbox\scratchbox\hbox
+ {\hskip\lastMPmoveX\onebasepoint\raise\lastMPmoveY\onebasepoint
+ \box\scratchbox}%
+ %
+ % this fails in some versions of pdftex
+ %
+ % \dimen0=\lastMPmoveY bp
+ % \advance\dimen0 by \ht0
+ % \ScaledPointsToBigPoints{\number\dimen0}\lastMPmoveY
+ % \PDFcode{n q 1 0 0 1 \lastMPmoveX\space\lastMPmoveY\space cm}%
+ % \dimen0=\ht0
+ % \advance\dimen0 by \dp0
+ % \box0
+ % \vskip-\dimen0
+ % \PDFcode{Q}%
+ % \egroup}
+ %
+ \ht\scratchbox\zeropoint
+ \dp\scratchbox\zeropoint
+ \wd\scratchbox\zeropoint
+ \box\scratchbox}
+
+\def\handleMPtext {\handleMPtextnormal} % so we can overload this one later
+\def\handleMPfshow{\dohandleMPfshow } % so we can overload this one later
+
+\def\handleMPtext
+ {\ifnum\nofMParguments>\plusthree
+ \handleMPtextnormal
+ \else
+ \convertcommand\MPtextdata\to\MPtextdata
+ \expanded{\splitstring\MPtextdata}\at::::\to\MPtexttag\and\MPtextnumber
+ \executeifdefined{handleMPtext\MPtexttag}\handleMPtextnormal
+ \fi}
+
+% elsewhere we will implement \handleMPtextmptxt
+
+\def\handleMPtextnormal
+ {\let\ \relax % mp breaks long lines and appends a \
+ \ifx\MPtextsize\PSnfont % round font size (to pt)
+ \advance\nofMParguments \minusone
+ \expandafter\scratchdimen\gMPa\nofMParguments\onepoint\relax
+ \ifdim\scratchdimen<\onepoint
+ \def\MPtextsize{1pt}%
+ \else
+ \advance\scratchdimen .5\onepoint
+ \def\MPtextsize##1.##2\relax{\def\MPtextsize{##1pt}}%
+ \expandafter\MPtextsize\the\scratchdimen\relax
+ \fi
+ \else
+ \edef\MPtextsize{\MPtextsize bp}%
+ \fi
+ \advance\nofMParguments \minusone
+ \font\temp=\gMPa\nofMParguments\space at \MPtextsize
+ \let\temp\relax % to be sure
+ \setMPfshowfont{\gMPa\nofMParguments}\MPtextsize
+ \advance\nofMParguments \minusone
+ \temp
+ \MPfshowcommand
+ {\ifnum\nofMParguments=\plusone
+ \def\do(##1){##1}%
+ \dogMPa1%
+ \else
+ % we need to catch ( a ) (a a a) (\123 \123 \123) etc
+ \scratchcounter\plusone
+ \def\dodo##1% Andreas Fieger's bug: (\304...)
+ {\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
+ \ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}%
+ \def\do(##1{\dodo{##1}}%
+ \dogMPa\scratchcounter\MPspacechar
+ \let\do\relax
+ \loop
+ \advance\scratchcounter \plusone
+ \ifnum\scratchcounter<\nofMParguments\relax
+ \gMPa\scratchcounter\MPspacechar
+ \repeat
+ \def\do##1){\dodo{##1}}%
+ \dogMPa\scratchcounter
+ \fi
+ \unskip}}
+
+%D You could consider the following definition to be the most
+%D natural one.
+
+% \def\MPspacechar{\space} % normal case
+
+\def\MPspacechar{\char32\relax} % old solution does not work with math
+
+%D However, the following implementation is more robust, since
+%D some fonts have funny visible spaces in the space slot. This
+%D gives a mismatch between the space that \METAPOST\ took into
+%D account and the \quote {natural} space. This only happens in
+%D labels, since \type {btex}||\type {etex} thingies don't have
+%D spaces. This phenomena showed up when preparing the
+%D \METAFUN\ manual, where Palatino fonts are used. We can
+%D safely assume that \METAPOST\ considers \type {\char32} to
+%D be the space.
+
+\def\MPspacechar{\setbox\scratchbox\hbox{\char32}\kern\wd\scratchbox}
+
+%D Well, this does not work with math fonts, so:
+
+\def\MPspacechar{\char32\relax}
+
+%D Most operators are just converted and keep their
+%D arguments. Dashes however need a bit different treatment,
+%D otherwise \PDF\ viewers complain loudly. Another
+%D complication is that one argument comes after the \type{]}.
+%D When reading the data, we simply ignore the array boundary
+%D characters. We save ourselves some redundant newlines and
+%D at the same time keep the output readable by packing the
+%D literals.
+
+\def\handleMPsetdash
+ {\bgroup
+ \ignoreMPspecials
+ \def\somestring{[}%
+ \scratchcounter\plusone
+ \loop
+ \ifnum\scratchcounter<\nofMParguments
+ \edef\somestring{\somestring\space\gMPa\scratchcounter}%
+ \advance\scratchcounter \plusone
+ \repeat
+ \edef\somestring{\somestring]\gMPa\scratchcounter\space d}%
+ \PDFcode{\somestring}%
+ \egroup}
+
+%D The \type{setlinewidth} commands looks a bit complicated. There are
+%D two alternatives, that result in a similar look in both
+%D $x$- and $y$-dorection. As John Hobby says:
+%D
+%D \startnarrower \switchtobodyfont[ss]
+%D \starttyping
+%D x 0 dtransform exch truncate exch idtransform pop setlinewidth
+%D 0 y dtransform truncate idtransform setlinewidth pop
+%D \stoptyping
+%D
+%D These are just fancy versions of \type{x setlinewidth} and
+%D \type{y setlinewidth}. The \type{x 0 ...} form is used if
+%D the path is {\em primarily vertical}. It rounds the width
+%D so that vertical lines come out an integer number of pixels
+%D wide in device space. The \type{0 y ...} form does the same
+%D for paths that are {\em primarily horizontal}. The reason
+%D why I did this is Knuth insists on getting exactly the
+%D widths \TEX\ intends for the horizontal and vertical rules
+%D in \type{btex...etex} output. (Note that PostScript scan
+%D conversion rules cause a horizontal or vertical line of
+%D integer width $n$ in device space to come out $n+1$ pixels
+%D wide, regardless of the phase relative to the pixel grid.)
+%D \stopnarrower
+%D
+%D The common operator in these sequences is \type{dtransform},
+%D so we can use this one to trigger setting the linewidth.
+
+\def\handleMPdtransform
+ {\ifdim\gMPa1\onepoint>\zeropoint
+ \PDFcode{\gMPa1 w}%
+ \def\next##1 ##2 ##3 ##4 ##5 ##6 {\handleMPsequence}%
+ \else
+ \PDFcode{\gMPa2 w}%
+ \def\next##1 ##2 ##3 ##4 {\handleMPsequence}%
+ \fi
+ \let\handleMPsequence\dohandleMPsequence
+ \resetMPstack
+ \next}
+
+%D The most complicated command is \type{concat}. \METAPOST\
+%D applies this operator to \type{stroke}. At that moment the
+%D points set by \type{curveto} and \type{moveto}, are already
+%D fixed. In \PDF\ however the \type{cm} operator affects the
+%D points as well as the pen (stroke). Like more \PDF\
+%D operators, \type{cm} is defined in a bit ambiguous way.
+%D The only save route for non||circular penshapes, is saving
+%D the path, recalculating the points and applying the
+%D transformation matrix in such a way that we can be sure
+%D that its behavior is well defined. This comes down to
+%D inverting the path and applying \type{cm} to that path as
+%D well as the pen. This all means that we have to save the
+%D path.
+
+%D In \METAPOST\ there are three ways to handle a path $p$:
+%D
+%D \starttyping
+%D draw p; fill p; filldraw p;
+%D \stoptyping
+%D
+%D The last case outputs a \type{gsave fill grestore} before
+%D \type{stroke}. Handling the path outside the main loops
+%D saves about 40\% run time.\footnote{We can save some more by
+%D following the \METAPOST\ output routine, but for the moment
+%D we keep things simple.} Switching between the main loop and
+%D the path loop is done by means of the recursely called
+%D macro \type{\handleMPsequence}.
+
+\def\handleMPpath
+ {\chardef\finiMPpath0
+ \let\closeMPpath\relax
+ \let\flushMPpath\flushnormalMPpath
+ \resetMPstack
+ \nofMPsegments\plusone
+ \let\handleMPsequence\dohandleMPpath
+ \dohandleMPpath}
+
+%D Most paths are drawn with simple round pens. Therefore we've
+%D split up the routine in two.
+
+\def\flushnormalMPsegment
+ {\ifcase\getMPkeyword\relax
+ \PDFcode{\!MPgMPs1 \!MPgMPs2 l}%
+ \or
+ \PDFcode{\!MPgMPs1 \!MPgMPs2 \!MPgMPs3 \!MPgMPs4 \!MPgMPs5 \!MPgMPs6 c}%
+ \or
+ \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
+ \or
+ \edef\lastMPmoveX{\gMPs1}% evt \!MP here
+ \edef\lastMPmoveY{\gMPs2}%
+ \PDFcode{\!MP\lastMPmoveX\space \!MP\lastMPmoveY\space m}%
+ \fi}
+
+\def\flushconcatMPsegment
+ {\ifcase\getMPkeyword\relax
+ \doMPconcat{\gMPs1}\a{\gMPs2}\b%
+ \PDFcode{\!MP\a\space\!MP\b\space l}%
+ \or
+ \doMPconcat{\gMPs1}\a{\gMPs2}\b%
+ \doMPconcat{\gMPs3}\c{\gMPs4}\d%
+ \doMPconcat{\gMPs5}\e{\gMPs6}\f%
+ \PDFcode{\!MP\a\space\!MP\b\space
+ \!MP\c\space\!MP\d\space
+ \!MP\e\space\!MP\f\space c}%
+ \or
+ \bgroup
+ \noMPtranslate
+ \doMPconcat\lastMPmoveX\a\lastMPmoveY\b%
+ \PDFcode{\!MP\a\space\!MP\b\space l S}%
+ \egroup
+ \or
+ \edef\lastMPmoveX{\gMPs1}%
+ \edef\lastMPmoveY{\gMPs2}%
+ \doMPconcat\lastMPmoveX\a\lastMPmoveY\b%
+ \PDFcode{\!MP\a\space\!MP\b\space m}%
+ \fi}
+
+\def\doflushsomeMPpath
+ {\dodoflushsomeMPpath
+ \advance\nofMPsegments \plusone
+ \ifnum\nofMPsegments<\scratchcounter
+ \expandafter\doflushsomeMPpath
+ \fi}
+
+\def\flushsomeMPpath
+ {\scratchcounter\nofMPsegments
+ \nofMPsegments\plusone
+ \doflushsomeMPpath}
+
+\def\flushnormalMPpath{\let\dodoflushsomeMPpath\flushnormalMPsegment\flushsomeMPpath}
+
+%OLD \def\flushconcatMPpath{\let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath}
+
+%NEW pre-calculate 1/D so it needn't be repeated for each control point.
+
+\def\flushconcatMPpath
+ {\MPreciprocaldeterminant
+ \let\dodoflushsomeMPpath\flushconcatMPsegment\flushsomeMPpath}
+
+%D The transformation of the coordinates is handled by one of
+%D the macros Tanmoy posted to the \PDFTEX\ mailing list.
+%D I rewrote and optimized the original macro to suit the other
+%D macros in this module.
+%D
+%D \starttyping
+%D \doMPconcat {x position} \xresult {y position} \yresult
+%D \stoptyping
+%D
+%D By setting the auxiliary \DIMENSIONS\ \type{\dimen0} upto
+%D \type{\dimen10} only once per path, we save over 20\% run
+%D time. Some more speed was gained by removing some parameter
+%D passing. These macros can be optimized a bit more by using
+%D more constants. There is however not much need for further
+%D optimization because penshapes usually are round and
+%D therefore need no transformation. Nevertheless we move the
+%D factor to the outer level and use a bit different \type{pt}
+%D removal macro. Although the values represent base points,
+%D we converted them to pure points, simply because those can
+%D be converted back.
+
+%OLD \mathchardef\MPconcatfactor=256 % beware don't remove spaces before it
+
+%OLD \def\doMPreducedimen#1
+%OLD {\count0\MPconcatfactor
+%OLD \advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\count0
+%OLD \divide\dimen#1 \count0\relax}
+
+%OLD % too inaccurate (see old pragma logo)
+%OLD
+%OLD \def\doMPreducedimen#1
+%OLD {\count0=\MPconcatfactor
+%OLD \divide\dimen#1 \count0\relax}
+
+%OLD \def\doMPreducedimen#1
+%OLD {\advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\MPconcatfactor
+%OLD \divide\dimen#1 \MPconcatfactor}
+
+%D The transformation code is rewritten by Daniel H. Luecking who
+%D describes his patch as follows:
+%D
+%D We would like to divide 1 by $X$, but all divisions are integer so
+%D for accuracy we want to convert to large integers and make sure the
+%D integer quotient has as many significant digits as possible. Thus we
+%D need to replace $1/X$ with $M/N$ where $N$ is as large as possible
+%D and $M/N$ is as large as possible. Also for simplicity $M$ should be
+%D a power of 2. So we make $M = 2^{30}$ \footnote{$2^{31} - 1$ is the
+%D largest legal integer. Using it (and simply ignoring the inaccuracy
+%D caused by $-1$) turns out to be at least as accurate in all cases,
+%D and more accurate in some.} (largest legal power of 2) and adjust
+%D $X$ downward (if necessary) to the the range $1-2^{16}$. This gives
+%D at least 15 significant binary digits, (almost as accurate as
+%D \METAPOST\ for numbers near 1) or almost 5 significant figures
+%D (decimal).
+
+\newcount\MPscratchCnt
+\newdimen\MPscratchDim % will be assigned global
+
+\def\MPadjustdimen % sets \MPscratchDim and \MPscratchCnt
+ {\MPscratchCnt\zerocount
+ \doMPadjustdimen}
+
+\def\doMPadjustdimen
+ {\ifdim\MPscratchDim>\onepoint
+ \divide\MPscratchDim 2
+ \advance\MPscratchCnt \plusone
+ \expandafter\doMPadjustdimen
+ \fi}
+
+%OLD \def\doMPexpanddimen#1
+%OLD {\multiply\dimen#1 \MPconcatfactor\relax}
+
+%D DHL: When viewed as an integer, $1 \hbox{pt}=2^{16}$ so $2^{32}/X$
+%D is the right way to do $(1 \hbox{pt})/(X \hbox{pt})$ and get the
+%D answer in points. But we are limited to $2^{30}/X$. However, we
+%D actually do $[ 2^{30} / (X/2^K) ]*2^{2-K}$ where $K$ is the number
+%D of halvings it takes to bring $X$ below $1 \hbox{pt}$. If $K$ is 0
+%D or 1 we readjust by multiplying by 4 or 2, otherwise by halving
+%D $(K-2)$ times \type {\MPscratchCnt} holds the value of $K$ from
+%D \type {\MPadjustdimen}.
+
+\def\MPreadjustdimen % acts on \MPscratchDim and MPscratchCnt
+ {\ifcase\MPscratchCnt
+ \multiply\scratchdimen 4
+ \or
+ \multiply\scratchdimen 2
+ \else
+ \expandafter\doMPreadjustdimen
+ \fi}
+
+\def\doMPreadjustdimen
+ {\ifnum\MPscratchCnt>2
+ \divide\scratchdimen 2
+ \advance\MPscratchCnt \minusone
+ \expandafter\doMPreadjustdimen
+ \fi}
+
+\def\MPreciprocaldeterminant
+ {\scratchdimen\withoutpt\the\dimen0 \dimen6 % s_x*s_y
+ \advance\scratchdimen - \withoutpt\the\dimen2 \dimen4 % s_x*s_y - r_x*r_y
+ \ifdim\scratchdimen<\zeropoint % we need a positive dimension
+ \scratchdimen-\scratchdimen % for \MPadjustdimen (?)
+ \doMPreciprocal
+ \scratchdimen-\scratchdimen
+ \else
+ \doMPreciprocal
+ \fi
+ \edef\MPreciprocal{\withoutpt\the\scratchdimen}}
+
+\newcount\MPnumerator \MPnumerator = 1073741824 % 2^{30}
+
+% todo: dimexpr
+
+\def\doMPreciprocal % replace \scratchdimen with its reciprocal
+ {\ifdim\scratchdimen=\onepoint \else
+ \MPadjustdimen
+ \scratchcounter\MPnumerator
+ \divide\scratchcounter\scratchdimen
+ \scratchdimen1\scratchcounter % 1 needed !
+ \MPreadjustdimen
+ \fi}
+
+%OLD \def\presetMPconcat
+%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0 % r_x
+%OLD \dimen 2=\gMPs2\onepoint \doMPreducedimen 2 % s_x
+%OLD \dimen 4=\gMPs3\onepoint \doMPreducedimen 4 % s_y
+%OLD \dimen 6=\gMPs4\onepoint \doMPreducedimen 6 % r_y
+%OLD \dimen 8=\gMPs5\onepoint \doMPreducedimen 8 % t_x
+%OLD \dimen10=\gMPs6\onepoint \doMPreducedimen10 } % t_y
+%OLD
+%OLD \def\presetMPscale
+%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0
+%OLD \dimen 2 \zeropoint
+%OLD \dimen 4 \zeropoint
+%OLD \dimen 6=\gMPs2\onepoint \doMPreducedimen 6
+%OLD \dimen 8 \zeropoint
+%OLD \dimen10 \zeropoint}
+
+\def\cleanupMPconcat
+ {\ignoreMPspecials
+ \docleanupMPargument1%
+ \docleanupMPargument6%
+ \keepMPspecials}
+
+\def\presetMPconcat
+ {\dimen 0=\gMPs1\onepoint % s_x
+ \dimen 2=\gMPs2\onepoint % r_x
+ \dimen 4=\gMPs3\onepoint % r_y
+ \dimen 6=\gMPs4\onepoint % s_y
+ \dimen 8=\gMPs5\onepoint % t_x
+ \dimen10=\gMPs6\onepoint} % t_y
+
+\def\presetMPscale
+ {\dimen 0=\gMPs1\onepoint
+ \dimen 2 \zeropoint
+ \dimen 4 \zeropoint
+ \dimen 6=\gMPs2\onepoint
+ \dimen 8 \zeropoint
+ \dimen10 \zeropoint}
+
+\def\noMPtranslate % use this one grouped
+ {\dimen 8 \zeropoint % t_x
+ \dimen10 \zeropoint} % t_y
+
+%D \starttyping
+%D \def\doMPconcat#1#2#3#4%
+%D {\dimen12=#1 pt \doMPreducedimen12 % p_x
+%D \dimen14=#3 pt \doMPreducedimen14 % p_y
+%D %
+%D \dimen16 \dimen 0
+%D \multiply \dimen16 \dimen 6
+%D \dimen20 \dimen 2
+%D \multiply \dimen20 \dimen 4
+%D \advance \dimen16 -\dimen20
+%D %
+%D \dimen18 \dimen12
+%D \multiply \dimen18 \dimen 6
+%D \dimen20 \dimen14
+%D \multiply \dimen20 \dimen 4
+%D \advance \dimen18 -\dimen20
+%D \dimen20 \dimen 4
+%D \multiply \dimen20 \dimen10
+%D \advance \dimen18 \dimen20
+%D \dimen20 \dimen 6
+%D \multiply \dimen20 \dimen 8
+%D \advance \dimen18 -\dimen20
+%D %
+%D \multiply \dimen12 -\dimen 2
+%D \multiply \dimen14 \dimen 0
+%D \advance \dimen12 \dimen14
+%D \dimen20 \dimen 2
+%D \multiply \dimen20 \dimen 8
+%D \advance \dimen12 \dimen20
+%D \dimen20 \dimen 0
+%D \multiply \dimen20 \dimen10
+%D \advance \dimen12 -\dimen20
+%D %
+%D \doMPreducedimen16
+%D \divide \dimen18 \dimen16 \doMPexpanddimen18
+%D \divide \dimen12 \dimen16 \doMPexpanddimen12
+%D %
+%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
+%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
+%D \stoptyping
+
+%D The following optimization resulted from some tests by
+%D and email exchanges with Sanjoy Mahajan.
+%D
+%D \starttyping
+%D \def\doMPconcat#1#2#3#4%
+%D {\dimen12=#1 pt \doMPreducedimen12 % p_x
+%D \dimen14=#3 pt \doMPreducedimen14 % p_y
+%D %
+%D \dimen16 \dimen 0
+%D \multiply \dimen16 \dimen 6
+%D \dimen20 \dimen 2
+%D \multiply \dimen20 \dimen 4
+%D \advance \dimen16 -\dimen20
+%D %
+%D \dimen18 \dimen12
+%D \multiply \dimen18 \dimen 6
+%D \dimen20 \dimen14
+%D \multiply \dimen20 \dimen 4
+%D \advance \dimen18 -\dimen20
+%D \dimen20 \dimen 4
+%D \multiply \dimen20 \dimen10
+%D \advance \dimen18 \dimen20
+%D \dimen20 \dimen 6
+%D \multiply \dimen20 \dimen 8
+%D \advance \dimen18 -\dimen20
+%D %
+%D \multiply \dimen12 -\dimen 2
+%D \multiply \dimen14 \dimen 0
+%D \advance \dimen12 \dimen14
+%D \dimen20 \dimen 2
+%D \multiply \dimen20 \dimen 8
+%D \advance \dimen12 \dimen20
+%D \dimen20 \dimen 0
+%D \multiply \dimen20 \dimen10
+%D \advance \dimen12 -\dimen20
+%D %
+%D %\ifdim\dimen16>1pt % oeps, can be < 1pt too
+%D \ifdim\dimen16=1pt \else
+%D \ifdim\dimen16>\MPconcatfactor pt
+%D \doMPreducedimen16
+%D \divide \dimen18 \dimen16 \doMPexpanddimen18
+%D \divide \dimen12 \dimen16 \doMPexpanddimen12
+%D \else
+%D \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18
+%D \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12
+%D \fi
+%D \fi
+%D %
+%D \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
+%D \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
+%D \stoptyping
+%D
+%D But, this one is still too inaccurate, so we now have:
+
+%D We cannot use \type {\beginETEX} here since in plain we
+%D get \type {\outer} problems, sigh.
+
+%OLD \beginTEX
+%OLD
+%OLD \def\MPcriteriumA {512pt} % scale
+%OLD \def\MPcriteriumB {2pt} % scale
+%OLD
+%OLD \endTEX
+%OLD
+%OLD \ifx\MPcriteriumA\undefined
+%OLD
+%OLD \newdimen\MPcriteriumA \MPcriteriumA=512pt
+%OLD \newdimen\MPcriteriumB \MPcriteriumB= 2pt
+%OLD
+%OLD \fi
+
+%OLD \def\doMPconcat#1#2#3#4%
+%OLD {\dimen12=#1pt % p_x
+%OLD \dimen14=#3pt % p_y
+%OLD %
+%OLD \chardef\MPfactor\zerocount
+%OLD \ifdim\dimen4<\MPcriteriumB\ifdim\dimen4>-\MPcriteriumB
+%OLD \ifdim\dimen6<\MPcriteriumB\ifdim\dimen6>-\MPcriteriumB
+%OLD \ifdim\dimen8<\MPcriteriumB\ifdim\dimen8>-\MPcriteriumB
+%OLD \ifdim\dimen10<\MPcriteriumB\ifdim\dimen10>-\MPcriteriumB
+%OLD \chardef\MPfactor\plusone
+%OLD \fi\fi
+%OLD \fi\fi
+%OLD \fi\fi
+%OLD \fi\fi
+%OLD \ifcase\MPfactor % spurious 0 removed
+%OLD \chardef\MPfactor\plusone
+%OLD \ifdim\dimen12<\MPcriteriumA\ifdim\dimen12>-\MPcriteriumA
+%OLD \ifdim\dimen14<\MPcriteriumA\ifdim\dimen14>-\MPcriteriumA
+%OLD \chardef\MPfactor16
+%OLD \fi\fi
+%OLD \fi\fi
+%OLD \fi
+%OLD %
+%OLD \multiply\dimen12 \MPfactor
+%OLD \multiply\dimen14 \MPfactor
+%OLD %
+%OLD \doMPreducedimen12
+%OLD \doMPreducedimen14
+%OLD %
+%OLD \dimen16 \dimen 0
+%OLD \multiply \dimen16 \dimen 6
+%OLD \dimen20 \dimen 2
+%OLD \multiply \dimen20 \dimen 4
+%OLD \advance \dimen16 -\dimen20
+%OLD %
+%OLD \dimen18 \dimen12
+%OLD \multiply \dimen18 \dimen 6
+%OLD \dimen20 \dimen14
+%OLD \multiply \dimen20 \dimen 4
+%OLD \advance \dimen18 -\dimen20
+%OLD \dimen20 \dimen 4
+%OLD \multiply \dimen20 \dimen10
+%OLD \advance \dimen18 \dimen20
+%OLD \dimen20 \dimen 6
+%OLD \multiply \dimen20 \dimen 8
+%OLD \advance \dimen18 -\dimen20
+%OLD %
+%OLD \multiply \dimen12 -\dimen 2
+%OLD \multiply \dimen14 \dimen 0
+%OLD \advance \dimen12 \dimen14
+%OLD \dimen20 \dimen 2
+%OLD \multiply \dimen20 \dimen 8
+%OLD \advance \dimen12 \dimen20
+%OLD \dimen20 \dimen 0
+%OLD \multiply \dimen20 \dimen10
+%OLD \advance \dimen12 -\dimen20
+%OLD %
+%OLD \ifdim\dimen16=\onepoint \else
+%OLD \ifdim\dimen16>\MPconcatfactor \onepoint \relax
+%OLD \doMPreducedimen16
+%OLD \divide \dimen18 \dimen16 \doMPexpanddimen18
+%OLD \divide \dimen12 \dimen16 \doMPexpanddimen12
+%OLD \else
+%OLD \divide \dimen18 \dimen16 \doMPexpanddimen18 \doMPexpanddimen18
+%OLD \divide \dimen12 \dimen16 \doMPexpanddimen12 \doMPexpanddimen12
+%OLD \fi
+%OLD \fi
+%OLD %
+%OLD \divide\dimen18 \MPfactor
+%OLD \divide\dimen12 \MPfactor
+%OLD %
+%OLD \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
+%OLD \edef#4{\withoutpt\the\dimen12}} % p_y^\prime
+
+%D DHL: Ideally, $r_x$, $r_y$, $s_x$, $s_y$ should be in macros, not
+%D dimensions (they are scalar quantities after all, not lengths). I
+%D suppose the authors decided to do calculations with integer
+%D arithmetic instead of using real factors because it's faster.
+%D However, the actual macros test slower, possibly because I've
+%D omitted three nested loops. In my test files, my approach is more
+%D accurate. It is also far simpler and overflow does not seem to be a
+%D significant concern. The scale factors written by Metapost are (?)
+%D always $<=1$ (it scales coordinates internally) and coordinates are
+%D always likely to be less than \type {\maxdimen}.
+%D
+%D If this should ever cause problems, the scale factors can be reduced.
+
+\def\doMPconcat#1#2#3#4%
+ {\dimen12=#1pt % p_x % #1\onepoint
+ \dimen14=#3pt % p_y % #3\onepoint
+ \advance\dimen12 -\dimen8 % p_x - t_x
+ \advance\dimen14 -\dimen10 % p_y - t_y
+ \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x)
+ \advance\dimen18 -\withoutpt\the\dimen4 \dimen14 % - r_y(p_y-t_y)
+ \dimen14=\withoutpt\the\dimen0 \dimen14 % s_x(p_y-t_y)
+ \advance\dimen14 -\withoutpt\the\dimen2 \dimen12 % - r_x(p_x-t_x)
+ % \MPreciprocal contains precomputed 1/D:
+ \dimen18=\MPreciprocal\dimen18
+ \dimen14=\MPreciprocal\dimen14
+ \edef#2{\withoutpt\the\dimen18}% % p_x^\prime
+ \edef#4{\withoutpt\the\dimen14}} % p_y^\prime
+
+% faster but not that often used
+%
+% \def\doMPconcat#1#2#3#4%
+% {\dimen12\dimexpr#1\points-\dimen 8\relax % p_x-t_x
+% \dimen14\dimexpr#3\points-\dimen10\relax % p_y-t_y
+% \dimen18\dimexpr\withoutpt\the\dimen6\dimen12-\withoutpt\the\dimen4\dimen14\relax % s_y(p_x-t_x)-r_y(p_y-t_y)
+% \dimen14\dimexpr\withoutpt\the\dimen0\dimen14-\withoutpt\the\dimen2\dimen12\relax % s_x(p_y-t_y)-r_x(p_x-t_x)
+% \edef#2{\withoutpt\the\dimexpr\MPreciprocal\dimen18\relax}% % p_x^\prime
+% \edef#4{\withoutpt\the\dimexpr\MPreciprocal\dimen14\relax}} % p_y^\prime
+
+%D One reason for Daniel to write this patch was that at small sizes
+%D the accuracy was less than optimal. Here is a test that demonstrates
+%D that his alternative is pretty good:
+%D
+%D \startlinecorrection
+%D \startMPcode
+%D for i = 5cm,1cm,5mm,1mm,.5mm,.1mm,.01mm :
+%D draw fullcircle scaled i withpen pencircle xscaled (i/10) yscaled (i/20) rotated 45 ;
+%D endfor ;
+%D \stopMPcode
+%D \stoplinecorrection
+
+%D The following explanation of the conversion process was
+%D posted to the \PDFTEX\ mailing list by Tanmoy. The original
+%D macro was part of a set of macro's that included sinus and
+%D cosinus calculations as well as scaling and translating. The
+%D \METAPOST\ to \PDF\ conversion however only needs
+%D transformation.
+
+%M \start \switchtobodyfont [ss]
+
+%D Given a point $(U_x, U_y)$ in user coordinates, the business
+%D of \POSTSCRIPT\ is to convert it to device space. Let us say
+%D that the device space coordinates are $(D_x, D_y)$. Then, in
+%D \POSTSCRIPT\ $(D_x, D_y)$ can be written in terms of
+%D $(U_x, U_y)$ in matrix notation, either as
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{D_x&D_y&1\cr} = \pmatrix{U_x&U_y&1\cr}
+%D \pmatrix{s_x&r_x&0\cr
+%D r_y&s_y&0\cr
+%D t_x&t_y&1\cr}
+%D \stopformula
+%D
+%D or
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x&r_y&t_x\cr
+%D r_x&s_y&t_y\cr
+%D 0 &0 &1 \cr}
+%D \pmatrix{U_x\cr
+%D U_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D both of which is a shorthand for the same set of equations:
+%D
+%D \placeformula
+%D \startformula
+%D D_x = s_x U_x + r_y U_y + t_x
+%D \stopformula
+%D
+%D \placeformula
+%D \startformula
+%D D_y = r_x U_x + s_y U_y + t_y
+%D \stopformula
+%D
+%D which define what is called an `affine transformation'.
+%D
+%D \POSTSCRIPT\ represents the `transformation matrix' as a
+%D six element matrix instead of a $3\times 3$ array because
+%D three of the elements are always~0, 0 and~1. Thus the above
+%D transformation is written in postscript as $[s_x\, r_x\,
+%D r_y\, s_y\, t_x\, t_y]$. However, when doing any
+%D calculations, it is useful to go back to the original
+%D matrix notation (whichever: I will use the second) and
+%D continue from there.
+%D
+%D As an example, if the current transformation matrix is
+%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$ and you say \typ{[a b
+%D c d e f] concat}, this means:
+%D
+%D \startnarrower
+%D Take the user space coordinates and transform them to an
+%D intermediate set of coordinates using array $[a\, b\, c\, d\,
+%D e\, f]$ as the transformation matrix.
+%D
+%D Take the intermediate set of coordinates and change them to
+%D device coordinates using array $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$
+%D as the transformation matrix.
+%D \stopnarrower
+%D
+%D Well, what is the net effect? In matrix notation, it is
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{I_x\cr I_y\cr 1\cr} = \pmatrix{a&c&e\cr
+%D b&d&f\cr
+%D 0&0&1\cr}
+%D \pmatrix{U_x\cr
+%D U_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{D_y\cr D_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr
+%D r_x&s_y&t_y\cr
+%D 0 &0 &1 \cr}
+%D \pmatrix{I_x\cr
+%D I_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D where $(I_x, I_y)$ is the intermediate coordinate.
+%D
+%D Now, the beauty of the matrix notation is that when there is
+%D a chain of such matrix equations, one can always compose
+%D them into one matrix equation using the standard matrix
+%D composition law. The composite matrix from two matrices can
+%D be derived very easily: the element in the $i$\high{th}
+%D horizontal row and $j$\high{th} vertical column is
+%D calculated by`multiplying' the $i$\high{th} row of the first
+%D matrix and the $j$\high{th} column of the second matrix (and
+%D summing over the elements). Thus, in the above:
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{D_x\cr D_y\cr 1} = \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr
+%D r_x^\prime&s_y^\prime&t_y^\prime\cr
+%D 0 &0 &0 \cr}
+%D \pmatrix{U_x\cr
+%D U_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D with
+%D
+%D \placeformula
+%D \startformula
+%D \eqalign
+%D {s_x^\prime & = s_x a + r_y b \cr
+%D r_x^\prime & = r_x a + s_y b \cr
+%D r_y^\prime & = s_x c + r_y d \cr
+%D s_y^\prime & = r_x c + s_y d \cr
+%D t_x^\prime & = s_x e + r_y f + t_x \cr
+%D t_y^\prime & = r_x e + s_y f + t_y \cr}
+%D \stopformula
+
+%D In fact, the same rule is true not only when one is going
+%D from user coordinates to device coordinates, but whenever
+%D one is composing two `transformations' together
+%D (transformations are `associative'). Note that the formula
+%D is not symmetric: you have to keep track of which
+%D transformation existed before (i.e.\ the equivalent of
+%D $[s_x\, r_x\, r_y\, s_y\, t_x\, t_y]$) and which was
+%D specified later (i.e.\ the equivalent of $[a\, b\, c\, d\,
+%D e\, f]$). Note also that the language can be rather
+%D confusing: the one specified later `acts earlier',
+%D converting the user space coordinates to intermediate
+%D coordinates, which are then acted upon by the pre||existing
+%D transformation. The important point is that order of
+%D transformation matrices cannot be flipped (transformations
+%D are not `commutative').
+%D
+%D Now what does it mean to move a transformation matrix
+%D before a drawing? What it means is that given a point
+%D $(P_x, P_y)$ we need a different set of coordinates
+%D $(P_x^\prime, P_y^\prime)$ such that if the transformation
+%D acts on $(P_x^\prime, P_y^\prime)$, they produce $(P_x,
+%D P_y)$. That is we need to solve the set of equations:
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{P_x\cr P_y\cr 1\cr} = \pmatrix{s_x&r_y&t_x\cr
+%D r_x&s_y&t_y\cr
+%D 0 &0 &1 \cr}
+%D \pmatrix{P_x^\prime\cr
+%D P_y^\prime\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D Again matrix notation comes in handy (i.e. someone has
+%D already solved the problem for us): we need the inverse
+%D transformation matrix. The inverse transformation matrix can
+%D be calculated very easily:
+%D
+%D \placeformula
+%D \startformula
+%D \pmatrix{P_x^\prime\cr P_y^\prime\cr 1\cr} =
+%D \pmatrix{s_x^\prime&r_y^\prime&t_x^\prime\cr
+%D r_x^\prime&s_y^\prime&t_y^\prime\cr
+%D 0 &0 &1 \cr}
+%D \pmatrix{P_x\cr
+%D P_y\cr
+%D 1 \cr}
+%D \stopformula
+%D
+%D where, the inverse transformation matrix is given by
+%D
+%D \placeformula
+%D \startformula
+%D \eqalign
+%D {D & = s_x s_y - r_x r_y \cr
+%D s_x^\prime & = s_y / D \cr
+%D s_y^\prime & = s_x / D \cr
+%D r_x^\prime & = - r_x / D \cr
+%D r_y^\prime & = - r_y / D \cr
+%D t_x^\prime & = ( - s_y t_x + r_y t_y ) / D \cr
+%D t_y^\prime & = ( r_x t_x - s_x t_y ) / D \cr}
+%D \stopformula
+%D
+%D And you can see that when expanded out, this does
+%D give the formulas:
+%D
+%D \placeformula
+%D \startformula
+%D P_x^\prime = { { s_y(p_x-t_x) + r_y(t_y-p_y) } \over
+%D { s_x s_y-r_x r_y } }
+%D \stopformula
+%D
+%D \placeformula
+%D \startformula
+%D P_y^\prime = { { s_x(p_y-t_y) + r_x(t_x-p_x) } \over
+%D { s_x*s_y-r_x*r_y } }
+%D \stopformula
+%D
+%D The code works by representing a real number by converting
+%D it to a dimension to be put into a \DIMENSION\ register: 2.3 would
+%D be represented as 2.3pt for example. In this scheme,
+%D multiplying two numbers involves multiplying the \DIMENSION\
+%D registers and dividing by 65536. Accuracy demands that the
+%D division be done as late as possible, but overflow
+%D considerations need early division.
+%D
+%D Division involves dividing the two \DIMENSION\ registers and
+%D multiplying the result by 65536. Again, accuracy would
+%D demand that the numerator be multiplied (and|/|or the
+%D denominator divided) early: but that can lead to overflow
+%D which needs to be avoided.
+%D
+%D If nothing is known about the numbers to start with (in
+%D concat), I have chosen to divide the 65536 as a 256 in each
+%D operand. However, in the series calculating the sine and
+%D cosine, I know that the terms are small (because I never
+%D have an angle greater than 45 degrees), so I chose to
+%D apportion the factor in a different way.
+
+%M \stop
+
+%D The path is output using the values saved on the stack. If
+%D needed, all coordinates are recalculated.
+
+\def\finishMPpath
+ {\PDFcode{\ifcase\finiMPpath W n\or S\or f\or B\fi}}
+
+\def\processMPpath
+ {\checkMPpath
+ \ifcase\nofMPsegments\else
+ \flushMPpath
+ \closeMPpath
+ \finishMPpath
+ \fi
+ \let\handleMPsequence\dohandleMPsequence
+ \resetMPstack
+ \nofMPsegments\zerocount
+ \handleMPsequence}
+
+%D The following \METAPOST\ code is quite valid but, when
+%D processed and converted to \PDF, will make a file
+%D unprintable on a Hewlett Packard printer (from Acrobat
+%D $v<=5$). Who is to blame, the driver of the OS layer in
+%D between, is hard to determine, so we add an additional
+%D check.
+%D
+%D \starttyping
+%D clip currentpicture to origin -- cycle ;
+%D setbounds currentpicture to fullsquare scaled 5cm ;
+%D \stoptyping
+
+\def\checkMPpath
+ {\ifcase\finiMPpath
+ \ifnum\nofMPsegments<3 % n is one ahead
+ \message{omitting zero clip path}%
+ \nofMPsegments\zerocount
+ \fi
+ \fi}
+
+%D In \PDF\ the \type{cm} operator must precede the path
+%D specification. We therefore can output the \type{cm} at
+%D the moment we encounter it.
+
+\def\handleMPpathconcat
+ {\presetMPconcat
+ \PDFcode{\gMPs1 \gMPs2 \gMPs3 \gMPs4 \gMPs5 \gMPs6 cm}%
+ \resetMPstack}
+
+\def\handleMPpathscale
+ {\presetMPscale
+ \PDFcode{\gMPs1 0 0 \gMPs2 0 0 cm}%
+ \resetMPstack}
+
+%D This macro interprets the path and saves it as compact as
+%D possible.
+
+\def\dohandleMPpath#1%
+ {\ifcase\lccode`#1\relax
+ \@EA\dohandleMPpathA
+ \else
+ \@EA\dohandleMPpathB
+ \fi#1}
+
+\let\dohandleMPpathA\setMPsequence
+
+\def\dohandleMPpathB#1 %
+ {\def\somestring{#1}%
+ \ifx\somestring\PSlineto
+ \setMPkeyword0
+ \else\ifx\somestring\PScurveto
+ \setMPkeyword1
+ \else\ifx\somestring\PSrlineto
+ \setMPkeyword2
+ \else\ifx\somestring\PSmoveto
+ \setMPkeyword3
+ \else\ifx\somestring\PSclip
+ % \chardef\finiMPpath0 % already
+ \let\handleMPsequence\processMPpath
+ \else\ifx\somestring\PSgsave
+ \chardef\finiMPpath3
+ \else\ifx\somestring\PSgrestore
+ \else\ifx\somestring\PSfill
+ \ifcase\finiMPpath
+ \chardef\finiMPpath2
+ \let\handleMPsequence\processMPpath
+ \fi
+ \else\ifx\somestring\PSstroke
+ \ifcase\finiMPpath
+ \chardef\finiMPpath1
+ \fi
+ \let\handleMPsequence\processMPpath
+ \else\ifx\somestring\PSclosepath
+ \def\closeMPpath{\PDFcode{h}}%
+ \else\ifx\somestring\PSconcat
+ \cleanupMPconcat
+ \let\flushMPpath\flushconcatMPpath
+ \handleMPpathconcat
+ \else\ifx\somestring\PSscale
+ \let\flushMPpath\flushconcatMPpath
+ \handleMPpathscale
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \handleMPsequence}
+
+%D The main conversion command is:
+%D
+%D \starttyping
+%D \convertMPtoPDF {filename} {x scale} {y scale}
+%D \stoptyping
+%D
+%D The dimensions are derived from the bounding box. So we
+%D only have to say:
+%D
+%D \starttyping
+%D \convertMPtoPDF{mp-pra-1.eps}{1}{1}
+%D \convertMPtoPDF{mp-pra-1.eps}{.5}{.5}
+%D \stoptyping
+
+%D \macros
+%D {makeMPintoPDFobject,lastPDFMPobject}
+%D
+%D For experts there are a few more options. When attributes
+%D are to be added, the code must be embedded in an object
+%D accompanied with the appropriate directives. One can
+%D influence this process with \type {\makeMPintoPDFobject}.
+%D
+%D This option defaults to~0, because \CONTEXT\ takes care
+%D of objects at another level, which saves some bytes.
+%D
+%D \starttabulate[|l|l|p|]
+%D \NC 0 \NC never \NC don't use an object \NC\NR
+%D \NC 1 \NC always \NC always use an object \NC\NR
+%D \NC 2 \NC optional \NC use object when needed \NC\NR
+%D \stoptabulate
+%D
+%D The last object number used is avaliable in the macro
+%D \type {\lastPDFMPobject}.
+
+\ifx\makeMPintoPDFobject\undefined \chardef\makeMPintoPDFobject=0 \fi
+
+\def\lastPDFMPobject{0}
+
+%D The additional code needed can be made available in the
+%D (global) macro \type {\currentPDFresources}.
+
+\let\currentPDFresources\empty
+
+\newtoks\everyMPtoPDFconversion
+
+\def\convertMPtoPDF % #1#2#3%
+ {\bgroup
+ \ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new
+ \setbox\scratchbox\vbox\bgroup
+ \xdef\MPheight{\zeropoint}%
+ \xdef\MPwidth {\zeropoint}%
+ \forgetall
+ \offinterlineskip
+ \startMPresources
+ \doprocessMPtoPDFfile} %
+
+%D The next one is kind of private and probably will become obsolete):
+
+\def\processMPtoPDFfile % file xscale yscale
+ {\bgroup
+ \let\finishMPgraphic\egroup
+ \doprocessMPtoPDFfile}
+
+\let\setMPextensions\relax
+
+\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale
+ {% the following line is needed for latex where onepoint is not
+ % onepoint but a number (maxdimen); some day i'll make a latex
+ % variant of this file so that i no longer have to deal with such
+ % issues; then i'll also speed up this module using a few context
+ % tricks
+ %
+ \let\onepoint\onerealpoint
+ %
+ \setMPspecials
+ \setMPextensions
+ \the\everyMPtoPDFconversion
+ \catcode`\^^M=\@@endofline
+ \startMPscanning
+ \let\do\empty
+ \xdef\MPxscale{#2}%
+ \xdef\MPyscale{#3}%
+ \xdef\MPxoffset{0}%
+ \xdef\MPyoffset{0}%
+ \xdef\MPyshift{\zeropoint}%
+ \donefalse
+ \let\handleMPsequence\dohandleMPsequence
+ \message{[MP to PDF]}% was: [MP to PDF #1] but there is a (#1) anyway
+ \input#1\relax}
+
+% strange rounding/clip in pdftex/viewer
+%
+% \def\finishMPgraphic
+% {\stopMPresources
+% \egroup
+% \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
+% \chardef\makeMPintoPDFobject=0
+% \fi\fi
+% \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
+% \chardef\makeMPintoPDFobject=1
+% \fi\fi
+% \setbox\scratchbox=\vbox
+% {\forgetall
+% \hbox
+% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}%
+% \lower\MPyshift\box\scratchbox % unscaled shift
+% \PDFcode{Q}}}%
+% \ht\scratchbox\MPheight
+% \wd\scratchbox\MPwidth
+% \dp\scratchbox\zeropoint
+% \ifcase\makeMPintoPDFobject
+% \box\scratchbox
+% \or
+% \immediate\pdfxform resources{\currentPDFresources}\scratchbox
+% \xdef\lastPDFMPobject{\the\pdflastxform}%
+% \pdfrefxform\lastPDFMPobject
+% \global\let\currentPDFresources\empty
+% \else
+% \box\scratchbox
+% \fi
+% \egroup}
+%
+% funny clip in viewer
+%
+% \setbox\scratchbox=\vbox
+% {\forgetall
+% \dimen0=\MPllx bp
+% \dimen2=\MPlly bp
+% \setbox\scratchbox=\hbox{\hskip-\dimen0\raise-\dimen2\box\scratchbox}%
+% \ht\scratchbox=\zeropoint
+% \dp\scratchbox=\zeropoint
+% \wd\scratchbox=\zeropoint
+% \hbox
+% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space 0 0 cm}%
+% \lower\MPshift\box\scratchbox
+% \PDFcode{Q}}}%
+
+% \let\PDFMPformoffset\zeropoint
+
+\def\PDFMPformoffset
+ {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi}
+
+\chardef\blackoutMPgraphic\plusone % in supp-pdf it's \zerocount
+
+\def\finishMPgraphic
+ {\stopMPresources
+ \egroup
+ \setbox\scratchbox\vbox
+ {\forgetall
+ \hbox
+ {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}%
+ \ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi
+ \lower\MPyshift\box\scratchbox % unscaled shift
+ \PDFcode{Q}}}%
+ \ht\scratchbox\MPheight
+ \wd\scratchbox\MPwidth
+ \dp\scratchbox\zeropoint\relax
+ \dopackageMPgraphic\scratchbox
+ \egroup
+ \endinput}
+
+%D Alternative for \PDFTEX. We cannot come up with something more contexy
+%D because this module is also used in \LATEX.
+
+\def\dopackageMPgraphic#1% #1 = boxregister
+ {%\ifx\pdfxform\undefined
+ % \chardef\makeMPintoPDFobject\zerocount % no pdftex at all
+ %\else\ifx\pdftexversion\undefined
+ % \chardef\makeMPintoPDFobject\zerocount % no pdftex at all
+ %\else\ifnum\pdftexversion<14
+ % \chardef\makeMPintoPDFobject\zerocount % no resource support
+ %\else
+ % % keep the default value
+ %\fi\fi\fi
+ \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
+ % an existing value of 2 signals object support (set elsewhere)
+ \chardef\makeMPintoPDFobject\plusone
+ \fi\fi
+ \ifcase\makeMPintoPDFobject
+ \box#1%
+ \or
+ \scratchdimen\PDFMPformoffset\relax
+ \ifdim\scratchdimen>\zeropoint % compensate for error
+ \setbox#1\vbox spread 2\scratchdimen
+ {\forgetall\vss\hbox spread 2\scratchdimen{\hss\box#1\hss}\vss}%
+ \fi
+ \setMPPDFobject{\currentPDFresources}{#1}%
+ \ifdim\scratchdimen>\zeropoint % compensate for error
+ \vbox to \MPheight
+ {\forgetall\vss\hbox to \MPwidth{\hss\getMPPDFobject\hss}\vss}%
+ \else
+ \getMPPDFobject
+ \fi
+ \global\let\currentPDFresources\empty
+ \else
+ \box#1%
+ \fi}
+
+\def\setMPPDFobject#1#2% resources boxnumber
+ {\ifx\pdfxform\undefined
+ \def\getMPPDFobject{\box#2}%
+ \else\ifx\pdftexversion\undefined
+ \def\getMPPDFobject{\box#2}%
+ \else\ifnum\pdftexversion<14
+ \def\getMPPDFobject{\box#2}%
+ \else
+ \ifx\everyPDFxform\undefined\else\the\everyPDFxform\fi
+ \immediate\pdfxform resources{#1}#2%
+ \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}%
+ \fi\fi\fi}
+
+\let\getMPPDFobject\relax
+
+%D \macros
+%D {deleteMPgraphic,
+%D startMPresources,
+%D stopMPresources}
+%D
+%D Here are a few hooks for \CONTEXT\ specific things.
+
+\ifx\deleteMPgraphic\undefined
+ \def\deleteMPgraphic#1{}
+\fi
+
+\ifx\startMPresources\undefined
+ \let\startMPresources\relax
+ \let\stopMPresources\relax
+\fi
+
+%D \macros
+%D {twodigitMPoutput}
+%D
+%D We can limit the precision to two digits after the comma
+%D by saying:
+%D
+%D \starttyping
+%D \twodigitMPoutput
+%D \stoptyping
+%D
+%D This option only works in \CONTEXT\ combined with \ETEX.
+
+\def\twodigitMPoutput
+ {\let\!MP \twodigitrounding
+ \def\!MPgMPs##1{\twodigitrounding{\gMPs##1}}%
+ \def\!MPgMPa##1{\twodigitrounding{\gMPa##1}}}
+
+\let\!MP \empty
+\let\!MPgMPa\gMPa
+\let\!MPgMPs\gMPs
+
+%D This kind of conversion is possible because \METAPOST\
+%D does all the calculations. Converting other \POSTSCRIPT\
+%D files would drive both me and \TEX\ crazy.
+
+\ifx\undefined\StopLatexHack \else \StopLatexHack \fi
+
+\protect % \endinput
+
+%D \module
+%D [ file=supp-mpe,
+%D version=1999.07.10,
+%D title=\CONTEXT\ Support Macros,
+%D subtitle=METAPOST Special Extensions,
+%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.
+
+% fuzzy and complicating is the fact that we need to support
+% context as well as mptopdf, so we cannot fall back on the
+% special drivers and color module (although there may be
+% good reasons to use a smaller context instead); also,
+% shading is handled here while it should move to the special
+% driver - to do!
+
+%D This module is still experimental and deals with some
+%D extensions to \METAPOST. When using \POSTSCRIPT\ output,
+%D these extensions can be supplied by means of proper
+%D preamble definitions, but when producing \PDF\ we have to
+%D set up the appropriate datastructures ourselves. It acts as
+%D a plug in into \type {supp-pdf}. As soon as we need more
+%D extensions, we will generalize these macro. Some
+%D definitions will move to the special drivers.
+
+%D For usage in plain \TEX, say something:
+%D
+%D \starttyping
+%D \input supp-pdf
+%D \input supp-mpe
+%D
+%D \MPcmykcolorstrue
+%D \MPspotcolorstrue
+%D \chardef\makeMPintoPDFobject\plusone
+%D \stoptyping
+
+\writestatus{loading}{MetaPost Special Extensions}
+
+%D We implement extensions by using the \METAPOST\ special
+%D mechanism. Opposite to \TEX's specials, the \METAPOST\ ones
+%D are flushed before or after the graphic data, but thereby
+%D are no longer connected to a position.
+%D
+%D We implement specials by overloading the \type {fill}
+%D operator. By counting the fills, we can let the converter
+%D treat the appropriate fill in a special way. The
+%D specification of the speciality can have two forms,
+%D determined by the setting of a boolean variable:
+%D
+%D \starttyping
+%D _inline_specials_ := false ; % comment like code (default)
+%D _inline_specials_ := true ; % command like code
+%D \stoptyping
+%D
+%D When the specification is embedded as comment, it looks
+%D like:
+%D
+%D \starttyping
+%D %%MetaPostSpecial <size> <data> <number> <identifier>
+%D \stoptyping
+%D
+%D The in||line alternative is more tuned for \POSTSCRIPT,
+%D since it permits us to define a macro \type {special}.
+%D
+%D \starttyping
+%D inline : <data> <number> <identifier> <size> special
+%D \stoptyping
+%D
+%D The \type {identifier} determines what to do, and the data
+%D can be used to accomplish this. A type~2 shading function
+%D has identifier~2. Alltogether, the number of parameters is
+%D specified in \type {size}. The \type {number} is the number
+%D of the fill that needs the special treatment. For a type~2
+%D and~3 shaded fill, the datablock contains the following
+
+%D data:
+%D
+%D \starttyping
+%D from to n inner_r g b x y outer_r g b x y
+%D from to n inner_r g b x y radius outer_r g b x y radius
+%D \stoptyping
+%D
+%D The implementation below saves the data on the stack in
+%D a way similar to the macros in \type {supp-pdf.tex}, and
+%D just overload a few already defined handlers. That way,
+%D the existing macros are still generic. \footnote {Actually,
+%D the macros here are just as generic.}
+%D
+%D Currently the only extension concerns shading, which is
+%D accomplished by handling yet another value of \type
+%D {\finiMPpath}. The recource disctionary is stored and
+%D later picked up by the general \CONTEXT\ figure inclusion
+%D macros.
+
+\unprotect
+
+%D The \type {%%MetaPostSpecials: version.revision signal} line
+%D triggers this module into handling color specifications kind
+%D of special. We need this safeguard for non||special
+%D usage.
+
+\chardef\MPspecialversion = 0 % specials when >1
+\chardef\MPspecialrevision = 0 % specials when >1
+\chardef\MPspecialsignal = 0 % passed on by graphic
+
+\chardef\inlineMPspecials = 1 % only needed for stack resetting
+
+%D This macro handles the special definitions that are
+%D passed as comment.
+
+\def\dohandleMPspecialcomment#1
+ {\setMPargument{#1}%
+ \advance\scratchcounter \minusone
+ \ifcase\scratchcounter
+ \handleMPspecialcommand
+ \donetrue
+ \doresetMPstack
+ \let\handleMPsequence\dohandleMPsequence
+ \expandafter\handleMPsequence
+ \else
+ \expandafter\dohandleMPspecialcomment
+ \fi}
+
+\def\handleMPspecialcomment #1 % number of arguments
+ {\doresetMPstack
+ \scratchcounter#1\relax
+ \ifcase\scratchcounter % when zero, inline shading is used
+ \chardef\inlineMPspecials\plusone
+ \let\handleMPsequence\dohandleMPsequence
+ \expandafter\handleMPsequence
+ \else
+ \chardef\inlineMPspecials\zerocount
+ \expandafter\dohandleMPspecialcomment
+ \fi}
+
+%D When defined inline, we use another macro to handle the
+%D definitions. Actually, this macro is called by the
+%D previous ones.
+
+\def\handleMPspecialcommand
+ {\ifcase\inlineMPspecials\or
+ \advance\nofMParguments \minusone % pop the size
+ \fi
+ \ifundefined\MPspecial
+ \message{[unknown \MPspecial]}%
+ \else
+ \csname\MPspecial\endcsname
+ \fi
+ \ifcase\inlineMPspecials
+ \doresetMPstack % 0
+ \else
+ \resetMPstack % 1
+ \fi}
+
+%D This macro triggers special support. Currently, the
+%D version and revision number are not used. Any version number
+%D greater than zero will enable special support.
+
+\newconditional\manyMPspecials % \settrue\manyMPspecials
+
+\def\handleMPspecialscomment #1.#2 #3 % version.revision signal #4=div=1000|10000
+ {\doresetMPstack
+ \chardef\MPspecialversion #1%
+ \chardef\MPspecialrevision#2%
+ \chardef\MPspecialsignal #3%
+ \let\handleMPsequence\dohandleMPsequence
+ \ifnum#1=\plusone
+ \expandafter\handleMPsequence
+ \else
+ \expandafter\handleMPspecialscommentx
+ \fi}
+
+\def\handleMPspecialscommentx #1 % version 2
+% {\doifelsedoifelse{#1}{10000}{\settrue\manyMPspecials}{\setfalse\manyMPspecials}% local
+ {\ifnum10000=0#1\relax\settrue\manyMPspecials\else\setfalse\manyMPspecials\fi
+ \handleMPsequence}
+
+% one can say (in meta-ini):
+%
+% \prependtoks
+% _special_div_ := 1000\ifconditional\manyMPspecials0\fi ;
+% \to \MPextensions
+
+%D In case of \PDF, we need to prepare resourcs.
+
+\newtoks\MPstartresources
+\newtoks\MPstopresources
+
+\def\startMPresources
+ {\the\MPstartresources
+ \ifx\currentPDFresources\empty\else
+ \message{[unused resources]}%
+ \fi
+ \global\let\currentPDFresources\empty}
+
+\def\stopMPresources
+ {\let\currentPDFresources\empty
+ \the\MPstopresources}
+
+%D Since colors are not subjected to transformations, we can
+%D only use colors as signal. In our case, we use a dummy colored
+%D path with a red color component of \type {0.n}, so \type
+%D {0.001} is the first path and \type {0.010} the tenth. Since
+%D \METAPOST strips trailing zeros, we have to padd the string.
+
+\newif\ifMPcmykcolors
+\newif\ifMPspotcolors
+
+\ifx\normalhandleMPrgbcolor\undefined % in case we reload this module
+
+ \let\normalhandleMPrgbcolor \handleMPrgbcolor
+ \let\normalhandleMPcmykcolor\handleMPcmykcolor
+ \let\normalhandleMPgraycolor\handleMPgraycolor
+ \let\normalhandleMPspotcolor\handleMPspotcolor
+
+\fi
+
+%D When we are using \CONTEXT, we will fall back to the
+%D better color conversion routines. This also has the advantage
+%D that we don't have to parse and convert the file. In this
+%D alternative, \type {\!MP} is not (yet) supported. Because
+%D we can (for efficiency reasons) turn off strokecolor,
+%D something we cannot do in \METAPOST\ converted code.
+
+\newif\ifPDFMPstrokecolor \PDFMPstrokecolortrue
+
+%D [This code should move to meta-ini.]
+
+\ifCONTEXT % we can use this for a better xgstate handling
+
+ \def\checkPDFMPstrokecolor
+ {\ifPDFMPstrokecolor \PDFstrokecolortrue \fi}
+
+ \def\normalhandleMPrgbcolor
+ {{\checkPDFMPstrokecolor\execcolorR\gMPa1:\gMPa2:\gMPa3:0:0\od}}
+
+ \def\normalhandleMPcmykcolor
+ {{\checkPDFMPstrokecolor\execcolorC\gMPa1:\gMPa2:\gMPa3:\gMPa4:0:0\od}}
+
+ \def\normalhandleMPgraycolor
+ {{\checkPDFMPstrokecolor\execcolorS\gMPa1:0:0\od}}
+
+ \def\normalhandleMPspotcolor % ???
+ {{\checkPDFMPstrokecolor\execcolorP\gMPa1:\gMPa2:\gMPa3:\gMPa4:0:0\od}}
+
+\fi
+
+% In the previous macros we use the special drivers. A more
+% direct approach would have been:
+%
+% \def\doPDFstartrgbcolormode#1#2#3%
+% {\PDFcode{#1 #2 #3 rg #1 #2 #3 RG}}
+%
+% \def\doPDFstartcmykcolormode#1#2#3#4%
+% {\PDFcode{#1 #2 #3 #4 k #1 #2 #3 #4 K}}
+%
+% \def\doPDFstartgraycolormode#1%
+% {\PDFcode{#1 g #1 G}}
+%
+% \appendtoks
+% \let\dostartrgbcolormode \doPDFstartrgbcolormode
+% \let\dostartcmykcolormode\doPDFstartcmykcolormode
+% \let\dostartgraycolormode\doPDFstartgraycolormode
+% \to \everyMPtoPDFconversion
+
+%D Now we can handle special color signals. We only do this
+%D when special are detected.
+
+% \def\MPrgbnumber#1{\expandafter\doMPrgbnumber#1000.0000\relax}
+% \def\doMPrgbnumber#1.#2#3#4#5\relax{#2#3#4}
+
+%D We cannot use \type {\everyMPtoPDFconversion} because in \MPTOPDF\
+%D we don't have the \type {\appendtoks} macro available.
+
+\def\setMPextensions
+ {\ifconditional\manyMPspecials
+ \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##10000.00000\relax}%
+ \def\doMPrgbnumber##1.##2##3##4##5##6\relax{##2##3##4##5}%
+ \else
+ \def\MPrgbnumber##1{\expandafter\doMPrgbnumber##1000.0000\relax}%
+ \def\doMPrgbnumber##1.##2##3##4##5\relax{##2##3##4}%
+ \fi}
+
+%D The naive case looks like:
+%D
+%D \starttyping
+%D \def\handleMPrgbcolor%
+%D {\setMPcolor
+%D \ifcase\MPspecialversion
+%D \resetMPcolor\normalhandleMPrgbcolor
+%D \else\ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal
+%D % consider it to be a signal
+%D \else
+%D \resetMPcolor\normalhandleMPrgbcolor
+%D \fi\fi}
+%D \stoptyping
+%D
+%D However, since we want \CMYK\ support, we will use the
+%D following implementation:
+
+% \def\setMPcolor
+% {\edef\lastMPrvalue{\gMPa1}%
+% \edef\lastMPgvalue{\gMPa2}%
+% \edef\lastMPbvalue{\gMPa3}}
+%
+% speed up (hardly called, so no let is needed)
+
+\def\setMPcolor
+ {\edef\lastMPrvalue{\csname\@@MP01\endcsname}%
+ \edef\lastMPgvalue{\csname\@@MP02\endcsname}%
+ \edef\lastMPbvalue{\csname\@@MP03\endcsname}}
+
+\def\zeroMPrgbvalue{0.0}
+
+\def\resetMPcolor
+ {\let\lastMPrvalue\zeroMPrgbvalue
+ \let\lastMPgvalue\zeroMPrgbvalue
+ \let\lastMPbvalue\zeroMPrgbvalue}
+
+\resetMPcolor
+
+\def\@@MPSK{@MPSK@}
+\def\@@MPSP{@MPSP@}
+
+\def\interceptMPcmykcolor % todo : \ifMPcmykcolors
+ {\ifcase\MPrgbnumber\lastMPgvalue
+ % cannot happen
+ \or
+ % 1 == cmyk color spec
+ \ifMPcmykcolors \dointerceptMPcmykcolor \fi
+ \or
+ % 2 == spot color
+ \ifMPspotcolors \dointerceptMPspotcolor \fi
+ \or
+ % 3 == rgb transparency
+ \invokeMPtransparencyspecial
+ \or
+ % 4 == cmyk transparency
+ \ifMPcmykcolors \invokeMPtransparencyspecial \fi
+ \or
+ % 5 == spot transparency
+ \ifMPspotcolors \invokeMPtransparencyspecial \fi
+ \else
+ % \writestatus{MPtoPDF}{unknown direct special}%
+ \fi}
+
+% ifcsname
+
+\def\dointerceptMPcmykcolor
+ {\revokeMPtransparencyspecial
+ \@EA\ifx\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else
+ \@EA\@EA\@EA\setMPcmyk\csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname
+ \normalhandleMPcmykcolor
+ \fi}
+
+\def\dointerceptMPspotcolor
+ {\revokeMPtransparencyspecial
+ \@EA\ifx\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname\relax\else
+ \@EA\@EA\@EA\setMPspot\csname\@@MPSP\number\MPrgbnumber\lastMPbvalue\endcsname
+ \normalhandleMPspotcolor
+ \fi}
+
+\def\handleMPrgbcolor
+ {\resetMPcolor
+ \ifcase\MPspecialversion
+ \normalhandleMPrgbcolor
+ \else
+ \setMPcolor
+ \ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal\relax
+ \interceptMPcmykcolor
+ \else
+ \revokeMPtransparencyspecial
+ \normalhandleMPrgbcolor
+ \fi
+ \fi}
+
+\def\handleMPgraycolor
+ {\resetMPcolor
+ \ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi
+ \normalhandleMPgraycolor}
+
+\def\handleMPcmykcolor
+ {\resetMPcolor
+ \ifcase\MPspecialversion \else \revokeMPtransparencyspecial \fi
+ \normalhandleMPcmykcolor}
+
+%D Specials are define and recalled using:
+
+\def\MPspecial
+ {MP special \gMPs\nofMParguments}
+
+\def\defineMPspecial#1#2%
+ {\setvalue{MP special #1}{#2}}
+
+%D The path processing macro is slightly extended.
+
+\newtoks \invokeMPspecials
+
+\def\finishMPpath
+ {\PDFcode
+ {\ifcase\finiMPpath W n\or S\or f\or B\else W n\fi
+ \extraMPpathcode}}
+
+\def\processMPpath
+ {\checkMPpath % !
+ \ifcase\nofMPsegments\else
+ \let\extraMPpathcode\empty
+ \ifcase\MPspecialversion\else
+ \ifnum\MPrgbnumber\lastMPrvalue=\MPspecialsignal
+ \ifnum\MPrgbnumber\lastMPgvalue>10 % really needed
+ \scratchcounter\MPrgbnumber\lastMPbvalue
+ \edef\currentMPspecial{\the\scratchcounter}%
+ \ifnum\finiMPpath=2 % to outer level
+ \the\invokeMPspecials
+ \fi
+ \fi
+ \fi
+ \fi
+ \flushMPpath
+ \closeMPpath
+ \finishMPpath
+ \fi
+ \let\handleMPsequence\dohandleMPsequence
+ \resetMPstack
+ \nofMPsegments0
+ \handleMPsequence}
+
+%D Shading is an example of a more advanced graphic feature,
+%D but users will seldom encounter those complications. Here
+%D we only show a few simple examples, but many other
+%D alternatives are possible by setting up the functions built
+%D in \PDF\ in the appropriate way.
+%D
+%D Shading has to do with interpolation between two or more
+%D points or user supplied ranges. In \PDF, the specifications
+%D of a shade has to be encapsulated in objects and passed on
+%D as resources. This is a \PDF\ level 1.3. feature. One can
+%D simulate three dimensional shades as well and define simple
+%D functions using a limited set of \POSTSCRIPT\ primitives.
+%D Given the power of \METAPOST\ and these \PDF\ features, we
+%D can achieve superb graphic effects.
+%D
+%D Since everything is hidden in \TEX\ and \METAPOST\ graphics,
+%D we can stick to high level \CONTEXT\ command, as shown in
+%D the following exmples.
+%D
+%D \startbuffer
+%D \startuniqueMPgraphic{CircularShade}
+%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
+%D circular_shade(p,0,.2red,.9red) ;
+%D \stopuniqueMPgraphic
+%D
+%D \startuniqueMPgraphic{LinearShade}
+%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
+%D linear_shade(p,0,.2blue,.9blue) ;
+%D \stopuniqueMPgraphic
+%D
+%D \startuniqueMPgraphic{DuotoneShade}
+%D path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
+%D linear_shade(p,2,.5green,.5red) ;
+%D \stopuniqueMPgraphic
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D \getbuffer
+%D
+%D These graphics can be hooked into the overlay mechanism,
+%D which is available in many commands.
+%D
+%D \startbuffer
+%D \defineoverlay[demo 1][\uniqueMPgraphic{CircularShade}]
+%D \defineoverlay[demo 2][\uniqueMPgraphic {LinearShade}]
+%D \defineoverlay[demo 3][\uniqueMPgraphic {DuotoneShade}]
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D \getbuffer
+%D
+%D These backgrounds can for instance be applied to \type
+%D {\framed}:
+%D
+%D \startbuffer
+%D \setupframed[width=3cm,height=2cm,frame=off]
+%D \startcombination[3*1]
+%D {\framed[backgroundachtergrond=demo 1]{\bfd \white Demo 1}} {}
+%D {\framed[backgroundachtergrond=demo 2]{\bfd \white Demo 2}} {}
+%D {\framed[backgroundachtergrond=demo 3]{\bfd \white Demo 3}} {}
+%D \stopcombination
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D \startlinecorrection
+%D \getbuffer
+%D \stoplinecorrection
+%D
+%D There are a few more alternatives, determined by the second
+%D parameter passed to \type {circular_shade} and alike.
+%D
+%D \def\SomeShade#1#2#3#4#5%
+%D {\startuniqueMPgraphic{Shade-#1}
+%D width := \overlaywidth ;
+%D height := \overlayheight ;
+%D path p ; p := unitsquare xscaled width yscaled height ;
+%D #2_shade(p,#3,#4,#5) ;
+%D \stopuniqueMPgraphic
+%D \defineoverlay[Shade-#1][\uniqueMPgraphic{Shade-#1}]%
+%D \framed[backgroundachtergrond=Shade-#1,width=2cm,height=2cm,frame=off]{}}
+%D
+%D \startlinecorrection
+%D \startcombination[5*1]
+%D {\SomeShade{10}{circular}{0}{.3blue}{.9blue}} {circular 0}
+%D {\SomeShade{11}{circular}{1}{.3blue}{.9blue}} {circular 1}
+%D {\SomeShade{12}{circular}{2}{.3blue}{.9blue}} {circular 2}
+%D {\SomeShade{13}{circular}{3}{.3blue}{.9blue}} {circular 3}
+%D {\SomeShade{14}{circular}{4}{.3blue}{.9blue}} {circular 4}
+%D \stopcombination
+%D \stoplinecorrection
+%D
+%D \blank
+%D
+%D \startlinecorrection
+%D \startcombination[5*1]
+%D {\SomeShade{20}{circular}{0}{.9green}{.3green}} {circular 0}
+%D {\SomeShade{21}{circular}{1}{.9green}{.3green}} {circular 1}
+%D {\SomeShade{22}{circular}{2}{.9green}{.3green}} {circular 2}
+%D {\SomeShade{23}{circular}{3}{.9green}{.3green}} {circular 3}
+%D {\SomeShade{24}{circular}{4}{.9green}{.3green}} {circular 4}
+%D \stopcombination
+%D \stoplinecorrection
+%D
+%D \blank
+%D
+%D \startlinecorrection
+%D \startcombination[4*1]
+%D {\SomeShade{30}{linear}{0}{.3red}{.9red}} {linear 0}
+%D {\SomeShade{31}{linear}{1}{.3red}{.9red}} {linear 1}
+%D {\SomeShade{32}{linear}{2}{.3red}{.9red}} {linear 2}
+%D {\SomeShade{33}{linear}{3}{.3red}{.9red}} {linear 3}
+%D \stopcombination
+%D \stoplinecorrection
+%D
+%D These macros closely cooperate with the \METAPOST\ module
+%D \type {mp-spec.mp}, which is part of the \CONTEXT\
+%D distribution.
+%D
+%D The low level (\PDF) implementation is based on the \TEX\
+%D based \METAPOST\ to \PDF\ converter. Shading is supported
+%D by overloading the \type {fill} operator as implemented
+%D earlier. In \PDF\ type~2 and~3 shading functions are
+%D specified in terms of:
+%D
+%D \starttabulate[|Tl|l|]
+%D \NC /Domain \NC sort of meeting range \NC \NR
+%D \NC /C0 \NC inner shade \NC \NR
+%D \NC /C1 \NC outer shade \NC \NR
+%D \NC /N \NC smaller values, bigger inner circles \NC \NR
+%D \stoptabulate
+
+\newcount\currentPDFshade % 0 % global (document wide) counter
+\let\currentMPshades\empty
+
+\def\startMPshading#1%
+ {\edef\currentMPspecial{\gMPs{#1}}}
+
+\def\stopMPshading
+ {\global\advance\currentPDFshade \plusone
+ \setxvalue{obj:Sh:\currentMPspecial}%
+ {/Sh\the\currentPDFshade\space\the\pdflastobj\space0 R }%
+ \setxvalue{mps:Sh:\currentMPspecial}%
+ {\the\currentPDFshade}}
+
+\appendtoks
+ \global\let\currentMPshades\empty
+\to \MPstartresources
+
+\appendtoks
+ \ifx\currentMPshades\empty \else
+ \xdef\currentPDFresources{\currentPDFresources
+ /Shading <<\currentMPshades>>}%
+ \fi
+\to \MPstopresources
+
+\def\invokeMPshadespecial
+ {\ifundefined{mps:Sh:\currentMPspecial}\else
+ \edef\currentMPshade{\getvalue{obj:Sh:\currentMPspecial}}%
+ \doifinstringelse\currentMPshade\currentMPshades \donothing
+ {\xdef\currentMPshades{\currentMPshades\currentMPshade}}%
+ \def\extraMPpathcode{/Sh\getvalue{mps:Sh:\currentMPspecial} sh Q}%
+ \chardef\finiMPpath\zerocount
+ \PDFcode{q /Pattern cs}%
+ \fi}
+
+\appendtoks \invokeMPshadespecial \to \invokeMPspecials
+
+%D We need to convert the \CMYK\ specials into colors, because
+%D we have to do it twice, we define a macro.
+
+\def\checkMPshadingcolor#1#2#3#4#5%
+ {\edef\tempMPrvalue{\csname\@@MP0#1\endcsname}%
+ \edef\tempMPgvalue{\csname\@@MP0#2\endcsname}%
+ \edef\tempMPbvalue{\csname\@@MP0#3\endcsname}%
+ \global\let\MPresolvedspace\MPgrayspace
+ \global\let\MPresolvedcolor\!!zerocount
+ \ifnum\MPrgbnumber\tempMPrvalue=\MPspecialsignal\relax
+ \ifcase\MPrgbnumber\tempMPgvalue
+ \or % 1 = cmyk
+ \ifMPcmykcolors
+ \expanded{\resolveMPcmykcolor\getvalue{\@@MPSK\number\MPrgbnumber\tempMPbvalue}}\end
+ \fi
+ \or % 2 = spot
+ \ifMPspotcolors
+ \expanded{\resolveMPspotcolor\getvalue{\@@MPSP\number\MPrgbnumber\tempMPbvalue}}\end
+ \fi
+ \or
+ % 3 = rgb transparency
+ % to do
+ \or
+ % 4 == cmyk transparency
+ % \ifMPcmykcolors
+ % to do
+ % \fi
+ \or
+ % 5 == spot transparency
+ % \ifMPspotcolors
+ % to do
+ % \fi
+ \fi
+ \else
+ \ifx\tempMPrvalue\tempMPgvalue
+ \ifx\tempMPrvalue\tempMPbvalue
+ \expanded{\resolveMPgraycolor\tempMPbvalue}\end
+ \else
+ \expanded{\resolveMPrgbcolor\tempMPrvalue\space\tempMPgvalue\space\tempMPbvalue}\end
+ \fi
+ \else
+ \expanded{\resolveMPrgbcolor\tempMPrvalue\space\tempMPgvalue\space\tempMPbvalue}\end
+ \fi
+ \fi
+ \let#4\MPresolvedcolor
+ \let#5\MPresolvedspace}
+
+%D We also need to make sure that we have two \RGB\ or
+%D \CMYK colors, since we have to set the colorspace.
+
+\def\setMPshadingcolors#1#2#3#4#5#6% color space
+ {\checkMPshadingcolor{#1}{#2}{#3}\MPshadeAc\MPshadeAs
+ \checkMPshadingcolor{#4}{#5}{#6}\MPshadeBc\MPshadeBs
+ \ifx\MPshadeAs\MPshadeBs
+ \let\MPshadeA\MPshadeAc
+ \let\MPshadeB\MPshadeBc
+ \let\MPshadeC\MPshadeAs
+ \else\ifx\MPshadeAs\MPgrayspace
+ \ifx\MPshadeBs\MPrgbspace
+ \edef\MPshadeA{\MPshadeAc\space\MPshadeAc\space\MPshadeAc}%
+ \else
+ \negatecolorcomponent\MPshadeAc
+ \edef\MPshadeA{0 0 0 \MPshadeAc}%
+ \fi
+ \let\MPshadeB\MPshadeBc
+ \let\MPshadeC\MPshadeBs
+ \else\ifx\MPshadeBs\MPgrayspace
+ \let\MPshadeA\MPshadeAc
+ \ifx\MPshadeAs\MPrgbspace
+ \edef\MPshadeB{\MPshadeBc\space\MPshadeBc\space\MPshadeBc}%
+ \else
+ \negatecolorcomponent\MPshadeBc
+ \edef\MPshadeB{0 0 0 \MPshadeBc}%
+ \fi
+ \let\MPshadeC\MPshadeAs
+ \else
+ % different color spaces
+ \def\MPshadeA{1}%
+ \def\MPshadeB{1}%
+ \let\MPshadeC\MPgrayspace
+ \fi\fi\fi}
+
+\let\MPshadeA\MPcmykWhite
+\let\MPshadeB\MPcmykBlack
+\let\MPshadeC\MPgrayspace
+
+%D The reason why this macro is a bit complicates is that we
+%D handle black and white situations (otherwise we would have
+%D to use \CMYK\ b/w in case of a \CMYK\ shade).
+
+%D Here are the special handlers:
+
+\defineMPspecial{30}
+ {\startMPshading{14}% type 2
+ \setMPshadingcolors{4}{5}{6}{9}{10}{11}%
+ \immediate\pdfobj
+ {<</FunctionType 2
+ /Domain [\gMPs1 \gMPs2]
+ /C0 [\MPshadeA]
+ /C1 [\MPshadeB]
+ /N \gMPs3>>}%
+ \immediate\pdfobj
+ {<</ShadingType 2
+ /ColorSpace /\MPshadeC\space
+ /Function \the\pdflastobj\space 0 R
+ /Coords [\gMPs7 \gMPs8 \gMPs{12} \gMPs{13}]
+ /Extend [true true]>>}%
+ \stopMPshading}
+
+\defineMPspecial{31}
+ {\startMPshading{16}% type 3
+ \setMPshadingcolors{4}{5}{6}{10}{11}{12}%
+ \immediate\pdfobj
+ {<</FunctionType 2
+ /Domain [\gMPs1 \gMPs2]
+ /C0 [\MPshadeA]
+ /C1 [\MPshadeB]
+ /N \gMPs3>>}%
+ \immediate\pdfobj
+ {<</ShadingType 3
+ /ColorSpace /\MPshadeC\space
+ /Function \the\pdflastobj\space 0 R
+ /Coords [\gMPs7 \gMPs8 \gMPs9 \gMPs{13} \gMPs{14} \gMPs{15}]
+ /Extend [true true]>>}%
+ \stopMPshading}
+
+%D Figure inclusion is kind of strange to \METAPOST, but when
+%D Santiago Muelas started discussing this with me, I was able
+%D to cook up a solution using specials.
+
+\def\invokeMPfigurespecial%
+ {\getvalue{mps:gr:\currentMPspecial}} % or \relax
+
+\appendtoks \invokeMPfigurespecial \to \invokeMPspecials
+
+\defineMPspecial{10}
+ {\setxvalue{mps:gr:\gMPs8}%
+ {\noexpand\handleMPfigurespecial
+ {\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}%
+ \noexpand\setxvalue{mps:gr:\gMPs8}{}}}
+
+\def\handleMPfigurespecial#1#2#3#4#5#6#7% todo : combine with ext fig
+ {\vbox to \zeropoint
+ {\vss
+ \hbox to \zeropoint
+ {\ifcase\pdfoutput\or % will be hooked into the special driver
+ \doiffileelse{#7}
+ {\doifundefinedelse{mps:x:#7}
+ {\immediate\pdfximage\!!width\onebasepoint\!!height\onebasepoint{#7}%
+ \setxvalue{mps:x:#7}{\pdfrefximage\the\pdflastximage}}%
+ {\message{[reusing figure #7]}}%
+ \PDFcode{q #1 #2 #3 #4 #5 #6 cm}%
+ \rlap{\getvalue{mps:x:#7}}%
+ \PDFcode{Q}}
+ {\message{[unknown figure #7]}}%
+ \fi
+ \hss}}}
+
+%D An example of using both special features is the
+%D following.
+%D
+%D \starttyping
+%D \startMPpage
+%D externalfigure "hakker1b.png" scaled 22cm rotated 10 shifted (-2cm,0cm);
+%D externalfigure "hakker1b.png" scaled 10cm rotated -10 ;
+%D externalfigure "hakker1b.png" scaled 7cm rotated 45 shifted (8cm,12cm) ;
+%D path p ; p := unitcircle xscaled 15cm yscaled 20cm;
+%D path q ; q := p rotatedaround(center p,90) ;
+%D path r ; r := buildcycle(p,q) ; clip currentpicture to r ;
+%D path s ; s := boundingbox currentpicture enlarged 5mm ;
+%D picture c ; c := currentpicture ; currentpicture := nullpicture ;
+%D circular_shade(s,0,.2red,.9red) ;
+%D addto currentpicture also c ;
+%D \stopMPpage
+%D \stoptyping
+
+%D This is some experimental hyperlink driver that I wrote
+%D for Mark Wicks.
+
+\defineMPspecial{20}
+ {\setxvalue{mps:hl:\gMPs6}%
+ {\noexpand\handleMPhyperlink
+ {\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}%
+ \noexpand\setxvalue{mps:hl:\gMPs6}{}}}
+
+\def\handleMPhyperlink#1#2#3#4#5%
+ {%\ifcase\pdfoutput\or
+ \setbox\scratchbox\hbox
+ {\setbox\scratchbox\null
+ \scratchdimen#1\onebasepoint\scratchdimen-\scratchdimen
+ \advance\scratchdimen#3\onebasepoint
+ \wd\scratchbox\scratchdimen
+ \scratchdimen#2\onebasepoint\scratchdimen-\scratchdimen
+ \advance\scratchdimen#4\onebasepoint
+ \ht\scratchbox\scratchdimen
+ \incolorfalse
+ \gotobox{\box\scratchbox}[#5]}%
+ \setbox\scratchbox\hbox
+ {\scratchdimen\MPxoffset\onebasepoint\advance\scratchdimen#1\onebasepoint
+ \hskip\scratchdimen
+ \scratchdimen\MPyoffset\onebasepoint\advance\scratchdimen#2\onebasepoint
+ \raise\scratchdimen\box\scratchbox}%
+ \smashbox\scratchbox
+ \box\scratchbox
+ }%\fi}
+
+\def\invokeMPhyperlinkspecial%
+ {\getvalue{mps:hl:\currentMPspecial}} % or \relax
+
+\appendtoks \invokeMPhyperlinkspecial \to \invokeMPspecials
+
+%D Special number~1 is dedicated to \CMYK\ support. If you
+%D want to know why: look at this:
+%D
+%D \startbuffer[mp]
+%D fill fullcircle xyscaled (3cm,1cm) withcolor \MPcolor{test} ;
+%D \stopbuffer
+%D
+%D \startbuffer[cmyk]
+%D \startcombination[4*1]
+%D {\definecolor[test][c=1,y=.3,k=.3] \processMPbuffer[mp]} {c=1 y=.3 k=.3}
+%D {\definecolor[test][c=.9,y=.15] \processMPbuffer[mp]} {c=.9 y=.15}
+%D {\definecolor[test][c=.25,y=.8] \processMPbuffer[mp]} {c=.25 y=.8}
+%D {\definecolor[test][c=.45,y=.1] \processMPbuffer[mp]} {c=.45 y=.1}
+%D \stopcombination
+%D \stopbuffer
+%D
+%D \placefigure
+%D {\CMYK\ support disabled,
+%D conversion to \RGB.}
+%D {\setupcolors[cmyk=nee,state=start]\getbuffer[cmyk]}
+%D
+%D \placefigure
+%D {\CMYK\ support enabled,
+%D no support in \METAPOST.}
+%D {\setupcolors[cmyk=ja,mpcmyk=nee,state=start]\getbuffer[cmyk]}
+%D
+%D \placefigure
+%D {\CMYK\ support enabled,
+%D no conversion to \RGB,
+%D support in \METAPOST}
+%D {\setupcolors[cmyk=ja,state=start]\getbuffer[cmyk]}
+
+\defineMPspecial{1}
+ {\ifMPcmykcolors
+ \setxvalue{\@@MPSK\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }%
+ \fi}
+
+\def\setMPcmyk#1 #2 #3 #4 %
+ {\setvalue{\@@MP01}{#1}%
+ \setvalue{\@@MP02}{#2}%
+ \setvalue{\@@MP03}{#3}%
+ \setvalue{\@@MP04}{#4}}
+
+\defineMPspecial{2}
+ {\ifMPspotcolors
+ \setxvalue{\@@MPSP\gMPs1}{\gMPs2 \gMPs3 \gMPs4 \gMPs5 }% space is essential
+ \checkMPspot{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}%
+ \fi}
+
+\def\setMPspot#1 #2 #3 #4 %
+ {\setvalue{\@@MP01}{#1}%
+ \setvalue{\@@MP02}{#2}%
+ \setvalue{\@@MP03}{#3}%
+ \setvalue{\@@MP04}{#4}}
+
+\def\checkMPspot#1#2#3#4%
+ {\expanded{\resolveMPspotcolor#1 #2 #3 #4}\end
+ \ifx\MPspotspace\MPresolvedspace
+ \edef\MPspotspacespec{/\MPspotspace\space}%
+ \doifinstringelse\MPspotspacespec\currentMPcolorspaces
+ \donothing\registerMPcolorspace
+ \fi}
+
+%D This special (number 50) passes positions to a tex file.
+%D This method uses a two||pass approach an (mis|)|used the
+%D context positioning macros. In \type {core-pos} we will
+%D implement the low level submacro needed.
+%D
+%D \startbuffer
+%D \definelayer[test]
+%D
+%D \setlayer
+%D [test]
+%D [x=\MPx{somepos-1},y=\MPy{somepos-1}]
+%D {Whatever we want here!}
+%D
+%D \setlayer
+%D [test]
+%D [x=\MPx{somepos-2},y=\MPy{somepos-2}]
+%D {Whatever we need there!}
+%D
+%D \startuseMPgraphic{oeps}
+%D draw fullcircle scaled 6cm withcolor red ;
+%D register ("somepos-1",1cm,2cm,center currentpicture) ;
+%D register ("somepos-2",4cm,3cm,(-1cm,-2cm)) ;
+%D \stopuseMPgraphic
+%D
+%D \framed[background=test,offset=overlay]{\useMPgraphic{oeps}}
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D Here the width and height are not realy used, but one can
+%D imagine situations where tex has to work with values
+%D calculated by \METAPOST.
+%D
+%D \startlinecorrection
+%D \getbuffer
+%D \stoplinecorrection
+%D
+%D Later we will implement a more convenient macro:
+%D
+%D \starttyping
+%D \setMPlayer [test] [somepos-1] {Whatever we want here!}
+%D \setMPlayer [test] [somepos-2] {Whatever we need there!}
+%D \stoptyping
+
+\ifx\dosavepositionwhd\undefined
+ \let\dosavepositionwhd\gobblesevenarguments
+\fi
+
+\defineMPspecial{50} % x y width height label
+ {\bgroup
+ \scratchdimen\MPllx\onebasepoint\scratchdimen-\scratchdimen
+ % \scratchdimen-\MPllx\onebasepoint % moet ook werken
+ \advance\scratchdimen\gMPs1\onebasepoint
+ \edef\x{\number\scratchdimen}%
+ \scratchdimen\gMPs2\onebasepoint
+ \scratchdimen-\scratchdimen
+ \advance\scratchdimen\MPury\onebasepoint
+ \edef\y{\number\scratchdimen}%
+ \scratchdimen\gMPs3\onebasepoint
+ \edef\w{\number\scratchdimen}%
+ \scratchdimen\gMPs4\onebasepoint
+ \edef\h{\number\scratchdimen}%
+ \dosavepositionwhd{\gMPs5}0\x\y\w\h0%
+ \egroup}
+
+%D Transparency support used specials 60 (rgb) and 61
+%D (cmyk).
+%D
+%D \startbuffer
+%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0);
+%D
+%D fill p rotated 90 withcolor transparent(1,.5,yellow) ;
+%D fill p rotated 210 withcolor transparent(1,.5,green) ;
+%D fill p rotated 330 withcolor transparent(1,.5,blue) ;
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D \startlinecorrection \processMPbuffer \stoplinecorrection
+%D
+%D One can also communicate colors between \CONTEXT\ and
+%D \METAPOST:
+%D
+%D \startbuffer
+%D \definecolor[tcyan] [c=1,k=.2,t=.5]
+%D \definecolor[tmagenta][m=1,k=.2,t=.5]
+%D \definecolor[tyellow] [y=1,k=.2,t=.5]
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D \startbuffer
+%D u := 2cm ; path p ; p := fullcircle scaled u shifted (u/4,0);
+%D
+%D fill p rotated 90 withcolor \MPcolor{tcyan} ;
+%D fill p rotated 210 withcolor \MPcolor{tmagenta} ;
+%D fill p rotated 330 withcolor \MPcolor{tyellow} ;
+%D \stopbuffer
+%D
+%D \startlinecorrection \processMPbuffer \stoplinecorrection
+%D
+%D We save all the three components needed in one macro,
+%D just to save hash space.
+
+\def\@@MPST{@MPST@}
+
+\def\assignMPStransparency#1#2#3%
+ {\edef\PDFtransparencyidentifier{#1}%
+ \edef\PDFtransparencyreference {#2}%
+ \edef\PDFtransparencycolorspecs{#3}}
+
+\def\PDFtransparencyspec % todo
+ {\ifx\MPresolvedspace\MPgrayspace
+ \MPresolvedcolor\space g
+ \MPresolvedcolor\space G%
+ \else\ifx\MPresolvedspace\MPrgbspace
+ \MPresolvedcolor\space rg
+ \MPresolvedcolor\space RG%
+ \else\ifx\MPresolvedspace\MPcmykspace
+ \MPresolvedcolor\space k
+ \MPresolvedcolor\space K%
+ \else\ifx\MPresolvedspace\empty\else
+ /\MPresolvedspace\space cs
+ /\MPresolvedspace\space CS
+ \PDFgetspotcolorspec\MPresolvedcolor
+ \fi\fi\fi\fi}
+
+\defineMPspecial{3} % rgb
+ {\edef\currentMPspecial{\gMPs6}%
+ \presetPDFtransparency{\gMPs1}{\gMPs2}%
+ \expanded{\resolveMPrgbcolor\gMPs3 \gMPs4 \gMPs5}\end
+ \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug !
+ {\noexpand\assignMPStransparency
+ {\PDFtransparencyidentifier}%
+ {\PDFtransparencyreference}%
+ {\PDFtransparencyspec}}}
+
+\defineMPspecial{4} % cmyk
+ {\edef\currentMPspecial{\gMPs7}%
+ \presetPDFtransparency{\gMPs1}{\gMPs2}%
+ \expanded{\resolveMPcmykcolor\gMPs3 \gMPs4 \gMPs5 \gMPs6}\end
+ \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug !
+ {\noexpand\assignMPStransparency
+ {\PDFtransparencyidentifier}%
+ {\PDFtransparencyreference}%
+ {\PDFtransparencyspec}}}
+
+\defineMPspecial{5} % spot
+ {\edef\currentMPspecial{\gMPs7}%
+ \presetPDFtransparency{\gMPs1}{\gMPs2}%
+ \checkMPspot{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}%
+ \setevalue{\@@MPST\currentMPspecial}% was \setxvalue, bug !
+ {\noexpand\assignMPStransparency
+ {\PDFtransparencyidentifier}%
+ {\PDFtransparencyreference}%
+ {\PDFtransparencyspec}}}
+
+% beware: for the moment only supported in pdftex; needs a cleanup!
+
+\def\registerMPcolorspace
+ {\doifobjectreferencefoundelse{PDFCS}\MPspotspace
+ {\doPDFgetobjectreference{PDFCS}\MPspotspace\PDFobjectreference
+ \xdef\currentMPcolorspaces
+ {\currentMPcolorspaces\MPspotspacespec\PDFobjectreference\space}}
+ \donothing}
+
+%D We need to add resource specifications!
+
+\appendtoks
+ \global\let\currentMPcolorspaces\empty
+\to \MPstartresources
+
+\appendtoks
+ \ifx\currentMPcolorspaces\empty \else
+ \xdef\currentPDFresources{\currentPDFresources
+ /ColorSpace <<\currentMPcolorspaces>>}%
+ \fi
+\to \MPstopresources
+
+%D For efficiency reasons, we fall back on the allocation
+%D mechanisms already present. For use within \MPTOPDF, we
+%D provide a fall back routine.
+
+\let\currentMPtransparencies\empty
+
+% this one triggers a new graphic state
+
+\def\invokeMPtransparencyspecial
+ {\scratchcounter\MPrgbnumber\lastMPbvalue
+ \edef\currentMPspecial{\the\scratchcounter}%
+ \ifundefined{\@@MPST\currentMPspecial}\else
+ \getvalue{\@@MPST\currentMPspecial}%
+ \doifinstringelse\PDFtransparencyidentifier\currentMPtransparencies
+ \donothing\registerMPtransparencyresource % slow
+ \PDFcode
+ {\PDFtransparencycolorspecs\space
+ \PDFtransparencyidentifier\space gs}%
+ % potential optimization
+ % \setevalue{\@@MPST\currentMPspecial}%
+ % {\PDFcode
+ % {\PDFtransparencycolorspecs\space
+ % \PDFtransparencyidentifier\space gs}}%
+ % \getvalue{\@@MPST\currentMPspecial}%
+ \let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial
+ \fi}
+
+% this one does a reset
+
+\let\revokeMPtransparencyspecial\relax
+
+\appendtoks
+ \revokeMPtransparencyspecial
+\to \MPstopresources
+
+\def\dorevokeMPtransparencyspecial % only called if state is set
+ {\ifx\PDFtransparencyresetidentifier\empty\else
+ \doifinstringelse\PDFtransparencyresetidentifier\currentMPtransparencies
+ \donothing\registerMPtransparencyresetresource
+ \PDFcode{\PDFtransparencyresetidentifier\space gs}%
+ % potential optimization
+ % \def\dorevokeMPtransparencyspecial
+ % {\PDFcode
+ % {\PDFtransparencycolorspecs\space
+ % \PDFtransparencyidentifier\space gs}}%
+ \let\dorevokeMPtransparencyspecial\dodorevokeMPtransparencyspecial
+ \let\revokeMPtransparencyspecial\relax % invoke sets it
+ \fi}
+
+% and this one does a simplified reset
+
+\def\dodorevokeMPtransparencyspecial % used after first invocation
+ {\PDFcode{\PDFtransparencyresetidentifier\space gs}%
+ \let\revokeMPtransparencyspecial\relax} % invoke sets it
+
+% add a resource entry
+
+\def\registerMPtransparencyresource
+ {\xdef\currentMPtransparencies
+ {\currentMPtransparencies
+ \PDFtransparencyidentifier\space
+ \PDFtransparencyreference\space}}
+
+\def\registerMPtransparencyresetresource
+ {\xdef\currentMPtransparencies
+ {\currentMPtransparencies
+ \PDFtransparencyresetidentifier\space
+ \PDFtransparencyresetreference\space}}
+
+\appendtoks \invokeMPtransparencyspecial \to \invokeMPspecials
+
+\ifCONTEXT \else
+
+ \def\@@MPSTN{@MPSTN@}
+ \def\@@MPSTO{@MPSTO@}
+
+ \newcount\PDFcurrenttransparency
+
+ \let\PDFtransparencyresetidentifier\empty
+ \let\PDFtransparencyresetreference \empty
+
+ \let\PDFtransparencyidentifier\empty
+ \let\PDFtransparencyreference \empty
+
+ \def\initializePDFtransparency
+ {\global\let\initializePDFtransparency\relax
+ \presetPDFtransparency{1}{1}%
+ \xdef\PDFtransparencyresetidentifier{/Tr0}%
+ \xdef\PDFtransparencyresetreference{\the\pdflastobj\space 0 R}}
+
+ \def\presetPDFtransparency#1#2%
+ {\initializePDFtransparency
+ \@EA\ifx\csname\@@MPSTO#1:#2\endcsname\relax
+ \global\advance\PDFcurrenttransparency \plusone
+ \immediate\pdfobj{\PDFtransparencydictionary{#1}{#2}{}}%
+ \setxvalue{\@@MPSTN#1:#2}{\the\PDFcurrenttransparency}%
+ \setxvalue{\@@MPSTO#1:#2}{\the\pdflastobj}%
+ \fi
+ \edef\PDFtransparencyidentifier{/Tr\getvalue{\@@MPSTN#1:#2}}%
+ \edef\PDFtransparencyreference{\getvalue{\@@MPSTO#1:#2} 0 R}}
+
+ \def\PDFtransparencydictionary#1#2#3% type fraction extras
+ {<</Type /ExtGState
+ /ca #2 /CA #2
+ /BM /\ifcase#1 Normal\or Normal\or Multiply\or Screen\or
+ Overlay\or SoftLight\or HardLight\or ColorDodge\or
+ ColorBurn\or Darken\or Lighten\or Difference\or
+ Exclusion\else Compatible\fi
+ #3>>}
+
+\fi
+
+\appendtoks
+ \global\let\currentMPtransparencies\empty
+\to \MPstartresources
+
+\appendtoks
+ \ifx\currentMPtransparencies\empty \else
+ \xdef\currentPDFresources{\currentPDFresources
+ /ExtGState <<\currentMPtransparencies>>}%
+ \fi
+\to \MPstopresources
+
+%D In all cases, we need to keep track of the resources
+%D used.
+
+%D A few auxiliary macros:
+
+\def\MPgrayspace{DeviceGray}
+\def\MPrgbspace {DeviceRGB}
+\def\MPcmykspace{DeviceCMYK}
+\let\MPspotspace\MPgrayspace
+
+\def\MPcmykBlack{0 0 0 0}
+\def\MPcmykWhite{0 0 0 1}
+
+\ifCONTEXT
+
+ \def\startMPcolorresolve
+ {\bgroup
+ \def\dostartgraycolormode##1%
+ {\global\let\MPresolvedspace\MPgrayspace
+ \xdef\MPresolvedcolor{##1}}%
+ \def\dostartrgbcolormode ##1##2##3%
+ {\global\let\MPresolvedspace\MPrgbspace
+ \xdef\MPresolvedcolor{##1 ##2 ##3}}%
+ \def\dostartcmykcolormode##1##2##3##4%
+ {\global\let\MPresolvedspace\MPcmykspace
+ \xdef\MPresolvedcolor{##1 ##2 ##3 ##4}}%
+ \def\dostartspotcolormode##1##2%
+ {\global\let\MPspotspace\empty
+ \xdef\MPresolvedspace{##1}%
+ \xdef\MPresolvedcolor{##2}%
+ \global\let\MPspotspace\MPresolvedspace}% signal
+ \dostartgraycolormode\!!zerocount} % kind of hackery initialization
+
+ \let\stopMPcolorresolve\egroup
+
+ \def\resolveMPrgbcolor#1 #2 #3\end
+ {\startMPcolorresolve
+ \execcolorR#1:#2:#3:0:0\od
+ \stopMPcolorresolve}
+
+ \def\resolveMPcmykcolor#1 #2 #3 #4\end
+ {\startMPcolorresolve
+ \execcolorC#1:#2:#3:#4:0:0\od
+ \stopMPcolorresolve}
+
+ \def\resolveMPgraycolor#1\end
+ {\startMPcolorresolve
+ \execcolorS#1:0:0\od
+ \stopMPcolorresolve}
+
+ \def\resolveMPspotcolor#1 #2 #3 #4\end
+ {\startMPcolorresolve
+ \ifnum#2>\plusone
+ \checkmultitonecolor{#1}%
+ \fi
+ \execcolorP#1:#2:#3:#4:0:0\od
+ \stopMPcolorresolve}
+
+\else
+
+ \def\resolveMPspotcolor#1 #2\end
+ {\global\let\MPresolvedspace\MPgrayspace
+ \xdef\MPresolvedcolor{0}}
+
+ \def\resolveMPrgbcolor#1 #2 #3\end
+ {\global\let\MPresolvedspace\MPrgbspace
+ \xdef\MPresolvedcolor{#1 #2 #3}}
+
+ \def\resolveMPcmykcolor#1 #2 #3 #4\end
+ {\global\let\MPresolvedspace\MPcmykspace
+ \xdef\MPresolvedcolor{#1 #2 #3 #4}}
+
+ \def\resolveMPgraycolor#1\end
+ {\global\let\MPresolvedspace\MPgrayspace
+ \xdef\MPresolvedcolor{#1}} % should be inverted
+
+\fi
+
+%D Begin of soon obsolete code.
+
+%D \macros
+%D {dogetPDFmediabox}
+%D
+%D The next macro can be used to find the mediabox of a \PDF\
+%D illustration.
+%D
+%D \starttyping
+%D \dogetPDFmediabox
+%D {filename}
+%D {new dimen}{new dimen}{new dimen}{new dimen}
+%D \stoptyping
+%D
+%D Beware of dimen clashes: this macro uses the 5~default
+%D scratch registers! When no file or mediabox is found, the
+%D dimensions are zeroed.
+
+\def\dogetPDFmediabox#1#2#3#4#5%
+ {\bgroup
+ \def\PDFxscale{1}%
+ \def\PDFyscale{1}%
+ \uncatcodespecials
+ \endlinechar\minusone
+ \def\checkPDFtypepage##1/Type /Page##2##3\done%
+ {\ifx##2\relax
+ \else\if##2s% accept /Page and /Pages
+ \let\doprocessPDFline\findPDFmediabox
+ \else
+ \let\doprocessPDFline\findPDFmediabox
+ \fi\fi}%
+ \def\findPDFtypepage
+ {\expandafter\checkPDFtypepage\fileline/Type /Page\relax\done}%
+ \def\checkPDFmediabox##1/MediaBox##2##3\done%
+ {\ifx##2\relax \else
+ \setPDFmediabox##2##3\done
+ \fileprocessedtrue
+ \fi}%
+ \def\findPDFmediabox
+ {\expandafter\checkPDFmediabox\fileline/MediaBox\relax\done}%
+ \let\doprocessPDFline\findPDFtypepage
+ \doprocessfile\scratchread{#1}\doprocessPDFline
+ \egroup
+ \ifx\PDFxoffset\undefined
+ #2\zeropoint
+ #3\zeropoint
+ #4\zeropoint
+ #5\zeropoint
+ \else
+ #2=\PDFxoffset\onebasepoint
+ #3=\PDFyoffset\onebasepoint
+ #4=\PDFwidth
+ #5=\PDFheight
+ \fi}
+
+\def\setPDFboundingbox#1#2#3#4#5#6%
+ {\dimen0=#1\dimen0=#5\dimen0
+ \ScaledPointsToBigPoints{\number\dimen0}\PDFxoffset
+ \dimen0=#3\dimen0=#5\dimen0
+ \xdef\PDFwidth{\the\dimen0}%
+ \dimen0=#2\dimen0=#6\dimen0
+ \ScaledPointsToBigPoints{\number\dimen0}\PDFyoffset
+ \dimen0=#4\dimen0=#6\dimen0
+ \xdef\PDFheight{\the\dimen0}%
+ \global\let\PDFxoffset\PDFxoffset
+ \global\let\PDFyoffset\PDFyoffset}
+
+\def\setPDFmediabox#1[#2 #3 #4 #5]#6\done
+ {\dimen2=#2bp\dimen2=-\dimen2 % \dimen2=-#2bp also works since tex handles --
+ \dimen4=#3bp\dimen4=-\dimen4 % \dimen4=-#3bp also works since tex handles --
+ \dimen6=#4bp\advance\dimen6 \dimen2
+ \dimen8=#5bp\advance\dimen8 \dimen4
+ \setPDFboundingbox{\dimen2}{\dimen4}{\dimen6}{\dimen8}\PDFxscale\PDFyscale}
+
+%D End of soon obsolete code.
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/meta-tex.tex b/Master/texmf-dist/tex/context/base/meta-tex.tex
new file mode 100644
index 00000000000..c49021d2e8a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/meta-tex.tex
@@ -0,0 +1,206 @@
+%D \module
+%D [ file=meta-tex,
+%D version=2006.06.07,
+%D title=\CONTEXT\ Support Macros,
+%D subtitle=\METAPOST\ fast text insertion,
+%D author=Hans Hagen,
+%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.
+
+%D Many thanks to Fabrice Popineau and Taco Hoekwater in helping me
+%D figure out some aspects of the text inclusion method implemented
+%D here. The following code is derived from a more advanced (and to
+%D be used) mechanism where \TEX, \METAPOST\ and \LUA\ play together.
+
+%D Much of this mechanism was written with running live DVD's of
+%D the Dave Matthews band in the background (or the corner of my
+%D screen).
+
+\unprotect
+
+\newwrite\TeXtextwrite
+
+\def\openTeXtexts {\immediate\openout \TeXtextwrite\currentTeXtext.mpb\relax}
+\def\closeTeXtexts{\immediate\closeout\TeXtextwrite}
+
+\def\currentTeXtext{\jobname-mpgraph}
+
+\initializeboxstack\currentTeXtext
+
+\newtoks\collectedmptexts
+
+\long\def\startTeXtexts#1\stopTeXtexts
+ {\global\collectedmptexts\expandafter{\the\collectedmptexts#1}}
+
+\def\dostartTeXtexts
+ {\global\setfalse\TeXtextdone
+ \startnointerference
+ \the\everyMPTEXgraphic
+ \openTeXtexts
+ \ifrunMPgraphics
+ \initializeboxstack\currentTeXtext
+ \else
+ \global\let\openTeXtexts\relax
+ \global\let\finishTeXtexts\closeTeXtexts
+ \fi}
+
+\def\dostopTeXtexts
+ {\ifrunMPgraphics
+ \closeTeXtexts
+ \fi
+ \stopnointerference}
+
+\let\finishTeXtexts\relax
+
+\appendtoks
+ \finishTeXtexts
+\to \everystoptext
+
+\newconditional\TeXtextdone
+
+% \long\def\TeXtext#1%
+% {\dowithnextboxcontent
+% {\setnormalcatcodes}
+% {\global\settrue\TeXtextdone
+% \immediate\write\TeXtextwrite{savetxt(#1,\the\wd\nextbox,\the\ht\nextbox,\the\dp\nextbox);}%
+% \savebox\currentTeXtext{#1}{\box\nextbox}}
+% \hbox}
+
+\long\def\TeXtext
+ {\dosingleempty\doTeXtext}
+
+\long\def\doTeXtext[#1]#2#3%
+ {\begingroup
+ \setbox\nextbox\hbox
+ {\setnormalcatcodes
+ \newlinechar=`\^^M
+ \everyeof\emptytoks
+ %\def\ascii{#3}%
+ %\scantokens\expandafter{\ascii}}%
+ \scantokens{#3}}%
+ \global\settrue\TeXtextdone
+ \edef\currenttextxt{\number#2}%
+ \executeifdefined{textext::#1}{\getvalue{textext::depth}}%
+ \savebox\currentTeXtext\currenttextxt{\box\nextbox}%
+ \endgroup}
+
+\setvalue{textext::depth}{\immediate\write\TeXtextwrite{savetxt(\currenttextxt,\the\nextboxwd,\the\nextboxht,\the\nextboxdp) shifted (0,-\the\nextboxdp);}}
+\setvalue{textext::nodepth}{\immediate\write\TeXtextwrite{savetxt(\currenttextxt,\the\nextboxwd,\the\nextboxht,\the\nextboxdp);}}
+
+\setvalue{textext::d}{\getvalue{textext::depth}}
+\setvalue{textext::n}{\getvalue{textext::nodepth}}
+
+\newbox\mptextbox
+
+%definefontsynonym[MPtxtfont][texnansi-lmtt10] \loadmapfile[lm-texnansi.map]
+\definefontsynonym[MPtxtfont][texnansi-lmtt10] \loadmapfile[texnansi-public-lm.map]
+
+\definefont[localMPtxtfont][MPtxtfont at 10bp]
+
+\ifx\getTeXtext\undefined
+
+ % this took a while to figure out
+
+ % \def\getTeXtext
+ % {\localMPtxtfont
+ % \setbox\mptextbox\hbox{\foundbox\currentTeXtext{\number\nofTeXtexts}}%
+ % \setbox\scratchbox\hbox{\MPtextdata}%
+ % \edef\mpwd{\the\dimexpr\MPtextsize\dimexpr\wd\scratchbox/10\relax\relax}%
+ % \edef\mpht{\the\dimexpr\MPtextsize\dimexpr\ht\scratchbox/10\relax\relax}%
+ % \setbox\mptextbox\hbox{\raise\dp\mptextbox\box\mptextbox}%
+ % \dp\mptextbox\zeropoint
+ % \scale[\c!width=\mpwd,\c!height=\mpht]{\box\mptextbox}}%
+
+ \def\getTeXtext
+ {\localMPtxtfont
+ \setbox\mptextbox\hbox{\foundbox\currentTeXtext{\number\nofTeXtexts}}%
+ \setbox\scratchbox\hbox{\MPtextdata}%
+ \edef\mpwd{\the\dimexpr\MPtextsize\dimexpr\wd\scratchbox/10\relax\relax}%
+ \edef\mpht{\the\dimexpr\MPtextsize\dimexpr\ht\scratchbox/10\relax\relax}%
+ \setbox\mptextbox\hbox{\raise\dp\mptextbox\box\mptextbox}%
+ \dp\mptextbox\zeropoint
+ \scale[\c!width=\mpwd,\c!height=\mpht]{\box\mptextbox}}
+
+\fi
+
+\setvalue{handleMPtext00001}% only height in tag (00001)
+ {\setbox\scratchbox\hbox
+ {\obeyMPspecials
+ \edef\nofTeXtexts{\number\MPtextnumber}%
+ \getTeXtext}%
+ \setbox\scratchbox\hbox
+ {\hskip\lastMPmoveX\onebasepoint\raise\lastMPmoveY\onebasepoint
+ \box\scratchbox}%
+ \ht\scratchbox\zeropoint
+ \dp\scratchbox\zeropoint
+ \wd\scratchbox\zeropoint
+ \box\scratchbox}
+
+\startMPextensions
+ string txtfile ; txtfile := "\currentTeXtext.mpb" ;
+ string txtfont ; txtfont := "\truefontname{MPtxtfont}" ;
+ string txtpref ; txtpref := "00001::::" ;
+\stopMPextensions
+
+% \long\def\filtersometxt#1\sometxt#2#3#4%
+% {\ifx#3\empty
+% \else
+% \increment\txtcounter
+% \TeXtext\txtcounter{#2}%
+% \expandafter\filtersometxt
+% \fi#3#4}
+
+\long\def\dodofiltersometxt#1#2#3%
+ {\ifx#2\empty
+ \else
+ \increment\txtcounter
+ \TeXtext\txtcounter{#1}%
+ \expandafter\filtersometxt
+ \fi#2#3}
+
+\long\def\redofiltersometxt[#1]#2%
+ {\increment\txtcounter
+ \TeXtext[#1]\txtcounter{#2}%
+ \filtersometxt}
+
+\long\def\filtersometxt#1\sometxt
+ {\doifnextcharelse[\redofiltersometxt\dodofiltersometxt}
+
+% \filtersometxt abc\sometxt{def};hij\sometxt{klm};\sometxt{}\empty\relax
+
+\long\def\flushTeXtexts#1%
+ {\newcounter\txtcounter
+ \dostartTeXtexts
+ \the\collectedmptexts
+ \filtersometxt#1\sometxt{}\empty\relax
+ \dostopTeXtexts
+ \ifconditional\TeXtextdone
+ \immediate\write\MPwrite{loadtxts ; txtnext := 0 ;}%
+ \global\collectedmptexts\emptytoks
+ \fi
+ \newcounter\txtcounter}
+
+% \long\def\sometxt#1{sometxt(nexttxt)} % to be used in mp definitions, no ; here
+
+\long\def\sometxt #1#{\dosometxt} % grab optional [args]
+\long\def\dosometxt#1{sometxt(nexttxt)} % to be used in mp definitions, no ; here
+
+% we redefine the writer:
+
+\long\def\writecheckedMPgraphic#1%
+ {\ifforceMPTEXgraphic
+ \global\MPTEXgraphictrue
+ \else
+ \global\MPTEXgraphicfalse
+ \edef\ascii{#1}\convertcommand\ascii\to\MPascii
+ \the\MPTEXgraphicchecks\relax % \relax is end condition!
+ \fi
+ \flushMPTEXgraphic% % verbatimtex etc
+ \flushTeXtexts{#1}% added
+ \writeMPgraphic{#1}} % potential optimization: pass \ascii
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/meta-txt.tex b/Master/texmf-dist/tex/context/base/meta-txt.tex
index 6f8be2e67b6..e6817563575 100644
--- a/Master/texmf-dist/tex/context/base/meta-txt.tex
+++ b/Master/texmf-dist/tex/context/base/meta-txt.tex
@@ -26,9 +26,9 @@
\unprotect
-\appendtoks
+\startMPextensions
if unknown context_text: input mp-text; fi;
-\to \MPextensions
+\stopMPextensions
%%%%%%%
diff --git a/Master/texmf-dist/tex/context/base/mult-com.tex b/Master/texmf-dist/tex/context/base/mult-com.tex
index 3f8f616806a..0582c34727e 100644
--- a/Master/texmf-dist/tex/context/base/mult-com.tex
+++ b/Master/texmf-dist/tex/context/base/mult-com.tex
@@ -54,1798 +54,2371 @@
\startcommands dutch english
german czech
italian romanian
+ french
language: taal language
sprache jazyk
lingua limba
+ langue
mainlanguage: hoofdtaal mainlanguage
hauptsprache hlavnijazyk
linguaprincipale limbaprincipala
+ langueprincipale
translate: vertaal translate
uebersetzten prelozit
traduci traduce
+ traduire
installlanguage: installeertaal installlanguage
installieresprache instalacejazyka
installalingua instalarelimba
+ installelangue
setuplanguage: steltaalin setuplanguage
stellespracheein nastavjazyk
impostalingua setarelimba
+ reglelangue
showmakeup: toonopmaak showmakeup
zeigeumbruch ukazupravu
mostramakeup afiseazamakeup
+ montremakeup
useencoding: usecodering useencoding
benutzekodierung uzijkodovani
usacodifica folosestecodificarea
+ utiliseencodage
usespecials: gebruikspecials usespecials
benutzespezielles uzijspeciality
usaspecialita folosestespeciale
+ utilisespecialites
defineoutput: definieeruitvoer defineoutput
defineoutput definujvystup
definiscioutput definesteoutput
+ definitsortie
setupoutput: steluitvoerin setupoutput
stelleausgabeein nastavvystup
impostaoutput setareoutput
+ reglesortie
defineaccent: definieeraccent defineaccent
definiereakzent definujakcent
definisciaccento definesteaccent
+ definitaccent
definecharacter: definieerkarakter definecharacter
definierezeichen definujznak
definiscicarattere definestecaracter
+ definicaractere
definecommand: definieercommando definecommand
definierebefehl definujprikaz
definiscicomando definestecomanda
+ definitcommande
startcoding: startcodering startcoding
startkodierung startkodovani
iniziacodifica startcodificare
+ demarrecodage
stopcoding: stopcodering stopcoding
stopkodierung stopkodovani
terminacodifica stopcodificare
+ stoppecodage
definebodyfontenvironment: definieerkorpsomgeving definebodyfontenvironment
definierefliesstextumgebung definujprostredizakladnihofontu
definisciambientefontdeltesto definestemediulfonttext
+ definitenvironnementpolicecorps
setupbodyfontenvironment: stelkorpsomgevingin setupbodyfontenvironment
stellefliesstextumgebungein nastavprostredizakladnihofontu
impostaambientefontdeltesto seteazamediulfonttext
+ regleenvironnementpolicecorps
definebodyfont: definieerkorps definebodyfont
definierefliesstext definujzakladnifont
definiscifontdeltesto definestefonttext
+ definitpolicecorps
definefont: definieerfont definefont
definiereschrift definujfont
definiscifont definestefont
+ definitpolice
definefontsynonym: definieerfontsynoniem definefontsynonym
defineschriftsynonym definujsynonumumfontu
definiscisinonimofont definestesinonimfont
+ definitsynonymepolice
definestyle: definieerletter definestyle
definierestil definujstyl
definiscistile definestestil
+ definitstyle
definefontstyle: definieerfontstijl definefontstyle
definiereschriftstil definujstylfontu
definiscistilefont definestestilfont
+ definitstylepolice
setupstrut: stelstrutin setupstrut
setupstrut setupstrut
impostastrut seteazastrut
+ reglestrut
setuptype: steltypein setuptype
stelletipein nastavtype
impostatype seteazatype
+ regletype
type: type type
tippen opis
type type
+ dactylographier
typ: typ typ
tip pis
typ typ
+ typ
arg: arg arg
arg arg
arg arg
+ arg
tex: tex tex
tex tex
tex tex
+ tex
definetyping: definieertypen definetyping
definieretippen definujopis
definiscityping definestetyping
+ definitdactylo
definetype: definieertype definetype
definetype definetype
definiscitype definetype
+ definittype
setuptyping: steltypenin setuptyping
stelletippenein nastavopis
impostatyping seteazatyping
+ regledactylo
typefile: typefile typefile
tippedatei opissoubor
typefile typefile
+ fichierdactylo
setupfootnotes: stelvoetnotenin setupfootnotes
stellefussnotenein nastavpoznamkypodcarou
impostanotepdp seteazanotasubsol
+ reglenotepdp
setupfootnotedefinition: stelvoetnootdefinitiein setupfootnotedefinition
stellefussnotendefinitionein nastavdefinicipoznamekpodcarou
impostadefinizionenotepdp seteazadefinireanotasubsol
+ definitnotepdp
note: noot note
notiz poznamka
nota nota
+ note
footnote: voetnoot footnote
fussnote poznamkapodcarou
notapdp notasubsol
+ notepdp
footnotetext: voetnoottekst footnotetext
footnotetext footnotetext
testonotapdp footnotetext
+ textenotepdp
startlocalfootnotes: startlokalevoetnoten startlocalfootnotes
startlokalefussnoten startlokalnipoznamkypodcarou
inizianotepdplocali startnotesubsollocale
+ demarrenotespdplocales
stoplocalfootnotes: stoplokalevoetnoten stoplocalfootnotes
stoplokalefussnoten stoplokalnipoznamkypodcarou
terminanotepdplocali stopnotesubsollocale
+ stoppenotespdplocales
placelocalfootnotes: plaatslokalevoetnoten placelocalfootnotes
platzierelokalefussnoten umistilokalnipoznamkypodcarou
mettinotepdplocali punenotesubsollocale
+ placenotespdplocales
placefootnotes: plaatsvoetnoten placefootnotes
platzierefussnoten umistipoznamkypodcarou
mettinotepdp punenotesubsol
+ placenotespdp
currentdate: huidigedatum currentdate
heutigesdatum aktualnidatum
datadioggi datacurenta
+ datecourante
date: datum date
datum datum
data data
+ date
weekday: weekdag weekday
wochentag vsedniden
giornosettimana zidinsaptamana
+ joursemaine
WEEKDAY: WEEKDAG WEEKDAY
WOCHENTAG VSEDNIDEN
GIORNOSETTIMANA ZIDINSAPTAMANA
+ JOURSEMAINE
month: maand month
monat mesic
mese luna
+ mois
MONTH: MAAND MONTH
MONAT MESIC
MESE LUNA
+ MOIS
Numbers: Cijfers Numbers
Ziffern Cisla
Numeri Numere
+ Numeros
numbers: cijfers numbers
ziffern cisla
numeri numere
+ numeros
romannumerals: romeins romannumerals
roemischezahlen rimskecislice
numeriromani numereromane
+ chiffresromains
Romannumerals: Romeins Romannumerals
Roemischezahlen Rimskecislice
Numeriromani Numereromane
+ Chiffresromains
character: letter character
buchstabe znak
lettera litera
+ caractere
Character: Letter Character
Buchstabe Znak
Lettera Litera
+ Caractere
characters: letters characters
buchstaben znaky
lettere litere
+ caracteres
Characters: Letters Characters
Buchstaben Znaky
Lettere Litere
+ Caracteres
unknown: onbekend unknown
unbekant neznamo
ignoto necunoscut
+ inconnu
definesymbol: definieersymbool definesymbol
definieresymbol definujsymbol
definiscisimbolo definestesimbol
+ definitsymbole
definefiguresymbol: definieerfiguursymbool definefiguresymbol
definiereabbsymbol definujobrazeksymbol
definiscifigurasimbolo definestesimbolfigura
+ definitsymbolefigure
symbol: symbool symbol
symbol symbol
simbolo simbol
+ symbole
setupsymbolset: stelsymboolsetin setupsymbolset
stellesymbolsetein nastavsadusymbolu
impostasetsimboli seteazasimbol
+ reglejeusymboles
showsymbolset: toonsymboolset showsymbolset
showsymbolset ukazsadusymbolu
mostrasetsimboli afiseazasetsimboluri
+ montrejeusymboles
startsymbolset: startsymboolset startsymbolset
startsymbolset startsadasymbolu
iniziasetsimboli startsetsimboluri
+ demarrejeusymboles
usesymbols: gebruiksymbolen usesymbols
verwendesymbole uzijsymbol
usasimboli folosestesimboluri
+ utilisesymboles
defineconversion: definieerconversie defineconversion
definierekonversion definujkonverzi
definisciconversione definesteconversie
+ definitconversion
convertnumber: converteernummer convertnumber
konvertierezahl konvertujcislo
convertinumero convertestenumar
+ convertitnumero
setupcapitals: stelkapitalenin setupcapitals
stelleversalienein nastavkapitalky
impostamaiuscole seteazamajuscule
+ reglecapitales
smallcapped: kap cap
kap kap
cap kap
+ cap
notsmallcapped: nokap nocap
nokap nokap
nocap nokap
+ nocap
CAPPED: KAP CAP
KAP KAP
CAP KAP
+ CAP
SmallCapped: Kap Cap
Kap Kap
Cap Kap
+ Cap
SmallCaps: Kaps Caps
Kaps Kaps
Caps Kaps
+ Caps
WORD: WOORD WORD
WORT SLOVO
PAROLA CUVANT
+ MOT
WORDS: WOORDEN WORDS
WOERTER SLOVA
PAROLE CUVINTE
+ MOTS
Word: Woord Word
Wort Slovo
Parola Cuvant
+ Mot
Words: Woorden Words
Woerter Slova
Parole Cuvinte
+ Mots
stretched: uitgerekt stretched
gestreckt roztazene
stirato intins
+ etire
overstrike: doorstreep overstrike
durchgestrichen preskrtnuto
sbarrato liniepeste
+ surlignetout
overstrikes: doorstrepen overstrikes
durchstreichen preskrtnuti
sbarrati liniipeste
+ surligne
overbar: overstreep overbar
ueberstrichen nadtrzeno
sopralinea barasus
+ overbar
overbars: overstrepen overbars
ueberstreichen nadtrzeni
sopralinee supralinie
+ overbars
underbar: onderstreep underbar
unterstrichen podtrzeno
sottolinea sublinie
+ souslignetout
underbars: onderstrepen underbars
unterstreichen podtrzeni
sottolinee sublinii
+ sousligne
setupunderbar: stelonderstrepenin setupunderbar
stelleunterstreichenein nastavpodtrzeni
impostasottolinea seteazasublinie
+ reglesouslignage
setupbodyfont: stelkorpsin setupbodyfont
stellefliesstextein nastavzakladnifont
impostafontdeltesto seteazafonttext
+ reglepolicecorps
switchtobodyfont: switchnaarkorps switchtobodyfont
wechselezumfliesstext prepninazakladnifont
cambiaafontdeltesto trecilafonttext
+ changepolicecorps
showbodyfont: toonkorps showbodyfont
zeigefliesstext ukazzakladnifont
mostrafontdeltesto afiseazafonttext
+ montrepolicecorps
showbodyfontenvironment: toonkorpsomgeving showbodyfontenvironment
zeigefliesstextumgebung ukazpostredizakladnihofontu
mostraambientefontdeltesto afiseazamediufonttext
+ montreenvironnementpolicecorps
headtext: koptekst headtext
ueberschrifttext texthlavicky
testoinstestazioni texttitlu
+ textetete
labeltext: labeltekst labeltext
labeltext textpopisku
testoetichetta texteticheta
+ labeltexte
LABELTEXT: LABELTEKST LABELTEXT
LABELTEXT TEXTPOPISKU
TESTOETICHETTA TEXTETICHETA
+ LABELTEXTE
setupheadtext: stelkoptekstin setupheadtext
stelleueberschrifttextein nastavtexthlavicky
impostatestointestazioni seteazatexttitlu
+ regletextetete
setuplabeltext: stellabeltekstin setuplabeltext
stellelabeltextein nastavtextpopisku
impostatestoetichette seteazatexteticheta
+ reglelabeltexte
marginrule: kantlijn marginrule
marginallinie marginalnilinka
lineamargine liniemargine
+ margereglee
startmarginrule: startkantlijn startmarginrule
startmarginallinie startmarginalnilinka
inizialineamargine startliniemargine
+ demarremargereglee
stopmarginrule: stopkantlijn stopmarginrule
stopmarginallinie stopmarginalnilinka
terminalineamargine stopliniemargine
+ stoppemargereglee
setupmarginrules: stelkantlijnin setupmarginrules
stellemarginallinieein nastavmarginalnilinky
impostalineemargine seteazaliniimargine
+ reglemargereglee
blackrule: blokje blackrule
rechteck cernalinka
lineanera linieneagra
+ lignenoire
blackrules: blokjes blackrules
rechtecke cernelinky
lineenere liniinegre
+ lignesnoires
setupblackrules: stelblokjesin setupblackrules
stellerechteckein nastavcernelinky
impostalineenere seteazaliniinegre
+ reglelignesnoires
setupscreens: stelrastersin setupscreens
stellerasterein nastavrastr
impostaschermi seteazaecrane
+ regleecrans
framed: omlijnd framed
umrahmt oramovani
incorniciato framed
+ framed
inframed: inlijnd inframed
imumriss zaramovani
circondato inframed
+ inframed
mframed: wilijnd maframed
maumrise maoramovani
maframed maframed
+ mframed
inmframed: inwilijnd inmaframed
immaumrise mazaramovani
inmaframed inmaframed
+ inmframed
setupframed: stelomlijndin setupframed
stelleumrahmtein nastavoramovani
impostaincorniciato seteazainconjurat
+ regleencadre
setuplinewidth: stellijndiktein setuplinewidth
stellelinienbreiteein nastavsirkucary
impostaampiezzariga seteazagrosimelinie
+ regleepaisseurligne
setupthinrules: steldunnelijnenin setupthinrules
stelleduennerumrissein nastavtenkelinky
impostalineesottili seteazaliniesubtire
+ regletraitsfins
thinrule: dunnelijn thinrule
duennelinie tenkalinka
lineasottile liniesubtire
+ traitfin
thinrules: dunnelijnen thinrules
duennerumriss tenkelinky
lineesottili liniisubtiri
+ traitsfins
hairline: haarlijn hairline
haarlinie vlasovalinka
capello firdepar
+ ligneh
vl: vl vl
vl vl
vl vl
+ vl
hl: hl hl
hl hl
hl hl
+ hl
defineframed: definieeromlijnd defineframed
definiereumrahmt definujoramovani
definisciincorniciato definesteinconjurare
+ defineframed
defineframedtext: definieerkadertekst defineframedtext
definiereumrahmtertext definujoramovanytext
definiscitestoincorniciato definestetextinconjurat
+ defineframedtext
setupframedtexts: stelkadertekstenin setupframedtexts
stelleumrahmtetexteein nastavoramovanetexty
impostatestiincorniciati definestetexteinconjurate
+ setupframedtexts
defineoverlay: definieeroverlay defineoverlay
definiereoverlay definujprekryv
definiscisovrapposizione definesteoverlay
+ definitrevetement
definelayer: definieerlayer definelayer
definelayer definelayer
definelayer definelayer
+ definitcalque
background: achtergrond background
hintergrund pozadi
sfondo fundal
+ arriereplan
startbackground: startachtergrond startbackground
starthintergrund startpozadi
iniziasfondo startfundal
+ demarrearriereplan
stopbackground: stopachtergrond stopbackground
stophintergrund stoppozadi
terminasfondo stopfundal
+ stoppearriereplan
setupbackground: stelachtergrondin setupbackground
stellehintergrundein nastavpozadi
impostasfondo seteazafundal
+ reglearriereplan
fillinrules: invullijnen fillinrules
gefuelltesrechteck vyplnovelinky % ve formulari
lineeriempimento rigleumplere
+ remplitlignesreglees
setupfillinrules: stelinvullijnenin setupfillinrules
stellegefuelltesrechteckein nastavvyplnovelinky
impostalineeriempimento seteazarigleumplere
+ regleremplitlignesreglees
fillintext: invultekst fillintext
ausfuelltext vyplnenytext
testoriempimento textumplere
+ remplittexte
setupfillinlines: stelinvulregelsin setupfillinlines
stellegefuelltezeileein nastavvyplnoveradky
impostarigheriempimento seteazaliniiumplere
+ regleremplitligne
fillinline: invulregel fillinline
gefuelltezeile vyplnovyradek
rigariempimento linieumplere
+ remplitligne
setuptextrules: steltekstlijnenin setuptextrules
stelletextumrissein nastavtextovelinky
impostalineetesto seteazarigletext
+ reglelignesreglestexte
textrule: tekstlijn textrule
textlinie textovalinka
lineatesto riglatext
+ ligneregleetexte
starttextrule: starttekstlijn starttextrule
starttextlinie starttextovalinka
inizialineatesto startriglatext
+ demarreligneregleetexte
stoptextrule: stoptekstlijn stoptextrule
stoptextlinie stoptextovalinka
terminalineatesto stopriglatext
+ stoppeligneregleetexte
usemodule: gebruikmodule usemodule
verwendemodul uzijmodul
usamodulo folosestemodul
+ utilisemodule
usemodules: gebruikmodules usemodules
verwendemodule uzijmoduly
usamoduli folosestemodule
+ utilisemodules
starttext: starttekst starttext
starttext starttext
iniziatesto starttext
+ demarretexte
stoptext: stoptekst stoptext
stoptext stoptext
terminatesto stoptext
+ stoppetexte
margintitle: margetitel margintitle
marginaltitel marginalninadpis
titoloinmargine titlumarginal
+ titremarge
marginword: margewoord marginword
marginalwort marginalnislovo
parolainmargine cuvantmarginal
+ motmarge
margintext: margetekst margintext
marginaltext marginalnitext
testoinmargine textmarginal
+ textemarge
inleft: inlinker inleft
imlinken vlevo
insinistra instanga
+ dansgauche
inmargin: inmarge inmargin
inmarginalie naokraj
inmargine marginal
+ dansmarge
inothermargin: inanderemarge inothermargin
inanderermarginale nadruhyokraj
inaltromargine inaltamargine
+ dansautremarge
inright: inrechter inright
imrechten vpravo
indestra indreapta
-ininner: inbinnen ininner
- ininner ininner
- ininner ininner
-inouter: inbuiten inouter
- inouter inouter
- inouter inouter
+ dansdroite
+ ininner: inbinnen ininner
+ ininner ininner
+ ininner ininner
+ ininner
+ inouter: inbuiten inouter
+ inouter inouter
+ inouter inouter
+ inouter
startmarginblock: startmargeblok startmarginblock
startmarginalblock startmarginalniblok
iniziabloccomargine startblocmarginal
+ demarreblocmarge
stopmarginblock: stopmargeblok stopmarginblock
stopmarginalblock stopmarginalniblok
terminabloccomargine stopblocmarginal
-defineinmargin: definieerinmarge defineinmargin
- defineinmargin defineinmargin
- defineinmargin defineinmargin
+ stoppeblocmarge
+ defineinmargin: definieerinmarge defineinmargin
+ defineinmargin defineinmargin
+ defineinmargin defineinmargin
+ definitdansmarge
setupinmargin: stelinmargein setupinmargin
stelleinmarginalieein nastavmarginalie
impostainmargine seteazamarginal
+ regledansmarge
setupmarginblocks: stelmargeblokkenin setupmarginblocks
stellemarginalblockein nastavmarginalniblok
impostablocchimargine seteazablocurimarginale
+ regleblocmarge
inleftedge: inlinkerrand inleftedge
imlinkenrand nalevo
inlatosinistro inparteastanga
+ dansbordgauche
inleftmargin: inlinkermarge inleftmargin
inlinkermarginale nalevyokraj
inmarginesinistro inmargineastanga
+ dansmargegauche
inrightmargin: inrechtermarge inrightmargin
inrechtermarginale napravyokraj
inmarginedestro inmargineadreapta
+ dansmargedroite
inrightedge: inrechterrand inrightedge
imrechtenrand napravo
inlatodestro inparteadreapta
- atleftmargin: oplinkermarge atleftmargin
- atleftmargin atleftmargin
- atleftmargin atleftmargin
-atrightmargin: oprechtermarge atrightmargin
- atrightmargin atrightmargin
- atrightmargin atrightmargin
-
+ dansborddroit
+ atleftmargin: oplinkermarge atleftmargin
+ atleftmargin atleftmargin
+ atleftmargin atleftmargin
+ atleftmargin
+ atrightmargin: oprechtermarge atrightmargin
+ atrightmargin atrightmargin
+ atrightmargin atrightmargin
+ atrightmargin
wordright: woordrechts wordright
wortrechts slovovpravo
paroladestra cuvantdreapta
+ motdroit
defineblank: definieerblanko defineblank
definiereblanko definujpreskok
definiscirigovuoto definesteblanc
+ definitvide
blank: blanko blank
blanko preskoc
rigovuoto blanc
+ vide
setupblank: stelblankoin setupblank
stelleblankoein nastavpreskok
impostarigovuoto seteazablanc
+ definitvide
correctwhitespace: corrigeerwitruimte correctwhitespace
korrigierezwischenraum korekcebilehomista
correggispaziobianco corecteazaspatiualb
+ corrigeespaceblanc
fixedspaces: vastespaties fixedspaces
festesspatium tvrdemezery
spazifissi spatiifixate
+ espacesfixes
fixedspace: vastespatie fixedspace
festesspatium tvrdamezera
spaziofisso spatiufixat
+ espacefixe
nospace: geenspatie nospace
keinspatium zadnamezera
nientespazio faraspatiu
+ sansespace
space: spatie space
spatium mezera
spazio spatiu
+ espace
nowhitespace: geenwitruimte nowhitespace
keinzwischenraum zadnebilemisto
nientespaziobianco faraspatiualb
+ sansespaceblanc
packed: opelkaar packed
kleinerdurchschuss zhustene
impaccato impachetat
+ groupe
startpacked: startopelkaar startpacked
startkleinerdurchschuss startzhustene
iniziaimpaccato startimpachetat
+ demarregroupe
stoppacked: stopopelkaar stoppacked
stopkleinerdurchschuss stopzhustene
terminaimpaccato stopimpachetat
+ stoppegroupe
startunpacked: startvanelkaar startunpacked
startgrosserdurchschuss startnezhustene
iniziaunpacked startneimpachetat
+ demarredegroupe
stopunpacked: stopvanelkaar stopunpacked
stopgrosserdurchschuss stopnezhustene
terminaunpacked stopneimpachetat
+ stoppedegroupe
startlinecorrection: startregelcorrectie startlinecorrection
startzeilenkorrektur startkorekceradku
iniziacorrezioneriga startcorectielinie
+ demarrecorrectionligne
stoplinecorrection: stopregelcorrectie stoplinecorrection
stopzeilenkorrektur stopkorekceradku
terminacorrezioneriga stopcorectielinie
+ stoppecorrectionligne
godown: omlaag godown
nachunten jdidolu
vaigiu injos
+ vaenbas
whitespace: witruimte whitespace
zwischenraum bilemisto
spaziobianco spatiualb
+ espaceblanc
noindenting: nietinspringen noindenting
nichteinziehen zadneodsazovani
nienterientro faraaliniat
+ sansalinea
indenting: inspringen indenting
einziehen odsazovani
rientro aliniat
+ composeenalinea
setupindenting: stelinspringenin setupindenting
stelleeinziehenein nastavodsazovani
impostarientro seteazaaliniat
+ reglecomposeenalinea
startalignment: startuitlijnen startalignment
startausrichtung startzarovnavani
iniziaallineamento startaliniere
+ demarrealignement
stopalignment: stopuitlijnen stopalignment
stopausrichtung stopzarovnavani
terminaallineamento stopaliniere
+ stoppealignement
startlines: startregels startlines
startzeilen startradky
iniziarighe startlinii
+ demarrelignes
stoplines: stopregels stoplines
stopzeilen stopradky
terminarighe stoplinii
+ stoppelignes
setupparagraphnumbering: stelparagraafnummerenin setupparagraphnumbering
stelleabsatznummerierungein nastavcislovaniodstavcu
impostanumerazionecapoversi seteazanumerotareparagrafe
+ reglenumerotationparagraphe
setuplinenumbering: stelregelnummerenin setuplinenumbering
stellezeilennumerierungein nastavcislovaniradku
impostanumerazionerighe seteazanumerotarelinii
+ reglenumerotationligne
startlinenumbering: startregelnummeren startlinenumbering
startzeilennumerierung startcislovaniradku
inizianumerazionerighe startnumerotarelinii
+ demarrenumerotationligne
stoplinenumbering: stopregelnummeren stoplinenumbering
stopzeilennumerierung stopcislovaniradku
terminanumerazionerighe stopnumerotarelinii
+ stoppenumerotationligne
startline: startregel startline
startzeile startradek
iniziariga startlinie
+ demarreligne
stopline: stopregel stopline
stopzeile stopradek
terminariga stoplinie
+ stoppeligne
someline: eenregel someline
einezeile nejakyradek
qualcheriga olinie
+ uneligne
inline: inregel inline
inzeile vradku
inriga inlinie
+ alaligne
crlf: crlf crlf
crlf crlf
crlf crlf
-emptylines: legeregels emptylines
- emptylines emptylines
- emptylines emptylines
+ crlf
+ emptylines: legeregels emptylines
+ emptylines emptylines
+ emptylines emptylines
+ emptylines
setuplines: stelregelsin setuplines
stellezeilenein nastavradky
impostarighe seteazalinii
+ reglelignes
startnarrower: startsmaller startnarrower
startenger startzuzeni
iniziapiustretto startingust
+ demarrecompoetroite
stopnarrower: stopsmaller stopnarrower
stopenger stopzuzeni
terminapiustretto stopingust
+ stopcompoetroite
setupnarrower: stelsmallerin setupnarrower
stelleengerein nastavzuzeni
impostapiustretto seteazaingust
+ reglecompoetroite
definetabulate: definieertabulatie definetabulate
definieretabulator definujtabelaci
definiscitabulato definestetabulatori
+ definittabulation
setuptabulate: steltabulatiein setuptabulate
stelletabulatorein nastavtabelaci
impostatabulato seteazatabulatori
+ regletabulation
starttable: starttabel starttable
starttabelle starttabulka
iniziatabella starttabel
+ demarretableau
stoptable: stoptabel stoptable
stoptabelle stoptabulka
terminatabella stoptabel
+ stoppetableau
starttables: starttabellen starttables
starttabellen starttabulky
iniziatabelle starttabele
+ demarretableaux
stoptables: stoptabellen stoptables
stoptabellen stoptabulky
terminatabelle stoptabele
+ stoppetableaux
setuptables: steltabellenin setuptables
stelletabellenein nastavtabulky
impostatabelle seteazatabele
+ regletableaux
definetabletemplate: definieertabelvorm definetabletemplate
definieretabellenvorlage definujsablonutabulky
definiscimodellotabella definestesablontabel
+ definittrametableau
page: pagina page
seite strana
pagina pagina
+ page
testcolumn: testkolom testcolumn
testcolumn testcolumn
testcolumn testcolumn
+ testcolumn
testpage: testpagina testpage
testpage testpage
testpage testpage
- couplepage: koppelpagina couplepage
+ testpage
+ couplepage: koppelpagina couplepage
doppelseite parovastrana
accoppiapagina paginadubla
+ pagedouble
pagetype: soortpagina pagetype
seitentyp typstrany
tipopagina tippagina
+ tapepage
processpage: verwerkpagina processpage
bearbeiteseite zpracujstranu
elaborapagina proceseazapagina
+ traitepage
couplepaper: koppelpapier couplepaper
doppelseitigespapier dvoustrannypapir
accoppiacarta hartiedubla
+ couplepapier
selectpaper: selecteerpapier selectpaper
waehlepapieraus vyberpapir
selezionacarta selecteazahartie
+ selectionnepapier
screen: scherm screen
bildschirm obrazovka
schermo ecran
+ ecran
definesection: definieersectie definesection
definiereabschnitt definujsekci
definiscisezione definestesectiune
+ definitsection
definesectionblock: definieersectieblok definesectionblock
definiereabschnittsblock definujbloksekce
definiscibloccosezione definesteblocsectiune
+ definitblocsection
setupsectionblock: stelsectieblokin setupsectionblock
stelleabschnittsblockein nastavbloksekce
impostabloccosezione seteazablocsectiune
+ regleblocsection
setupsection: stelsectiein setupsection
stelleabschnittein nastavsekci
impostasezione seteazasectiune
+ reglesection
notopandbottomlines: geenbovenenonderregels notopandbottomlines
keinzeilenobenundunten zadnehorniadolniradky
nientelineecimafondo faraliniisussijos
+ sanslignessupetinf
noheaderandfooterlines: geenhoofdenvoetregels noheaderandfooterlines
keinekopfundfusszeilen zadnezahlaviaupati
nientelineintestazionepdp faraliniiantetsisubsol
+ sanslignesenteteetpdp
setuptop: stelbovenin setuptop
stellenobenein nastavhorejsek
impostacima seteazasus
+ reglesup
setuptoptexts: stelboventekstenin setuptoptexts
stelletextobenein nastavhornitexty
impostatesticima seteazatextesus
+ regletextessup
setupheader: stelhoofdin setupheader
stellekopfzeileein nastavzahlavi
impostainstestazione seteazaantet
+ regleentete
setupheadertexts: stelhoofdtekstenin setupheadertexts
stellekopfzeilentextein nastavtextyzahlavi
impostatestiintestazioni seteazatexteantet
+ regletextesentete
setuppagenumbering: stelpaginanummeringin setuppagenumbering
stelleseitennummeriernungein nastavcislovanistran
impostanumerazionepagina seteazanumerotarepagina
- getnumber: haalnummer getnumber
- getnumber getnumber
- getnumber getnumber
-incrementnumber: verhoognummer incrementnumber
- nummererhoehen zvysujicicislo
- incrementanumero numarincrement
-decrementnumber: verlaagnummer decrementnumber
- decrementnumber decrementnumber
- decrementnumber decrementnumber
- resetnumber: resetnummer resetnumber
- resetnumber resetnumber
- resetnumber resetnumber
- setnumber: setnummer setnumber
- setnumber setnumber
- setnumber setnumber
- setupnumber: stelnummerin setupnumber
- setupnumber setupnumber
- impostanumerazione setupnumber
+ reglenumerotationpage
+ getnumber: haalnummer getnumber
+ getnumber getnumber
+ getnumber getnumber
+ getnumber
+ incrementnumber: verhoognummer incrementnumber
+ nummererhoehen zvysujicicislo
+ incrementanumero numarincrement
+ incrementenumero
+ decrementnumber: verlaagnummer decrementnumber
+ decrementnumber decrementnumber
+ decrementnumber decrementnumber
+ decrementenumero
+ resetnumber: resetnummer resetnumber
+ resetnumber resetnumber
+ resetnumber resetnumber
+ raznumero
+ setnumber: setnummer setnumber
+ setnumber setnumber
+ setnumber setnumber
+ affectenumero
+ setupnumber: stelnummerin setupnumber
+ setupnumber setupnumber
+ impostanumerazione setupnumber
+ reglenumero
setupbottom: stelonderin setupbottom
stelleuntenein nastavspodek
impostafondo seteazajos
+ regleinf
setupbottomtexts: stelondertekstenin setupbottomtexts
stelletextuntenein nastavdolnitexty
impostatestifondo seteazatextejos
+ regletextesinf
setupfooter: stelvoetin setupfooter
stellefusszeileein nastavupati
impostapdp seteazasubsol
+ reglepdp
setupfootertexts: stelvoettekstenin setupfootertexts
stellefusszeilentextein nastavtextyupati
impostatestipdp seteazatextesubsol
+ regletextespdp
setuppagenumber: stelpaginanummerin setuppagenumber
stelleseitennummerein nastavcislostrany
impostanumeropagina seteazanumarpagina
+ reglenumeropage
setupsubpagenumber: stelsubpaginanummerin setupsubpagenumber
stelleunterseitennummerein nastavpodcislostrany
impostanumerosottopagina seteazanumarsubpagina
-subpagenumber: subpaginanummer subpagenumber
- subpagenumber subpagenumber
- subpagenumber subpagenumber
+ reglesousnumeropage
+ subpagenumber: subpaginanummer subpagenumber
+ subpagenumber subpagenumber
+ subpagenumber subpagenumber
+ sousnumeropage
setuptext: steltekstin setuptext
stelletextein nastavtext
impostatesto seteazatext
+ regletexte
setuptexttexts: stelteksttekstenin setuptexttexts
stelletexttexteein nastavtexttexty
impostatestotesti seteazatextetext
+ regletextestexte
definetext: definieertekst definetext
definieretext definujtext
definiscitesto definestetext
+ definittexte
pagenumber: paginanummer pagenumber
seitenummer cislostrany
numeropagina numarpagina
+ numeropage
completepagenumber: volledigepaginanummer completepagenumber
completepagenumber completepagenumber % TOBIAS % TO
numeropaginacompleto completeazanumarpagina % TB TH
+ completenumeropage
placepagenumber: plaatspaginanummer placepagenumber
placepagenumber placepagenumber % TOBIAS % TOM
mettinumeropagina punenumarpagina % TB TH
+ placenumeropage
items: items items
posten polozky
elementi element
+ elements
setupitems: stelitemsin setupitems
stellepostenein nastavpolozky
impostaelementi seteazaelemente
+ regleelements
leftaligned: regellinks leftaligned
linksbuendig zarovnanovlevo
allineasinistra aliniatstanga
+ aligneagauche
midaligned: regelmidden midaligned
zentriert zarovnanonastred
allineacentro aliniatcentru
+ aligneaumilieu
rightaligned: regelrechts rightaligned
rechtsbuendig zarovnanovpravo
allineadestra aliniatdreapta
+ aligneadroite
startcolumns: startkolommen startcolumns
startspalten startsloupce
iniziacolonne startcoloane
+ demarrecolonnes
stopcolumns: stopkolommen stopcolumns
stopspalten stopsloupce
terminacolonne stopcoloane
+ stoppecolonnes
setupcolumns: stelkolommenin setupcolumns
stellespaltenein nastavsloupce
impostacolonne seteazacoloane
+ reglecolonnes
column: kolom column
spalte sloupec
colonna coloana
+ colonne
head: kop head
kopf nadpis
- testa titlu % GB
+ testa titlu
+ tete
but: but but
but spodek
fondo but
+ but
item: som item
pos polozka
elemento element
+ element
nop: nop nop
nop nop
nop nop
+ nop
mar: mar mar
mar okr
mar mar
+ mar
sym: sym sym
sym sym
sim sim
+ sym
+ txt: txt txt
+ txt txt
+ txt txt
+ txt
its: its its
its pol % abbr. of polozka (it em)
el el % abbr. of elemento (it) element (ro)
+ el % abbr. of element (fr)
ran: ran ran
ran ran
ran ran
-% new
+ ran
headsym: kopsym headsym
headsym headsym
headsym headsym
-% new
+ headsym
defineitemgroup: definieeritemgroep defineitemgroup
defineitemgroup defineitemgroup
defineitemgroup defineitemgroup
+ defineitemgroup
setupitemgroup: stelitemgroepin setupitemgroup
setupitemgroup setupitemgroup
setupitemgroup setupitemgroup
+ setupitemgroup
setupitemgroups: stelitemgroepenin setupitemgroups
setupitemgroups setupitemgroups
setupitemgroups setupitemgroups
-
-% startitemize: startopsomming startitemize
-% startaufzaehlung startvycet
-% iniziaelenco startenumerare
-% setupitemize: stelopsommingin setupitemize
-% stelleaufzaehlungein nastavvycet
-% impostaelenco setareenumerare
-% stopitemize: stopopsomming stopitemize
-% stopaufzaehlung stopvycet
-% terminaelenco stopenumerare
-
- % so far
-
+ setupitemgroups
definehead: definieerkop definehead
definiereueberschrift definujnadpis
definiscitesta definesteantet
+ definittete
setuphead: stelkopin setuphead
stelleueberschriftein nastavnadpis
impostatesta seteazatitlu
+ regletete
setupheads: stelkoppenin setupheads
stelleueberschriftenein nastavnadpisy
impostateste seteazatitluri
+ regletetes
setupheadnumber: stelkopnummerin setupheadnumber
stellekopfzahlein nastavcislonadpisu
impostanumerotesta seteazanumartitlu
+ reglenumerotete
headnumber: kopnummer headnumber
kopfnummer cislonadpisu
numerotesta numartitlu
+ numerotete
currentheadnumber: huidigekopnummer currentheadnumber
heutigeskopfnummer aktualnicislonadpisu
numerotestacorrente numartitlucurent
+ numerotetecourant
determineheadnumber: bepaalkopnummer determineheadnumber
bestimmekopfnummer stanovcislonadpisu
determinanumerotesta determinanumartitlu
+ determinenumerotete
resetmarking: resetmarkering resetmarking
ruecksetztenbeschriftung resetznaceni
reimpostamarcatura reseteazamarcaje
+ razmarquage
setupmarking: stelmarkeringin setupmarking
stellebeschriftungein nastavznaceni
impostamarcatura seteazamarcaje
+ reglemarquage
definemarking: definieermarkering definemarking
definierebeschriftung definujznaceni
definiscimarcatura definestemarcaje
+ definitmarquage
nomarking: geenmarkering nomarking
keinebeschriftung zadneznaceni
nientemarcatura faramarcaje
+ sansmarquage
marking: markeer marking
beschriftung znaceni
marcatura marcaje
+ marquage
decouplemarking: ontkoppelmarkering decouplemarking
entknuepfebeschriftung rozpojeneznaceni
- separamarcatura decupleazamarcaje % GB
+ separamarcatura decupleazamarcaje
+ decouplemarquage
couplemarking: koppelmarkering couplemarking
verknuepfebeschriftung propojeneznaceni
- accoppiamarcatura cupleazamarcaje % GB
+ accoppiamarcatura cupleazamarcaje
+ couplemarquage
getmarking: haalmarkering getmarking
holebeschriftung ziskejznaceni
- prendimarcatura adumarcaje % GB
+ prendimarcatura adumarcaje
+ obtientmarquage
definelayout: definieerlayout definelayout
definelayout definelayout
- definiscilayout definelayout %%%
+ definiscilayout definelayout
+ definitdisposition
setuplayout: stellayoutin setuplayout
stellelayoutein nastavvzhled
impostalayout seteazaaspect
+ regledisposition
adaptlayout: paslayoutaan adaptlayout
passelayoutan prizpusobvzhled
adattalayout adapteazaaspect
+ adaptedisposition
placeongrid: plaatsopgrid placeongrid
amgitterausrichten umistinamrizku
mettiingriglia plaseazapegrid
+ placesurgrille
moveongrid: verplaatsopgrid moveongrid
amgitterneuausrichten premistinamrizku
spostaagriglia mutapegrid
+ deplacesurgrille
showsetups: tooninstellingen showsetups
zeigeeinstellungen ukaznastaveni
mostraimpostazioni afiseazasetari
+ montrereglages
showframe: toonkader showframe
zeigerahmen ukazramecek
mostracornice afiseazarama
+ montrecadre
showgrid: toongrid showgrid
zeigegitter ukazmrizku
mostragriglia afiseazagrid
+ montregrille
% toonopbouw: toonopbouw showbuildup
% zeigeaufbau ukazstrukturu
% mostrabuildup afiseazabuildup
showlayout: toonlayout showlayout
zeigelayout ukazvzhled
mostralyout afiseazaaspect
+ montredisposition
showprint: toonprint showprint
zeigedruck ukazvytisk
mostrastampa afiseazatiparire
+ montreedition
showstruts: toonstruts showstruts
zeigestruts ukazpodpery
mostrastruts afiseazastruts
+ montrestruts
definepapersize: definieerpapierformaat definepapersize
definierepapierformat definujvelikostpapiru
definiscidimensionicarta definestedimensiunehartie
+ definittaillepapier
setuppapersize: stelpapierformaatin setuppapersize
stellepapierformatein nastavvelikostpapiru
impostadimensionicarta seteazadimensiunihartie
-setuppaper: stelpapierin setuppaper
- setuppaper setuppaper
- setuppaper setuppaper
+ regletaillepapier
+ setuppaper: stelpapierin setuppaper
+ setuppaper setuppaper
+ setuppaper setuppaper
+ reglepapier
setuparranging: stelarrangerenin setuparranging
stelleanordnenein nastavusporadani
impostaparranging seteazaaranjareapag
+ reglearrangement
version: versie version
version verze
versione versiune
+ version
setupbackgrounds: stelachtergrondenin setupbackgrounds
stellehintergruendeein nastavpozadi
impostasfondi seteazafundaluri
+ reglearriereplans
setupalign: steluitlijnenin setupalign
stelleausrichtungein nastavzarovnani
impostaallineamento seteazaalinierea
+ reglealignement
setupwhitespace: stelwitruimtein setupwhitespace
stellezwischenraumein nastavbilamista
impostaspaziobianco seteazaspatiualb
+ regleespaceblanc
setupinteraction: stelinteractiein setupinteraction
stelleinteraktionein nastavinterakci
impostainterazione seteazainteractiunea
+ regleinteraction
setupinteractionmenu: stelinteractiemenuin setupinteractionmenu
stelleinteraktionsmenueein nastavinterakcnimenu
impostamenuinterazione seteazameniuinteractiune
+ reglemenuinteraction
defineinteractionmenu: definieerinteractiemenu defineinteractionmenu
definiereinteraktionsmenue definujinterakcnimenu
definiscimenuinterazione definestemeniuinteractiune
+ definitmenuinteraction
disableinteractionmenu: blokkeerinteractiemenu disableinteractionmenu
inaktiviereinteraktionsmenue zablokujinterakcnimenu
disabilitamenuinterazione dezactiveazameniuinteractiune
+ inhibemenuinteraction
interactionmenu: interactiemenu interactionmenu
interaktionsmenue interaktivnimenu
menuinterattivo meniuinteractiune
+ menuinteraction
interactionbuttons: interactiebuttons interactionbuttons
interaktionsknopfe interakcnitlacitka
pulsantinterazione butoaneinteractiune
+ boutonsinteraction
interactionbar: interactiebalk interactionbar
interaktionsbalken interakcnilista
barrainterazione barainteractiune
+ barreinteraction
setupinteractionbar: stelinteractiebalkin setupinteractionbar
stelleinteraktionsbalkenein nastavinterakcnilistu
impostabarrainterazione seteazabarainteractiune
+ reglebarreinteraction
setupinteractionscreen: stelinteractieschermin setupinteractionscreen
stelleinteraktionsbildschirmein nastavinterakcniobrazovku
impostaschermointerazione seteazaecraninteractiune
+ regleecraninteraction
placebookmarks: plaatsbookmarks placebookmarks
platzierebookmarks umistizalozky
mettisegnalibro plaseazasemnecarte
+ placemarquespages
bookmark: bookmark bookmark
bookmark zalozka
segnalibro semncarte
+ marquepage
definelogo: definieerbeeldmerk definelogo
definierelogo definujlogo
definiscilogo definestelogo
+ definitlogo
placelogos: plaatsbeeldmerken placelogos
platzierelogo umistiloga
mettiloghi punelogouri
- definecolor: definieerkleur definecolor
+ placelogos
+ definecolor: definieerkleur definecolor
definierefarbe definujbarvu
definiscicolore definesteculoare
-%definespotcolor: definespotcolor definespotcolor
-% definespotcolor definespotcolor
-% definespotcolor definespotcolor
- definecolorgroup: definieerkleurgroep definecolorgroup
+ definitcouleur
+ definecolorgroup: definieerkleurgroep definecolorgroup
definierefarbengruppe definujskupinubarev
definiscigruppocolori definestegrupculori
- definepalet: definieerpalet definepalet
+ definitgroupecouleur
+ definepalet: definieerpalet definepalet
definierepalette definujpaletu
definiscitavolozza definestepaleta
- graycolor: grijskleur graycolor
+ definitpalette
+ graycolor: grijskleur graycolor
graufarbe sedabarva
coloregrigio culoaregri
- color: kleur color
+ couleurgrise
+ color: kleur color
farbe barva
colore culoare
- startcolor: startkleur startcolor
+ couleur
+ startcolor: startkleur startcolor
startfarbe startbarva
iniziacolore startculoare
- stopcolor: stopkleur stopcolor
+ demarrecouleur
+ stopcolor: stopkleur stopcolor
stopfarbe stopbarva
terminacolore stopculoare
- setupcolors: stelkleurenin setupcolors
+ stoppecouleur
+ setupcolors: stelkleurenin setupcolors
stellefarbenein nastavbarvy
impostacolori seteazaculori
- setupcolor: stelkleurin setupcolor
+ reglecouleurs
+ setupcolor: stelkleurin setupcolor
stellefarbeein nastavbarvu
impostacolore seteazaculoare
- setuppalet: stelpaletin setuppalet
+ reglecouleur
+ setuppalet: stelpaletin setuppalet
stellepaletteein nastavpaletu
impostatavolozza seteazapaleta
- showcolor: toonkleur showcolor
+ reglepalette
+ showcolor: toonkleur showcolor
zeigefarbe ukazbarvu
mostracolore afiseazaculoare
- showcolorgroup: toonkleurgroep showcolorgroup
+ montrecouleur
+ showcolorgroup: toonkleurgroep showcolorgroup
zeigefarbengruppe ukazskupinubarev
mostragruppocolori afiseazagrupculoare
- showpalet: toonpalet showpalet
+ montregroupecouleur
+ showpalet: toonpalet showpalet
zeigepalette ukazpaletu
mostratavolozza afiseazapaleta
- comparecolorgroup: vergelijkkleurgroep comparecolorgroup
+ montrepalette
+ comparecolorgroup: vergelijkkleurgroep comparecolorgroup
vergleichefarbengruppe porovnejskupinubarev
confrontagruppocolori comparagrupculoare
- comparepalet: vergelijkpalet comparepalet
+ comparegroupecouleur
+ comparepalet: vergelijkpalet comparepalet
vergleichepalette porovnejpaletu
confrontatavolozza comparapaleta
- colorvalue: kleurwaarde colorvalue
+ comparepalette
+ colorvalue: kleurwaarde colorvalue
farbewert hodnotabarvy
valorecolore valoareculoare
- greyvalue: grijswaarde greyvalue
+ valeurcouleur
+ greyvalue: grijswaarde greyvalue
grauwert hodnotasedi
valoregrigio valoaregri
- startraster: startraster startraster
+ valeurgris
+ startraster: startraster startraster
startraster startrastr
- iniziaraster startraster % GB
- stopraster: stopraster stopraster
+ iniziaraster startraster
+ demarreraster
+ stopraster: stopraster stopraster
stopraster stoprastr
terminaraster stopraster
- defineblock: definieerblok defineblock
+ stopperaster
+ defineblock: definieerblok defineblock
definiereblock definujblok
definisciblocco definestebloc
- setupblock: stelblokin setupblock
+ definitbloc
+ setupblock: stelblokin setupblock
stelleblockein nastavblok
impostablocco seteazabloc
- useblocks: gebruikblokken useblocks
+ reglebloc
+ useblocks: gebruikblokken useblocks
verwendebloecke uzijbloky
usablocco folosestebloc
- processblocks: verwerkblokken processblocks
+ utiliseblocs
+ processblocks: verwerkblokken processblocks
bearbeitebloecke zpracujbloky
elaborablocchi proceseazabloc
- keepblocks: handhaafblokken keepblocks
+ traiteblocs
+ keepblocks: handhaafblokken keepblocks
behaltebloecke zachovejbloky
tieniblocchi pastreazablocuri
- selectblocks: selecteerblokken selectblocks
+ gardeblocs
+ selectblocks: selecteerblokken selectblocks
waehlebloeckeaus vyberbloky
selezionablocchi selecteazablocuri
- hideblocks: verbergblokken hideblocks
+ selectionneblocs
+ hideblocks: verbergblokken hideblocks
verbergebloecke schovejbloky
nascondiblocchi ascundeblocuri
- bypassblocks: passeerblokken bypassblocks
+ cacheblocs
+ bypassblocks: passeerblokken bypassblocks
bypassblocks bypassblocks
saltablocchi saripesteblocuri
- forceblocks: forceerblokken forceblocks
+ sauteblocs
+ forceblocks: forceerblokken forceblocks
forceblocks forceblocks
forzablocchi forteazablocuri
- nomoreblocks: geenblokkenmeer nomoreblocks
+ forceblocs
+ nomoreblocks: geenblokkenmeer nomoreblocks
keinebloeckemehr zadnedalsibloky
bastablocchi gatablocuri
- definelist: definieerlijst definelist
+ pasplusdeblocs
+ definelist: definieerlijst definelist
definiereliste definujseznam
definiscielenco definestelista
- definecombinedlist: definieersamengesteldelijst definecombinedlist
+ definitliste
+ definecombinedlist: definieersamengesteldelijst definecombinedlist
definierezusammengestellteliste definujkombinovanyseznam
definiscielencocombinato definestelistacombinata
-listsymbol: lijstsymbool listsymbol
- listsymbol listsymbol
- listsymbol listsymbol
- placelist: plaatslijst placelist
+ definitlisteimbriquee
+ listsymbol: lijstsymbool listsymbol
+ listsymbol listsymbol
+ listsymbol listsymbol
+ listesymbole
+ placelist: plaatslijst placelist
platziereliste umistiseznam
mettielenco punelista
- plaatsruwelijst: plaatsruwelijst placerawlist
+ placeliste
+ plaatsruwelijst: plaatsruwelijst placerawlist
placerawlist placerawlist
placerawlist placerawlist
- placecombinedlist: plaatssamengesteldelijst placecombinedlist
+ placerawlist
+ placecombinedlist: plaatssamengesteldelijst placecombinedlist
platzierezusammengestellteliste umistikombinovanyseznam
mettielencocombinato punelistacombinata
- writetolist: schrijfnaarlijst writetolist
+ placelisteinmbriquee
+ writetolist: schrijfnaarlijst writetolist
schreibezurliste zapisdoseznamu
scriviinelenco scrieinlista
- writebetweenlist: schrijftussenlijst writebetweenlist
+ ecritdansliste
+ writebetweenlist: schrijftussenlijst writebetweenlist
schreibezwischenliste zapismeziseznam
scrividentroelenco scrieintreliste
-
-% new
-
+ ecritentreliste
immediatetolist: directnaarlijst immediatetolist
immediatetolist immediatetolist
immediatetolist immediatetolist
-
+ immediatetolist
immediatebetweenlist: directtussenlijst immediatebetweenlist
immediatebetweenlist immediatebetweenlist
immediatebetweenlist immediatebetweenlist
-
+ immediatebetweenlist
setuplist: stellijstin setuplist
stellelisteein nastavseznam
impostaelenco seteazalista
+ regleliste
setupcombinedlist: stelsamengesteldelijstin setupcombinedlist
stellezusammengestelltelisteein nastavkombinovanyseznam
impostaelencocombinato seteazalistacombinata
+ reglelisteimbriquee
determinelistcharacteristics: bepaallijstkenmerken determinelistcharacteristics
bestimmelistencharakeristika stanovcharakteristickuseznamu
determinacarattersticheelenco determinacaracteristicilelistei
+ determinecaracteristiqueliste
listlength: lijstlengte listlength
listenlaenge delkaseznamu
lunghezzaelenco lungimelista
+ llongueurliste
listwidth: lijstbreedte listwidth
listenbreite sirkaseznamu
ampiezzaelenco latimelista
+ largeurliste
listheight: lijsthoogte listheight
listenhoehe vyskaseznamu
altezzaelenco inaltimelista
+ hauteurliste
nolist: geenlijst nolist
keineliste zadnyseznam
nienteelenco faralista
+ sansliste
definereferencelist: definieerreferentielijst definereferencelist
definierereferenzliste definujseznamodkazu
definiscilistariferimenti definestelistareferinte
+ definitlistereference
placereferencelist: plaatsreferentielijst placereferencelist
platzierereferenzliste umistiseznamodkazu
mettilistariferimenti punelistareferinte
+ placelistereference
writetoreferencelist: schrijfnaarreferentielijst writetoreferencelist
schreibezurreferenzliste zapisdoseznamuodkazu
scriviinlistariferimenti scrieinlistareferinte
+ ecritdanslistereference
setupreferencelist: stelreferentielijstin setupreferencelist
stellereferenzlisteein nastavseznamodkazu
impostalistariferimenti seteazalistareferinte
+ reglelistereference
definefloat: definieerplaatsblok definefloat
definieregleitobjekt definujplvouciobjekt
definiscioggettomobile definestefloat
+ definitflottant
setupfloat: stelplaatsblokin setupfloat
stellegleitobjektein nastavplvouciobjekt
impostaoggettomobile seteazafloat
+ regleflottant
setupfloats: stelplaatsblokkenin setupfloats
stellegleitobjekteein nastavplvouciobjekty
impostaoggettimobili seteazafloats
+ regleflottants
splitfloat: splitsplaatsblok splitfloat
teilegleitobjekt rozdelplvouciobjekt
spezzaoggettomobile impartefloat
+ separeflottant
setupfloatsplitting: stelplaatsbloksplitsenin setupfloatsplitting
stelleplatziegeteiltegleitobjekt nastavdeleniplvoucichobjektu
impostaspezzamentooggettomobile seteazaimpartireafloat
+ regleseparationflottant
placefloat: plaatsplaatsblok placefloat
placefloat placefloat
- placefloat placefloat %%%
- movesidefloat: verplaatszijblok movesidefloat
- movesidefloat movesidefloat
- movesidefloat movesidefloat
-defineplacement: definieerplaats defineplacement
- defineplacement defineplacement
- defineplacement defineplacement
- setupplacement: stelplaatsin setupplacement
- setupplacement setupplacement
- setupplacement setupplacement
+ placefloat placefloat
+ placeflottant
+ movesidefloat: verplaatszijblok movesidefloat
+ movesidefloat movesidefloat
+ movesidefloat movesidefloat
+ movesidefloat
+ defineplacement: definieerplaats defineplacement
+ defineplacement defineplacement
+ defineplacement defineplacement
+ defineplacement
+ setupplacement: stelplaatsin setupplacement
+ setupplacement setupplacement
+ setupplacement setupplacement
+ setupplacement
definecombination: definieercombinatie definecombination
definecombination definecombination
definecombination definecombination
+ definecombination
startcombination: startcombinatie startcombination
startkombination startspojeni
iniziacombinazione startcombinare
+ demarrecombinaison
stopcombination: stopcombinatie stopcombination
stopkombination stopspojeni
terminacombinazione stopcombinare
+ stoppecombinaison
placesidebyside: plaatsnaastelkaar placesidebyside
platzierenebeneinander umistivedlesebe
mettifiancoafianco punefatainfata
+ placecoteacote
placeontopofeachother: plaatsonderelkaar placeontopofeachother
platziereuntereinander umistinadsebe
mettiunosullaltro punedeasuprafiecareia
+ placelesunsaudessusdesautres
setupcaption: stelblokkopjein setupcaption
stellebildunterschriftein nastavpopisek
- impostacaption seteazalegenda % GB
+ impostacaption seteazalegenda
+ regleintitule
setupcaptions: stelblokkopjesin setupcaptions
stellebilderunterschriftein nastavpopisky
- impostacaptions seteazalegendele % GB
+ impostacaptions seteazalegendele
+ regleintitules
setupcombinations: stelcombinatiesin setupcombinations
stellekombinationein nastavspojeni
impostacombinazioni seteazacombinari
+ reglecombinaisons
startoverlay: startoverlay startoverlay
startoverlay startprekryv
iniziasovrapposizione startoverlay
+ demarrerevetement
stopoverlay: stopoverlay stopoverlay
stopoverlay stopprekryv
terminasovrapposizione stopoverlay
+ stopperevetement
defineregister: definieerregister defineregister
definiereregister definujrejstrik
definisciregistro definesteregistru
+ definitregistre
coupleregister: koppelregister coupleregister
verknuepfregister propojenyrejstrik
accoppiaregistro cupleazaregistru
+ coupleregistre
setupregister: stelregisterin setupregister
stelleregisterein nastavrejstrik
impostaregistro seteazaregistru
+ regleregistre
writetoregister: schrijfnaarregister writetoregister
schreibezumregister zapisdorejstriku
scriviinregistro scrieinregistru
-completeregister: volledigregister completeregister
- completeregister completeregister
- completeregister completeregister
+ ecritregistre
+ completeregister: volledigregister completeregister
+ completeregister completeregister
+ completeregister completeregister
+ completeregistre
placeregister: plaatsregister placeregister
platziereregister umistirejstrik
mettiregistro puneregistru
+ placeregistre
determineregistercharacteristics: bepaalregisterkenmerken determineregistercharacteristics
bestimmeregistercharakteristika urcicharakteristikurejstriku
determinacaratteristicheregistro determinacaracteristiciregistru
+ determinecaracteristiquesregistre
definesorting: definieersorteren definesorting
definieresortieren definujtrideni
definisciordinamento definestesortare
+ definittri
definesynonyms: definieersynoniemen definesynonyms
definieresynonyme definujsynonyma
definiscisinonimi definestesinonim
+ definitsynonymes
setupsorting: stelsorterenin setupsorting
stellesortierenein nastavtrideni
impostaordinamento seteazasortare
+ regletri
setupsynonyms: stelsynoniemenin setupsynonyms
stellesynonymein nastavsynonyma
impostasinonimi seteazasinonime
+ reglesynonymes
startsynchronization: startsynchronisatie startsynchronization
startsynchronisation startsynchronizace
iniziasincronizzazione startsincronizare
+ demarresynchronisation
stopsynchronization: stopsynchronisatie stopsynchronization
stopsynchronisation stopsynchronizace
terminasincronizzazione stopsincronizare
+ stoppesynchronisation
setupsynchronizationbar: stelsynchronisatiebalkin setupsynchronizationbar
stellesynchronisationsbalkenein nastavsynchronizacnilistu
impostabarrasincronizzazione setarebarasincronizare
+ reglebarresynchronisation
setupsynchronization: stelsynchronisatiein setupsynchronization
stellesynchronisationein nastavsynchronizaci
impostasincronizzazione setaresincronizare
+ reglesynchronisation
synchronizationbar: synchronisatiebalk synchronizationbar
synchronisationsbalken synchronizacnilista
barrasincronizzazione barasincronizare
+ barresynchronisation
synchronize: synchroniseer synchronize
synchronisieren synchronizovat
sincronizza sincronizeaza
+ synchronise
useexternaldocument: gebruikexterndocument useexternaldocument
verwendeexteresdokument uzijexternidokument
usadocumentoesterno folosestedocumentextern
+ utilisedocumentexterne
useURL: gebruikURL useURL
verwendeURL uzijURL
usaURL folosesteURL
+ utiliseURL
useurl: gebruikurl useurl
verwendeurl uzijurl
usaurl folosesteurl
+ utiliseurl
setupurl: stelurlin setupurl
stelleurlein nastavurl
impostaurl seteazaurl
+ regleurl
coupledocument: koppeldocument coupledocument
verknuepfedokument propojenydokument
accoppiadocumento cupleazadocument
+ coupledocument
setupprograms: stelprogrammasin setupprograms
stelleprogrammein nastavprogramy
impostaprogrammi seteazaprograme
+ regleprogrammes
defineprogram: definieerprogramma defineprogram
definiereprogramme definujprogram
definisciprogramma definesteprogram
+ definitprogramme
program: programma program
programm program
programma program
+ programme
setuppagetransitions: stelpaginaovergangenin setuppagetransitions
stelleseitenuebergangein nastavprechodstrany
impostatransizionepagina seteazatranzitiepagina
+ regletransitionspage
defineprofile: definieerprofiel defineprofile
definiereprofil definujprofil
definisciprofilo definesteprofil
+ definitprofil
defineversion: definieerversie defineversion
definiereversion definujverzi
definisciversion definesteversiune
+ definitversion
markversion: markeerversie markversion
beschrifteversion oznacverzi
- marcaversione marcheazaversiune % GB
+ marcaversione marcheazaversiune
+ marquageversion
selectversion: selecteerversie selectversion
waehleversionaus vyberverzi
- selezionaversione selecteazaversiune % GB
+ selezionaversione selecteazaversiune
+ selectionneversion
startprofile: startprofiel startprofile
startprofil startprofil
iniziaprofilo startprofil
+ demarreprofil
startversion: startversie startversion
startversion startverze
iniziaversione startversiune
+ demarreversion
setupprofiles: stelprofielenin setupprofiles
stelleprofilein nastavprofily
impostaprofili seteazaprofile
+ regleprofils
setupversions: stelversiesin setupversions
stelleversionein nastavverze
impostaversioni seteazaversiuni
+ regleversions
stopprofile: stopprofiel stopprofile
stopprofil stopprofil
terminaprofili stopprofil
+ stoppeprofil
stopversion: stopversie stopversion
stopversion stopverze
terminaversioni stopversiune
+ stoppeversion
followprofile: volgprofiel followprofile
folgeprofil dodrzujprofil
seguiprofilo urmeazaprofil
+ suivantprofil
followprofileversion: volgprofielversie followprofileversion
folgeprofilversion dodrzujverziprofilu
seguiversioneprofilo urmeazaversiuneprofil
+ suivantversionprofil
followversion: volgversie followversion
folgeversion dodrzujverzi
seguiversione urmeazaversiune
+ suivantversion
definedescription: doordefinieren definedescription
definierebeschreibung definujpopis
definiscidescrizione definestedescriere
+ definitdescription
definelabel: doorlabelen definelabel
definierelabel definujpopisek
definiscietichetta definesteeticheta
+ definitetiquette
defineenumeration: doornummeren defineenumeration
definierenummerierung definujvycet
definiscienumerazione definesteenumerare
+ definitenumeration
defineindenting: doorspringen defineindenting
definiereeinzug definujodsazovani
definiscirientro definestealiat
+ definitcompoalinea
setupdescriptions: steldoordefinierenin setupdescriptions
definierebeschreibungen nastavpopisy
impostadescrizioni seteazadescriere
+ regledescriptions
setupenumerations: steldoornummerenin setupenumerations
stellebeschreibungein nastavvycty
impostaenumerazioni seteazaenumerare
+ regleenumerations
setupindentations: steldoorspringenin setupindentations
stelleeinzuegein nastavodsazovani
impostarientri seteazaaliniate
+ reglealineas
setuptab: steltabin setuptab
stelletabein nastavtab
impostatab seteazatab
+ regletab
tab: tab tab
tab tab
tab tab
+ tab
setupexternalfigures: stelexternefigurenin setupexternalfigures
stelleexterneabbildungenein nastavexterniobrazy
impostafigureesterne seteazafiguriexterne
+ reglefiguresexternes
showexternalfigures: toonexternefiguren showexternalfigures
zeigeexterneabbildungen ukazexterniobrazy
mostrafiguresterne afiseazafiguriexterne
+ montrefiguresexternes
externalfigure: externfiguur externalfigure
externeabbildung externiobraz
figuraesterna figuraexterna
+ figureexterne
useexternalfigure: gebruikexternfiguur useexternalfigure
verwendeexterneabbildung uzijexterniobraz
usafiguraesterna folosestefiguraexterna
+ utilisefigureexterne
startfigure: startfiguur startfigure
startabbildung startobraz
iniziafigura startfigura
+ demarrefigure
referring: refereer referring
referieren odkazujici
- referring referring % GB
+ referring referring
+ faitreference
remark: toelichting remark
bemerkung oznaceni
commento remarca
+ commentaire
colorbar: kleurenbalk colorbar
farbbalken barevnalista
barracolori baraculoare
+ barrecouleur
grid: rooster grid
gitter mrizka
griglia grid
+ grille
button: button button
knopf tlacitko
pulsante buton
+ bouton
menubutton: menubutton menubutton
menueknopf tlacitkomenu
pulsantemenu butonmeniu
+ boutonmenu
setupbuttons: stelbuttonsin setupbuttons
stelleknopfein nastavtlacitka
impostapulsanti seteazabutoane
+ regleboutons
usereferences: gebruikreferenties usereferences
verwendereferenzen uzijodkazy
usariferimenti folosestereferinte
+ utilisereferences
placereferencelist: plaatsreferentielijst placereferencelist
placereferencelist placereferencelist
placereferencelist placereferencelist
+ placelistereference
setupreferencelist: stelreferentielijstin setupreferencelist
stellereferenzlisteein nastavseznamodkazu
impostalistariferimenti seteazalistareferinte
+ reglelistereference
setupreferencing: stelrefererenin setupreferencing
stellereferenzierenein nastavodkazovani
impostariferimento seteazareferinte
+ reglereferencage
textreference: tekstreferentie textreference
textreferenz odkaznatext
riferimentotesto referintatext
+ referencetexte
pagereference: paginareferentie pagereference
seitenreferenz odkaznastranu
riferimentopagina referintapagina
+ referencepage
reference: referentie reference
referenz odkaz
riferimento referinta
+ reference
definereference: definieerreferentie definereference
definierereferenz definujodkaz
definisciriferimento definestereferinte
+ definitreference
definereferenceformat: definieerreferentieformaat definereferenceformat
definierereferenzformat definujformatodkazu
definisciformatoriferimento definesteformatreferinte
+ definitformatreference
useJSscripts: gebruikJSscripts useJSscripts
verwendeJSscript uzijJSscripts
usaJSscripts folosestescriptJS
+ utiliseJSscripts
from: uit from
von zref
da din
+ de
in: in in
in tref
in in
+ dans
at: op at
bei pref
- al la % GB
+ al la
+ a
about: - about
ueber oref
intorno despre
+ concernant
goto: naar goto
zu jdina
vaia dute
+ va
atpage: oppagina atpage
aufseite nastrane
apagina lapagina
+ alapage
somewhere: ergens somewhere
irgendwo nekde
daqualcheparte undeva
-navigating: navigerend navigating
- navigating navigating
- navigating navigating
+ qqpart
+ navigating: navigerend navigating
+ navigating navigating
+ navigating navigating
+ navigating
ref: ref ref
ref ref
rif ref
+ ref
gotobox: naarbox gotobox
zurbox jdinabox
- vaiabox dutebox % GB
+ vaiabox dutebox
+ vaalaboite
gotopage: naarpagina gotopage
zurseite jdinastranu
vaiapagina dutepagina
+ vaalapage
placeformula: plaatsformule placeformula
platziereformel umistirovnici
mettiformula puneformula
+ placeformule
placesubformula: plaatssubformule placesubformula
platziereunterformel umistipodrovnici
mettisottoformula punesubformula
-moveformula: verplaatsformule moveformula
- moveformula moveformula
- spostaformula moveformula
+ placesousformule
+ moveformula: verplaatsformule moveformula
+ moveformula moveformula
+ spostaformula moveformula
+ deplaceformule
setupformulas: stelformulesin setupformulae
stelleformelnein nastavrovnice
impostaformule seteazaformule
+ regleformules
formulanumber: formulenummer formulanumber
formelnummer cislorovnice
numeroformula numarformula
+ numeroformule
subformulanumber: subformulenummer subformulanumber
unterformelnummer cislopodrovnice
numerosottoformula numarsubformula
+ numerosousformule
leg: leg leg
leg leg
leg leg
+ leg
fact: geg fact
geg fakt
fatto fact
+ fait
mathematics: wiskunde mathematics
mathematik matematika
matematica matematica
+ mathematique
dimension: dimensie dimension
dimension rozmer
dimensione dimensiune
+ dimension
nodimension: geendimensie nodimension
keindimension zadnyrozmer
nientedimensioni faradimensiune
+ sansdimension
startenvironment: startomgeving startenvironment
startumgebung startprostredi
iniziaambiente startmediu
+ demarreenvironement
stopenvironment: stopomgeving stopenvironment
stopumgebung stopprostredi
terminaambiente stopmediu
+ stoppeenvironement
startcomponent: startonderdeel startcomponent
startkomponente startkomponenta
iniziacomponente startcomponenta
+ demarrecomposant
stopcomponent: stoponderdeel stopcomponent
stopkomponente stopkomponenta
terminacomponente stopcomponenta
+ stoppecomposant
startproduct: startprodukt startproduct
startprodukt startprodukt
iniziaprodotto startprodus
+ demarreproduit
stopproduct: stopprodukt stopproduct
stopprodukt stopprodukt
terminaprodotto stopprodus
- startproject: startproject startproject
+ stoppeproduit
+ startproject: startprojekt startproject
startprojekt startprojekt
iniziaprogetto startproiect
- stopproject: stopproject stopproject
+ demarreprojet
+ stopproject: stopprojekt stopproject
stopprojekt stopprojekt
terminaprogetto stopproiect
+ stoppeprojet
setups: instellingen setups
einstellungen nastaveni
impostazioni setari
- project: project project
+ reglages
+ project: projekt project
projekt projekt
progetto proiect
+ projet
component: onderdeel component
komponente komponenta
componenet componenta
+ composant
product: produkt product
produkt produkt
prodotto produs
+ produit
environment: omgeving environment
umgebung prostredi
ambiente mediu
+ environement
nomorefiles: geenfilesmeer nomorefiles
keinedateienmehr zadnedalsisoubory
bastafile farafisiere
+ pasplusdefichiers
getbuffer: haalbuffer getbuffer
holepuffer ziskejbuffer
prendibuffer adubuffer
+ prendbuffer
setupbuffer: stelbufferin setupbuffer
stellepufferein nastavbuffer
impostabuffer seteazabuffer
+ reglebuffer
typebuffer: typebuffer typebuffer
tippepuffer typebuffer
- typebuffer scriebuffer % GB
+ typebuffer scriebuffer
+ tapebuffer
definebuffer: definieerbuffer definebuffer
definierepuffer definujbuffer
definiscibuffer definestebuffer
+ definitbuffer
unitmeaning: betekenis unitmeaning
bedeutung vyznam
- nomeunita numeunitate % GB
+ nomeunita numeunitate
+ sensunite
infull: voluit infull
volleswort plnezneni
perlungo pelung
+ infull
quotation: citaat quotation
zitat citace
citazione citat
+ citation
quote: citeer quote
zitieren citovat
menzione minicitat
+ citer
startquotation: startcitaat startquotation
startzitat startcitace
iniziacitazione startcitat
+ demarrecitation
stopquotation: stopcitaat stopquotation
stopzitat stopcitace
terminacitazione stopcitat
+ stoppecitation
setupquote: stelciterenin setupquote
stellezitierenein nastavcitaci
impostamenzione seteazaminicitat
+ demarreciter
define: definieer define
definieren definuj
definisci defineste
+ definit
redo: herhaal redo
wiederholen opakovat
rifai refa
+ refait
usecommands: gebruikcommandos usecommands
verwendebefehl uzijprikazy
usacomandi folosestecomenzi
+ utilisecommandes
definestartstop: definieerstartstop definestartstop
definierestartstop definujstartstop
definisciiniziatermina definestestartstop
+ definitdemarrestoppe
setupstartstop: stelstartstopin setupstartstop
setupstartstop setupstartstop
impostainiziatermina setupstartstop
+ regledemarrestoppe
startlocal: startlokaal startlocal
startlokal startlokalni
inizialocale startlocal
+ demarrelocal
stoplocal: stoplokaal stoplocal
stoplokal stoplokalni
terminalocale stoplocal
+ stoppelocal
startglobal: startglobaal startglobal
startglobal startglobalni
iniziaglobale startglobal
+ demarreglobal
stopglobal: stopglobaal stopglobal
stopglobal stopglobalni
terminaglobale stopblobal
+ stoppeglobal
macroname: naam name
name jmeno
nome nume
+ nommacro
definemakeup: definieeropmaak definemakeup
definiereumbruch definujupravu
- definiscimakeup definestemakeup % GB
+ definiscimakeup definestemakeup
+ definitmakeup
setupmakeup: stelopmaakin setupmakeup
stelleumbruchein nastavupravu
impostamakeup seteazamakeup
+ reglemakeup
startmakeup: startopmaak startmakeup
startumbruch startuprava
iniziamakeup startmakeup
+ demarremakeup
stopmakeup: stopopmaak stopmakeup
stopumbruch stopuprava
terminamakeup stopmakeup
+ stoppemakeup
useexternalsoundtrack: gebruikexterngeluidsfragment useexternalsoundtrack
verwendeexternestonstueck uzijexternizvuk
usacolonnasonoraesterna folosestemuzicaexterna
+ utilisepsiteaudioexterne
useexternalfile: gebruikexternefile useexternalfile
verwendeexternedatei uzijexternisoubor
usafileesterno folosestefisierextern
+ utilisefichierexterne
useexternalfiles: gebruikexternefiles useexternalfiles
verwendeexternedateien uzijexternisoubory
usafileesterni folosestefisiereexterne
+ utilisefichiersexternes
referral: kenmerk referral
verweis odkaz
- referral referit % GB
+ referral referit
+ recommandation
referraldate: kenmerkdatum referraldate
verweisdatum odkaznadatum
datareferral datareferit
+ daterecommandation
high: hoog high
hoch vysoky
ap inalt
+ haut
lohi: laho lohi
tiho nivy
pedap jossus
+ baha
low: laag low
tief nizky
ped jos
+ bas
fraction: breuk fraction
bruch zlomek
frazione fractie
+ fraction
chem: chem chem
chem chem
chim chem
+ chem
startopposite: startnaast startopposite
startgegenueber startprotejsek
iniziaopposto startopozit
+ demarreopposition
stopopposite: stopnaast stopopposite
stopgegenueber stopprotejsek
terminaopposto stopopozit
+ stoppeopposition
setupoppositeplacing: stelnaastplaatsenin setupoppositeplacing
stellegegenueberplatzierenein nastavumisteniprotejsku
impostaposizionamentoopposti seteazaplasareaopozita
+ regleplacementopposition
startpositioning: startpositioneren startpositioning
startpositionieren startumistovani
iniziaposizionamento startpozitionare
+ demarrepositionnement
stoppositioning: stoppositioneren stoppositioning
stoppositionieren stopumistovani
terminaposizionamento stoppozitionare
+ stoppepositionnement
position: positioneer position
position pozice
posizione pozitie
+ position
setuppositioning: stelpositionerenin setuppositioning
stellepositionierenein nastavumistovani
impostaposizionamento setarepozitie
+ reglepositionnement
rotate: roteer rotate
drehen otocit
- ruota roteste % GB
+ ruota roteste
+ oriente
setuprotate: stelroterenin setuprotate
stelledrehenein nastavotoceni
impostarotazione seteazarotare
+ regleoriente
mirror: spiegel mirror
spiegeln zrcadlit
riflessione reflexie
+ reflete
scale: schaal scale
format meritko
- scala scala % GB
+ scala scala
+ echelle
setupnumbering: stelnummerenin setupnumbering
stellenummerierungein nastavcislovani
impostanumerazione seteazanumerotare
+ reglenumerotation
reset: reset reset
ruecksetzten reset
reimposta reset
+ raz
setuppublications: stelpublicatiesin setuppublications
stellepublikationein nastavpublikace
impostapubblicazioni seteazapublicatii
+ reglepublications
publication: publicatie publication
publikation publikace
pubblicazione publicatie
+ publication
definehbox: definieerhbox definehbox
definierehbox definujhbox
definiscihbox definestehbox
+ definithbox
adding: toevoegen adding
zusatz scitani
- adding adauga % GB
+ adding adauga
+ ajout
periods: punten periods
punkt tecky
punti puncte
+ periodes
setuphyphenmark: stelkoppeltekenin setuphyphenmark
stellebindestrichein nastavdelitko
- impostasegnosillabazione seteazaliniesilabe % GB
+ impostasegnosillabazione seteazaliniesilabe
+ reglemarquagehyphenation
setupinterlinespace: stelinterliniein setupinterlinespace
stellezeilenabstandein nastavmeziradkovoumezeru
impostainterlinea seteazaspatiuinterliniar
+ regleespacementinterligne
setupspacing: stelspatieringin setupspacing
stellespatiumein nastavradkovani
impostaspaziatura seteazaspatiu
+ regleespacement
setuptolerance: steltolerantiein setuptolerance
stelletoleranzein nastavtoleranci
impostatolleranza seteazatoleranta
+ regletolerance
setupsystem: stelsysteemin setupsystem
stellesystemein nastavsystem
impostasistema seteazasistem
+ reglesysteme
usepath: gebruikgebied usedirectory
benutzeverzeichnis uzijadresar % TOBIAS
- usacartella folosestedirector % GB
+ usacartella folosestedirector
+ utilisechemin
defineparagraphs: definieeralineas defineparagraphs
definiereabsaetze definujodstavce
definiscicapoversi definesteparagraf
+ definitparagraphes
setupparagraphs: stelalineasin setupparagraphs
stelleabsaetzeein nastavodstavce
impostacapoversi seteazaparagrafe
+ regleparagraphes
donttest: geentest donttest
keintest zadnytest
notest nutesta
+ sanstest
setupcomment: stelcommentaarin setupcomment
stellekommentarein nastavkomentar
impostacommento seteazacomentariu
+ reglecommentaire
comment: commentaar comment
kommentar komentar
commento comentariu
+ commentaire
definefield: definieerveld definefield
definierefeld definujpole
definiscicampo definestecamp
+ definitchamp
definemainfield: definieerhoofdveld definemainfield
definierehauptfeld definujhlavnipole
definiscicampoprincipale definestecampprincipal
+ definitchampprincipal
definesubfield: definieersubveld definesubfield
definieresubfeld definujpodpole
definiscisottocampo definestesubcamp
+ definitsouschamp
clonefield: kloonveld clonefield
klonierefeld klonujpole
clonacampo cloneazacamp
+ clonechamp
copyfield: copieerveld copyfield
kopierefeld kopirujpole
copiacampo copiazacamp
+ copitchamp
setupfield: stelveldin setupfield
stellefeldein nastavpole
impostacampo seteazacamp
+ reglechamp
setupfields: stelveldenin setupfields
stellefelderin nastavvsechnapole
impostacampi seteazacampuri
+ reglechamps
field: veld field
feld pole
campi camp
+ champ
fitfield: passendveld fitfield
passendfeld prizpusobivepole % or vhodnepole
adattacampo potrivestecamp
+ ajustechamp
logfields: registreervelden logfields
registrierefelder zaznamovepole
- logcampi logcampuri % GB
+ logcampi logcampuri
+ logchamp
showfields: toonvelden showfields
zeigefelder ukazpole
mostracampi afiseazacampuri
+ montrechamps
tooltip: suggestie tooltip
tooltip bublinkovanapoveda
- tooltip tooltip % GB
+ tooltip tooltip
+ suggestion
fillinfield: invulveld fillinfield
ausfuellfeld vyplnovepole
camporiempimento campumplere
+ remplitchamp
definefieldstack: definieerveldstapel definefieldstack
definierefeldstapel definujzasobnikpoli
- definiscistackcampi definestestivacampuri % GB
+ definiscistackcampi definestestivacampuri
+ definitpilechamp
fieldstack: veldstapel fieldstack
feldstapel zasobnikpoli
stackcampi stivacampuri
+ pilechamp
setupforms: stelformulierenin setupforms
setupforms setupforms
- impostaforms seteazaformulare % GB
+ impostaforms seteazaformulare
+ regleformulaires
setupclipping: stelclipin setupclipping
stelleausschnittein nastavorez
- impostaclippling seteazaclipping % GB
+ impostaclippling seteazaclipping
+ regleclipping
clip: clip clip
ausschnitt orez
clip clip
+ clip
placelegend: plaatslegenda placelegend
platzierelegende umistilegendu
mettilegenda punelegenda
+ placelegende
setuplegend: stellegendain setuplegend
stellelegendeein nastavlegendu
impostalegenda seteazalegenda
+ reglelegende
setuppagecomment: stelpaginacommentaarin setuppagecomment
stelleseitenkommentarein nastavkomentarstrany
impostacommentopagina seteazacomentariupagina
+ reglecommentairepage
setupstrut: stelstrutin setupstrut
setupstrut setupstrut
impostastrut seteazastrut
+ reglestrut
definerule: definieerlijn definerule
definerule definerule
definiscilinea definesterigla
+ definitregle
placerule: plaatslijn placerule
placerule placerule
mettilinea punerigla
+ placeregle
setuprule: stellijnin setuprule
setuprule setuprule
impostalinea seteazarigla
+ regleregle
definetextvariable: definieertekstvariabele definetextvariable
definetextvariable definetextvariable
definiscivariabiletesto definestevariabilatext
+ definitvariabletexte
setuptextvariable: steltekstvariabelein setuptextvariable
setuptextvariable setuptextvariable
impostavariabiletesto seteazavariabilatext
+ reglevariabletexte
settextvariable: kentekstvariabeletoe settextvariable
settextvariable settextvariable
- setvariabiletesto setvariabilatext % GB
+ setvariabiletesto setvariabilatext
+ affectevariabletexte
placetextvariable: plaatstekstvariabele placetextvariable
placetextvariable placetextvariable
mettivariabiletesto punevariabilatext
+ placevariabletexte
textvariable: tekstvariabele textvariable
textvariable textvariable
variabiletesto variabilatext
+ variabletexte
definetextposition: definieertekstpositie definetextposition
definetextposition definetextposition
definisciposizionetesto definestepozitietext
+ definitpositiontexte
setuptextposition: steltekstpositiein setuptextposition
setuptextposition setuptextposition
impostaposizionetesto seteazapozitietext
+ reglepositiontexte
positiontext: positioneertekst positiontext
positiontext positiontext
- posizionatesto pozitietext % GB
+ posizionatesto pozitietext
+ positionnetexte
definerawfont: definerawfont definerawfont
definerawfont definerawfont
definiscifontgrezzo definestefontraw
+ definitpolicebrute
switchtorawfont: switchtorawfont switchtorawfont
switchtorawfont switchtorawfont
passaafontgrezzo trecilafontraw
-
- placeheadtext: plaatskoptekst placeheadtext
- placeheadtext placeheadtext
- posizionatestotesta placeheadtext
-
-placeheadnumber: plaatskopnummer placeheadnumber
- placeheadnumber placeheadnumber
- posizionanumerotesta placeheadnumber
-
- definepagebreak: definieerpaginaovergang definepagebreak
- definepagebreak definepagebreak
- definepagebreak definepagebreak
-definecolumnbreak: definieerkolomovergang definecolumnbreak
- definecolumnbreak definecolumnbreak
- definecolumnbreak definecolumnbreak
+ changepolicebrute
+ placeheadtext: plaatskoptekst placeheadtext
+ placeheadtext placeheadtext
+ posizionatestotesta placeheadtext
+ placetextetete
+ placeheadnumber: plaatskopnummer placeheadnumber
+ placeheadnumber placeheadnumber
+ posizionanumerotesta placeheadnumber
+ placenumerotete
+ definepagebreak: definieerpaginaovergang definepagebreak
+ definepagebreak definepagebreak
+ definepagebreak definepagebreak
+ definitsautdepage
+ definecolumnbreak: definieerkolomovergang definecolumnbreak
+ definecolumnbreak definecolumnbreak
+ definecolumnbreak definecolumnbreak
+ definitsautdecolonne
+ definemathalignment: definieerwiskundeuitlijnen definemathalignment
+ definemathalignment definemathalignment
+ definemathalignment definemathalignment
+ definemathalignment
+ setupmathalignment: stelwiskundeuitlijnenin setupmathalignment
+ setupmathalignment setupmathalignment
+ setupmathalignment setupmathalignment
+ setupmathalignment
\stopcommands
@@ -1856,11 +2429,12 @@ definecolumnbreak: definieerkolomovergang definecolumnbreak
\startcommands dutch english
german czech
italian romanian
-
+ french
setupitemgroups: stelopsommingenin setupitemizations
stelleaufzaehlungenein nastavvycty
impostaelencazioni setareitemization
+ reglegroupeselements
\stopcommands
@@ -1875,180 +2449,235 @@ definecolumnbreak: definieerkolomovergang definecolumnbreak
\startcommands dutch english
german czech
italian romanian
+ french
topheight: bovenhoogte topheight
hoeheoben vyskahorejsku
altezzacima inaltimesus
+ hauteursup
topdistance: bovenafstand topdistance
abstandoben vzdalenosthorejsku
distanzacima distantasus
+ distancesup
headerheight: hoofdhoogte headerheight
kopfzeilenhoehe vyskazahlavi
altezzaintestazione inaltimeantet
+ hauteurentete
headerdistance: hoofdafstand headerdistance
kopfzeilenabstand vzdalenostzahlavi
distanzaintestazione distantaantet
+ distanceentete
textheight: teksthoogte textheight
texthoehe vyskatextu
altezzatesto inaltimetext
+ hauteurtexte
footerdistance: voetafstand footerdistance
fusszeileabstand vzdalenostupati
distanzapdp distantasubsol
+ distancepdp
footerheight: voethoogte footerheight
fusszeilenhoehe vyskaupati
altezzapdp inaltimesubsol
+ hauteurpdp
bottomdistance: onderafstand bottomdistance
abstandunten vzdalenostspodku
distanzafondo distantajos
+ distanceinf
bottomheight: onderhoogte bottomheight
hoeheunten vyskaspodku
altezzafondo inaltimejos
+ hauteurinf
marginwidth: margebreedte marginwidth
marginalbreite sirkamarginalie
- ampiezzamargine latimemargine % GB
+ ampiezzamargine latimemargine
+ largeurmarge
leftmarginwidth: linkermargebreedte leftmarginwidth
linkemarginalbreite sirkalevemarginalie
ampiezzamarginesinistro latimemarginestanga
+ largeurmargegauche
rightmarginwidth: rechtermargebreedte rightmarginwidth
rechtemarginalbreite sirkapravemarginalie
ampiezzamarginedestro latimemarginedreapta
+ largeurmargedroite
margindistance: margeafstand margindistance
marginalafstand vzdalenostmarginalie
distanzamargine distantamargine
+ distancemarge
leftmargindistance: linkermargeafstand leftmargindistance
linkemarginalafstand vzdalenostlevemarginalie
distanzamarginesinistro distantamarginestanga
+ distancemargegauche
rightmargindistance: rechtermargeafstand rightmargindistance
rechtemarginalafstand vzdalenostpravemarginalie
distanzamarginedestro distantamarginedreapta
+ distancemargedroite
edgewidth: randbreedte edgewidth
randbreite sirkaokraje
ampiezzabordo latimecolturi
+ largeurbord
leftedgewidth: linkerrandbreedte leftedgewidth
breitelinkerrand sirkalevehookraje
ampiezzabordosinistro latimecoltstanga
+ largeurbrodgauche
rightedgewidth: rechterrandbreedte rightedgewidth
breiterechterrand sirkapravehookraje
ampiezzabordodestro latimecoltdreapta
+ largeurborddroit
edgedistance: randafstand edgedistance
randabstand vzdalenostokraje
distanzabordo distantacolt
+ distancebord
leftedgedistance: linkerrandafstand leftedgedistance
abstandlinkerrand vzdalenostlevehookraje
distanzabordosinistro distantacoltstanga
+ distancebordgauche
rightedgedistance: rechterrandafstand rightedgedistance
abstandrechterrand vzdalenostpravehookraje
distanzabordodestro distantacoltdreapta
- innermarginwidth: binnenmargebreedte innermarginwidth
- innermarginwidth innermarginwidth
- innermarginwidth innermarginwidth
- outermarginwidth: buitenmargebreedte outermarginwidth
- outermarginwidth outermarginwidth
- outermarginwidth outermarginwidth
-innermargindistance: binnenmargeafstand innermargindistance
- innermargindistance innermargindistance
- innermargindistance innermargindistance
-outermargindistance: buitenmargeafstand outermargindistance
- outermargindistance outermargindistance
- outermargindistance outermargindistance
- inneredgewidth: binnenrandbreedte inneredgewidth
- inneredgewidth inneredgewidth
- inneredgewidth inneredgewidth
- outeredgewidth: buitenrandbreedte outeredgewidth
- outeredgewidth outeredgewidth
- outeredgewidth outeredgewidth
- inneredgedistance: binnenrandafstand inneredgedistance
- inneredgedistance inneredgedistance
- inneredgedistance inneredgedistance
- outeredgedistance: buitenrandafstand outeredgedistance
- outeredgedistance outeredgedistance
- outeredgedistance outeredgedistance
+ distanceborddroit
+ innermarginwidth: binnenmargebreedte innermarginwidth
+ innermarginwidth innermarginwidth
+ innermarginwidth innermarginwidth
+ innermarginwidth
+ outermarginwidth: buitenmargebreedte outermarginwidth
+ outermarginwidth outermarginwidth
+ outermarginwidth outermarginwidth
+ outermarginwidth
+ innermargindistance: binnenmargeafstand innermargindistance
+ innermargindistance innermargindistance
+ innermargindistance innermargindistance
+ innermargindistance
+ outermargindistance: buitenmargeafstand outermargindistance
+ outermargindistance outermargindistance
+ outermargindistance outermargindistance
+ outermargindistance
+ inneredgewidth: binnenrandbreedte inneredgewidth
+ inneredgewidth inneredgewidth
+ inneredgewidth inneredgewidth
+ inneredgewidth
+ outeredgewidth: buitenrandbreedte outeredgewidth
+ outeredgewidth outeredgewidth
+ outeredgewidth outeredgewidth
+ outeredgewidth
+ inneredgedistance: binnenrandafstand inneredgedistance
+ inneredgedistance inneredgedistance
+ inneredgedistance inneredgedistance
+ inneredgedistance
+ outeredgedistance: buitenrandafstand outeredgedistance
+ outeredgedistance outeredgedistance
+ outeredgedistance outeredgedistance
+ outeredgedistance
textwidth: tekstbreedte textwidth
textbreite sirkatextu
ampiezzatesto latimetext
+ largeurtexte
makeupwidth: zetbreedte makeupwidth
satzbreite sirkasazby
- ampiezzamakeup latimemakeup % GB
+ ampiezzamakeup latimemakeup
+ largeurmakeup
makeupheight: zethoogte makeupheight
satzhoehe vyskasazby
altezzamakeup inaltimemakeup
+ hauteurmakeup
topspace: kopwit topspace
kopfweite odsazenishora
spaziocima spatiusus
+ espacesup
bottomspace: bodemwit bottomspace
bottomspace bottomspace
spaziofondo spatiujos
+ espaceinf
backspace: rugwit backspace
rumpfweite odsazenizleva
- spaziodietro spatiuspate % GB
+ spaziodietro spatiuspate
+ retourarriere
cutspace: snijwit cutspace
cutspace cutspace
- cutspace cutspace % GB
+ cutspace cutspace
+ cutspace
paperwidth: papierbreedte paperwidth
papierbreite sirkapapiru
ampiezzacarta latimehartie
+ largeurpapier
paperheight: papierhoogte paperheight
papierhoehe vyskapapiru
altezzacarta inaltimehartie
+ hauteurpapier
printpaperwidth: printpapierbreedte printpaperwidth
printpapierbreite sirkatiskpapiru
- ampiezzacartastampa latimehartieimprimanta % GB
+ ampiezzacartastampa latimehartieimprimanta
+ largeureditionpapier
printpaperheight: printpapierhoogte printpaperheight
printpapierhoehe vyskatiskpapiru
- altezzacartastampa inaltimehartieimprimanta % GB
+ altezzacartastampa inaltimehartieimprimanta
+ hauteureditionpapier
pageoffset: paginaoffset pageoffset
pageoffset pageoffset
pageoffset pageoffset
+ pageoffset
pagedepth: paginadiepte pagedepth
pagedepth pagedepth
pagedepth pagedepth
+ pagedepth
headlevel: kopniveau headlevel
kopfniveau hlavniuroven
- livellotesta niveltitlu % GB
+ livellotesta niveltitlu
+ niveautete
linewidth: lijndikte linethickness
liniendicke tloustkacary
spessoreriga grosimelinie
+ largeurligne
totalnumberofpages: totaalaantalpaginas totalnumberofpages
gesamtseitenanzahl celkovypocetstran
numerototaledipagine numartotalpagini
-numberofsubpages: aantalsubpaginas numberofsubpages
- numberofsubpages numberofsubpages
- numberofsubpages numberofsubpages
+ nombretotaldepages
+ numberofsubpages: aantalsubpaginas numberofsubpages
+ numberofsubpages numberofsubpages
+ numberofsubpages numberofsubpages
+ nombredesouspages
useXMLfilter: gebruikXMLfilter useXMLfilter
useXMLfilter useXMLfilter
useXMLfilter useXMLfilter
-
-definecolumnset: definieerkolomgroep definecolumnset
- definecolumnset definecolumnset
- definiscigruppocolonne definecolumnset
- setupcolumnset: stelkolomgroepin setupcolumnset
- setupcolumnset setupcolumnset
- impostagruppocolonne setupcolumnset
- startcolumnset: startkolomgroep startcolumnset
- startcolumnset startcolumnset
- iniziagruppocolonne startcolumnset
- stopcolumnset: stopkolomgroep stopcolumnset
- stopcolumnset stopcolumnset
- terminagruppocolonne stopcolumnset
-
- setupcolumnsetlines: stelkolomgroepregelsin setupcolumnsetlines
- setupcolumnsetlines setupcolumnsetlines
- setupcolumnsetlines setupcolumnsetlines
- setupcolumnsetstart: stelkolomgroepstartin setupcolumnsetstart
- setupcolumnsetstart setupcolumnsetstart
- setupcolumnsetstart setupcolumnsetstart
-
-startcolumnmakeup: startkolomopmaak startcolumnmakeup
- startcolumnmakeup startcolumnmakeup
- startcolumnmakeup startcolumnmakeup
-
- stopcolumnmakeup: stopkolomopmaak stopcolumnmakeup
- stopcolumnmakeup stopcolumnmakeup
- stopcolumnmakeup stopcolumnmakeup
-
- usetypescript: gebruiktypescript usetypescript
- usetypescript usetypescript
- usetypescript usetypescript
+ useXMLfilter
+ definecolumnset: definieerkolomgroep definecolumnset
+ definecolumnset definecolumnset
+ definiscigruppocolonne definecolumnset
+ definitjeucolonne
+ setupcolumnset: stelkolomgroepin setupcolumnset
+ setupcolumnset setupcolumnset
+ impostagruppocolonne setupcolumnset
+ reglejeucolonne
+ startcolumnset: startkolomgroep startcolumnset
+ startcolumnset startcolumnset
+ iniziagruppocolonne startcolumnset
+ demarrejeucolonne
+ stopcolumnset: stopkolomgroep stopcolumnset
+ stopcolumnset stopcolumnset
+ terminagruppocolonne stopcolumnset
+ stoppejeucolonne
+ setupcolumnsetlines: stelkolomgroepregelsin setupcolumnsetlines
+ setupcolumnsetlines setupcolumnsetlines
+ setupcolumnsetlines setupcolumnsetlines
+ setupcolumnsetlines
+ setupcolumnsetstart: stelkolomgroepstartin setupcolumnsetstart
+ setupcolumnsetstart setupcolumnsetstart
+ setupcolumnsetstart setupcolumnsetstart
+ setupcolumnsetstart
+ startcolumnmakeup: startkolomopmaak startcolumnmakeup
+ startcolumnmakeup startcolumnmakeup
+ startcolumnmakeup startcolumnmakeup
+ startcolumnmakeup
+ stopcolumnmakeup: stopkolomopmaak stopcolumnmakeup
+ stopcolumnmakeup stopcolumnmakeup
+ stopcolumnmakeup stopcolumnmakeup
+ stopcolumnmakeup
+ usetypescript: gebruiktypescript usetypescript
+ usetypescript usetypescript
+ usetypescript usetypescript
+ usetypescript
+ usetypescriptfile: gebruiktypescriptfile usetypescriptfile
+ usetypescriptfile usetypescriptfile
+ usetypescriptfile usetypescriptfile
\stopcommands
@@ -2063,50 +2692,36 @@ startcolumnmakeup: startkolomopmaak startcolumnmakeup
\startcommands dutch english
german czech
italian romanian
+ french
startdocument: startdocument startdocument
startdokument startdokument
iniziadocumento startdocument
+ demarredocument
stopdocument: stopdocument stopdocument
stopdokument stopdokument
terminadocumento stopdocument
+ stoppedocument
startoverzicht: startoverzicht startoverview
startueberblick startprehled
- iniziaoverview startoverview % GB
+ iniziaoverview startoverview
+ demarrevuedensemble
stopoverzicht: stopoverzicht stopoverview
stopueberblick stopprehled
terminaoverview stopoverview
+ stoppevuedensemble
label: label label
label poppisek
etichetta eticheta
-%
-% obsolete
-%
-% stelbrievenin: stelbrievenin setupcorrespondence
-% stellekorrespondenzein nastavkorespondenci
-% impostacorrispondenza seteazacorespondenta
-% brieven: brieven letters
-% briefe dopisy
-% lettere litere
-% brief: brief letter
-% brief dopis
-% lettera litera
-% sheet: sheet sheet
-% blatt list
-% foglio sheet
-% stelstickersin: stelstickersin setupstickers
-% stellestickerein nastavetikety
-% impostafrancobolli seteazastickers % GB
-% stelsheetsin: stelsheetsin setupsheets
-% stelleblattein nastavlisty
-% impostafogli seteazasheets
-%
+ etiquette
labels: labels labels
labels popisky
etichette etichete
+ etiquettes
domicile: woonplaats domicile
wohnort bydliste
domicilio domiciliu
+ domicile
\stopcommands
diff --git a/Master/texmf-dist/tex/context/base/mult-con.tex b/Master/texmf-dist/tex/context/base/mult-con.tex
index 9a506832107..07bbf399443 100644
--- a/Master/texmf-dist/tex/context/base/mult-con.tex
+++ b/Master/texmf-dist/tex/context/base/mult-con.tex
@@ -11,14 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% additions are marked as % new
-
%D In this rather large definition file we are going to tell
%D \CONTEXT\ which constants, variables and elements we use.
-%D
-%D The German translations were provided by Tobias Burnus,
-%D the Czech ones by Tom Hudec, the Italian ones by Giuseppe
-%D Bilotta.
\writestatus{loading}{Context Multilingual Macros / Constants}
@@ -32,41 +26,52 @@
\startvariables dutch english
german czech
italian romanian
+ french
one: een one
eins jedna
uno unu
+ un
two: twee two
zwei dve
due doi
+ deux
three: drie three
drei tri
tre trei
+ trois
four: vier four
vier ctyri
quattro patru
+ quatre
five: vijf five
fuenf pet
cinque cinci
+ cinq
\stopvariables
\startvariables dutch english
german czech
italian romanian
+ french
environment: omgeving environment
umgebung prostredi
ambiente mediu
+ environement
component: onderdeel component
komponente komponenta
componente componenta
+ composant
product: produkt product
produkt produkt
prodotto produs
+ produit
project: project project
projekt projekt
progetto proiect
+ projet
\stopvariables
@@ -79,70 +84,91 @@
\startvariables dutch english
german czech
italian romanian
+ french
sunday: zondag sunday
sonntag nedele
domenica duminica
+ dimanche
monday: maandag monday
montag pondeli
lunedi luni
+ lundi
tuesday: dinsdag tuesday
dienstag utery
martedi marti
+ mardi
wednesday: woensdag wednesday
mittwoch streda
mercoledi miercuri
+ mercredi
thursday: donderdag thursday
donnerstag ctvrtek
giovedi joi
+ jeudi
friday: vrijdag friday
freitag patek
venerdi vineri
+ vendredi
saturday: zaterdag saturday
samstag sobota
sabato sambata
+ samedi
\stopvariables
\startvariables dutch english
german czech
italian romanian
+ french
january: januari January
Januar leden
gennaio ianuarie
+ janvier
february: februari February
Februar unor
febbraio februarie
+ fevrier
march: maart March
Maerz brezen
marzo martie
+ mars
april: april April
April duben
aprile aprilie
+ avril
may: mei May
Mai kveten
maggio mai
+ mai
june: juni June
Juni cerven
giugno iunie
+ juin
july: juli July
Juli cervenec
luglio iulie
+ juillet
august: augustus August
August srpen
agosto august
+ aout
september: september September
September zari
settembre septembrie
+ septembre
october: oktober October
Oktober rijen
ottobre octombrie
+ octobre
november: november November
November listopad
novembre noiembrie
+ novembre
december: december December
Dezember prosinec
dicembre decembrie
+ decembre
\stopvariables
%D Next we introduce some general label bound variables:
@@ -150,16 +176,20 @@
\startvariables dutch english
german czech
italian romanian
+ french
atpage: oppagina atpage
aufseite nastrance
apagina lapagina
+ alapage
hencefore: hierboven hencefore
vorher vyse
precedente precedent
+ precedent
hereafter: hieronder hereafter
nachher nize
seguente urmator
+ suivant
\stopvariables
@@ -174,67 +204,84 @@
\startvariables dutch english
german czech
italian romanian
+ french
- sectionlevel: sectie section
- abschnitt oddil
- paragrafo sectiune
part: deel part
teil cast
parte parte
+ partie
chapter: hoofdstuk chapter
kapitel kapitola
capitolo capitol
+ chapitre
subject: onderwerp subject
thema tema
argomento subiect
+ sujet
section: paragraaf section
absatz sekce
capoverso sectiune
+ section
title: titel title
titel titul
titolo titlu
+ titre
margintitle: margetitel margintitle
marginaltitel titulmarginalie
titoloinmargine titlumarginal
+ titremarge
content: inhoud content
inhalt obsah
indice cuprins
+ contenu
contents: inhouden contents
inhalte obsah
indici cuprinsuri
+ contenus
appendix: bijlage appendix
anhang dodatek
appendice apendix
+ annexe
appendices: bijlagen appendices
anhaenge dodatky
appendici apendixuri
+ annexes
bodypart: hoofdtekst bodypart
haupttext hlavnicast
- testoprincipale principal % GB
+ testoprincipale principal
+ corpsdetexte
bodymatter: hoofdteksten bodymatter
haupttexte hlavnicasti
- testiprincipali principalul % GB
+ testiprincipali principalul
+ texteprincipal
frontpart: inleiding frontpart
einleitung prednicast
prefazione prolog
+ preface
frontmatter: inleidingen frontmatter
einleitungen prednicasti
preambolo prologul
+ preambule
backpart: uitleiding backpart
epilog epilog
- postfazione epilog % GB
+ postfazione epilog
+ postface
backmatter: uitleidingen backmatter
epiloge epilogy
- postambolo epilogul % GB
+ postambolo epilogul
+ epilogue
footnote: voetnoot footnote
fussnote poznamkapodcarou
notapdp notasubsol
+ notepdp
endnote: eindnoot endnote
endnote endnote
endnote endnote
+ notefin
system: systeem system
systeme system
sistema sistem
+ systeme
\stopvariables
@@ -243,46 +290,57 @@
\startvariables dutch english
german czech
italian romanian
+ french
subsection: subparagraaf subsection
unterabsatz podsekce
sottocapoverso subsectiune
+ soussection
subsubsection: subsubparagraaf subsubsection
unterunterabsatz podpodsekce
sottosottocapoverso subsubsectiune
+ soussoussection
subsubsubsection: subsubsubparagraaf subsubsubsection
unterunterunterabsatz podpodpodsekce
sottosottosottocapoverso subsubsubsectiune
+ soussoussoussection
subsubsubsubsection: subsubsubsubparagraaf subsubsubsubsection
unterunterunterunterabsatz podpodpodpodsekce
sottosottosottosottocapoverso subsubsubsubsectiune
+ soussoussoussoussection
subsubsubsubsubsection: subsubsubsubsubparagraaf subsubsubsubsubsection
unterunterunterunterunterabsatz podpodpodpodpodsekce
sottosottosottosottosottocapoverso subsubsubsubsubsectiune
+ soussoussoussoussoussection
subsubject: subonderwerp subsubject
unterthema podtema
sottoargomento subsubiect
+ soussujet
subsubsubject: subsubonderwerp subsubsubject
unterunterthema podpodtema
sottosottoargomento subsubsubiect
+ soussoussujet
subsubsubsubject: subsubsubonderwerp subsubsubsubject
unterunterunterthema podpodpodtema
sottosottosottoargomento subsubsubsubiect
+ soussoussoussujet
subsubsubsubsubject: subsubsubsubonderwerp subsubsubsubsubject
unterunterunterunterthema podpodpodpodtema
sottosottosottosottoargomento subsubsubsubsubiect
+ soussoussoussoussujet
subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsubsubject
unterunterunterunterunterthema podpodpodpodpodtema
sottosottosottosottosottoargomento subsubsubsubsubsubiect
+ soussoussoussoussoussujet
\stopvariables
@@ -291,29 +349,36 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
\startvariables dutch english
german czech
italian romanian
+ french
flushleft: lijnlinks flushleft
flushleft flushleft
flushleft flushleft
+ flushleft
flushright: lijnrechts flushright
flushright flushright
flushright flushright
+ flushright
center: centreer center
center center
center center
+ center
\stopvariables
\startvariables dutch english
german czech
italian romanian
+ french
typing: typen typing
tippen typing
- typing typing % GB
+ typing typing
+ typing
file: file file
datei soubor
file fisier
+ fichier
\stopvariables
@@ -328,82 +393,120 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
\startvariables dutch english
german czech
italian romanian
+ french
formula: formule formula
formel rovnice
formula formula
+ formule
formulae: formules formulae
formeln rovnice
formule formule
+ formules
figure: figuur figure
abbildung obrazek
figura figura
+ figure
figures: figuren figures
abbildungen obrazky
figure figure
+ figures
table: tabel table
tabelle tabulka
tabella tabelul
+ tableau
tables: tabellen tables
tabellen tabulky
tabelle tabelele
+ tables
graphic: grafiek graphic
grafik graf
grafico graficul
+ graphique
graphics: grafieken graphics
grafiken grafy
grafici graficele
+ graphiques
intermezzo: intermezzo intermezzo
intermezzo intermezzo
intermezzo intermezzo
+ intermezzo
intermezzi: intermezzos intermezzi
intermezzi intermezzi
intermezzi intermezzi
+ intermezzi
index: index index
index rejstrik
indiceanalitico index
+ index
indices: indices indices
indizies rejstriky
indicianalitici indexuri
+ indices
abbreviation: afkorting abbreviation
abkuerzung zkratka
abbreviazione abreviere
+ abreviation
abbreviations: afkortingen abbreviations
abkuerzungen zkratky
abbreviazioni abrevieri
+ abreviations
logo: logo logo
logo logo
logo logo
+ logo
logos: logos logos
logos loga
loghi logos
+ logos
unit: eenheid unit
einheit jednotka
unita unitate
+ unite
units: eenheden units
einheiten jednotky
unita unitati
+ unites
line: regel line
zeile radek
riga linia
+ ligne
lines: regels lines
zeilen radky
righe linii
+ lignes
framedtext: kadertekst framedtext
umrahmtertext oramovanytext
testoincorniciato textinconjurat
+ texteencadre
quotation: citaat quotation
zitat citace
citazione citat
+ citation
quote: citeer quote
zitieren citovat
menzione minicitat
+ citer
speech: spraak speech
speech speech
speech speech
+ discours
itemize: opsomming itemize
aufzaehlung vycet
elenco enumerare
+ lister
+ mathalignment: wiskundeuitlijnen mathalignment
+ mathalignment mathalignment
+ mathalignment mathalignment
+ mathalignment
+ mathcases: mathcases mathcases
+ mathcases mathcases
+ mathcases mathcases
+ mathcases
+ mathmatrix: wiskundematrix mathmatrix
+ mathmatrix mathmatrix
+ mathmatrix mathmatrix
+ mathmatrix
\stopvariables
@@ -419,1096 +522,1483 @@ subsubsubsubsubsubject: subsubsubsubsubonderwerp subsubsubsubsub
\startconstants dutch english
german czech
italian romanian
-
+ french
+
+ sorttype: sortering sorttype
+ sorttype sorttype
+ sorttype sorttype
+ sorttype
+ compress: comprimeren compress
+ compress compress
+ compress compress
+ compress compress
+ compress
+ autohang: autohang autohang
+ autohang autohang
+ autohang autohang
+ autohang
+ suffix: suffix suffix
+ suffix suffix
+ suffix suffix
+ suffix
leftquotation: linkercitaat leftquotation
linkerzitat citacevlevo
citazionesinistra citatstanga
+ citationgauche
rightquotation: rechtercitaat rightquotation
rechterzitat citacevpravo
citazionedestra citatdreapta
+ citationdroite
leftquote: linkerciteer leftquote
linkerzitieren citovatvlevo
menzionesinistra minicitatstanga
+ citergauche
rightquote: rechterciteer rightquote
rechterzitieren citovatvpravo
menzionedestra minicitatdreapta
- compoundhyphen: koppelteken compoundhyphen
- compoundhyphen compoundhyphen
- compoundhyphen compoundhyphen
- leftcompoundhyphen: linkerkoppelteken leftcompoundhyphen
- leftcompoundhyphen leftcompoundhyphen
- leftcompoundhyphen leftcompoundhyphen
-rightcompoundhyphen: rechterkoppelteken rightcompoundhyphen
- rightcompoundhyphen rightcompoundhyphen
- rightcompoundhyphen rightcompoundhyphen
-midsentence: middenzin midsentence
- midsentence midsentence
- midsentence midsentence
+ citerdroite
+ compoundhyphen: koppelteken compoundhyphen
+ compoundhyphen compoundhyphen
+ compoundhyphen compoundhyphen
+ compoundhyphen
+ leftcompoundhyphen: linkerkoppelteken leftcompoundhyphen
+ leftcompoundhyphen leftcompoundhyphen
+ leftcompoundhyphen leftcompoundhyphen
+ leftcompoundhyphen
+ rightcompoundhyphen: rechterkoppelteken rightcompoundhyphen
+ rightcompoundhyphen rightcompoundhyphen
+ rightcompoundhyphen rightcompoundhyphen
+ rightcompoundhyphen
+ midsentence: middenzin midsentence
+ midsentence midsentence
+ midsentence midsentence
+ midsentence
leftsentence: linkerzin leftsentence
linkersatz vetavlevo
frasesinistra propozitiestanga
+ phrasegauche
rightsentence: rechterzin rightsentence
rechtersatz vetavpravo
frasedestra propozitiedreapta
+ phrasedroite
leftsubsentence: linkersubzin leftsubsentence
linkersubsatz podvetavlevo
sottofrasesinistra subpropozitiestanga
+ sousphrasegauche
rightsubsentence: rechtersubzin rightsubsentence
rechtersubsatz podvetavpravo
sottofrasedestra subpropozitiedreapta
-
+ sousphrasedroite
leftspeech: linkeruitspraak leftspeech
leftspeech leftspeech
- leftspeech leftspeech %%%
+ leftspeech leftspeech
+ leftspeech
middlespeech: middenuitspraak middlespeech
middlespeech middlespeech
- middlespeech middlespeech %%%
+ middlespeech middlespeech
+ middlespeech
rightspeech: rechteruitspraak rightspeech
rightspeech rightspeech
- rightspeech rightspeech %%%
-
+ rightspeech rightspeech
+ rightspeech
limittext: limiettekst limittext
limittext limittext
limittext limittext
-
+ limittext
date: datum date
datum datum
data data
+ date
spacebefore: voorwit spacebefore
vorspatium mezerapred
spazioprima spatiuinainte
+ espaceavant
spaceinbetween: tussenwit spaceinbetween
spaceinbetween spaceinbetween
spaceinbetween spaceinbetween
+ spaceinbetween
spaceafter: nawit spaceafter
nachspatium mezeraza
spaziodopo spatiudupa
+ espaceapres
sidespacebefore: zijvoorwit sidespacebefore
nebenvorspatium bocnimezerapred
spaziolateraleprima spatiulateralinainte
+ espacelateralavant
sidespaceafter: zijnawit sidespaceafter
nebennachspatium bocnimezeraza
spaziolateraledopo spatiulateraldupa
+ espacelateralapres
to: aan to
zu na
verso catre
+ vers
indicator: aanduiding indicator
indikator indikator
indicatore indicator
+ indicateur
background: achtergrond background
hintergrund pozadi
sfondo fundal
+ arriereplan
backgrounddepth: achtergronddiepte backgrounddepth
hintergrundtiefe hloubkapozadi
profonditasfondo adancimefundal
+ profondeurarriereplan
backgroundcorner: achtergrondhoek backgroundcorner
hintergrundwinkel rohpozadi
angolosfondo coltfundal
- splitcolor: splitskleur splitcolor
- splitcolor splitcolor
- splitcolor splitcolor
+ coinarriereplan
+ splitcolor: splitskleur splitcolor
+ splitcolor splitcolor
+ splitcolor splitcolor
+ splitcolor
backgroundcolor: achtergrondkleur backgroundcolor
hintergrundfarbe barvapozadi
coloresfondo culoarefundal
+ couleurarriereplan
foregroundcolor: voorgrondkleur foregroundcolor
foregroundcolor foregroundcolor
coloreprimopiano foregroundcolor
+ couleurpremierplan
foregroundstyle: voorgrondletter foregroundstyle
foregroundstyle foregroundstyle
foregroundstyle foregroundstyle
-clipoffset: clipoffset clipoffset
- clipoffset clipoffset
- clipoffset clipoffset
+ stylepremierplan
+ clipoffset: clipoffset clipoffset
+ clipoffset clipoffset
+ clipoffset clipoffset
+ clipoffset
backgroundoffset: achtergrondoffset backgroundoffset
hintergrundoffset offsetpozadi
offsetsfondo offsetfundal
+ decalagearriereplan
backgroundscreen: achtergrondraster backgroundscreen
hintergrundraster rastrpozadi
schermosfondo ecranfundal
+ ecranarriereplan
backgroundradius: achtergrondstraal backgroundradius
hintergrundradius polomerpozadi
raggiosfondo razafundal
+ rayonarriereplan
address: adres address
adresse adresa
indirizzo adresa
+ adresse
stopper: afsluiter stopper
abschnitttrenner predel
stopper stopper
+ taquet
distance: afstand distance
abstand vzdalenost
distanza distanta
+ distance
paragraph: alinea paragraph
absatz odstavec
capoverso paragraf
+ paragraphe
axis: assenstelsel axis
achsen osa
asse axa
+ axe
author: auteur author
autor autor
autore autor
+ auteur
auto: auto auto
auto auto
auto auto
+ auto
autofile: autofile autofile
autofile autofile
- autofile autofile % TB TH
+ autofile autofile
+ autofile % TB TH
balance: balanceren balance
ausgleichen rovnovaha
bilanciamento balanta
+ equilibre
wfactor: bfactor wfactor
bfaktor sfaktor
- wfactor factorw % GB
+ wfactor factorw
+ facteurlargeur
inner: binnen inner
innen vnitrni
interno intern
+ interieur
blank: blanko blank
blanko prazdny
rigovuoto blanc
+ vide
obstruction: blokkade obstruction
gesperrt prekazka
ostruzione obstructie
+ obstruction
blockway: blokwijze blockway
blockauf dobloku
- blockway blockway % GB
+ blockway blockway
+ blockway
bottomspace: bodemwit bottomspace
bottomspace bottomspace
spaziofondo spatiujos
+ espaceinf
top: boven top
oben vrsek
cima sus
+ sup
topdistance: bovenafstand topdistance
obenabstand vzdalenostvrsku
distanzacima distantasus
+ distancesup
topframe: bovenkader topframe
obenrahmen rameceknahore
cornicecima framesus
+ cadresup
topoffset: bovenoffset topoffset
obenoffset offsetvrsku
offsetcima offsetsus
+ decalagesup
topstate: bovenstatus topstate
statusoben statusvrsku
statocima staresus
+ etatsup
width: breedte width
breite sirka
ampiezza latime
+ largeur
+ autowidth: autobreedte autowidth
+ autobreite autosirka
+ autoampiezza autolatime
+ autolargeur
maxwidth: maxbreedte maxwidth
maxbreite maxsirka
ampiezzamax latimemaxima
+ largeurmax
minwidth: minbreedte minwidth
minbreite minsirka
- ampiezzamin latimeminima % TB TH
+ ampiezzamin latimeminima
+ largeurmin
source: bron source
quelle zdroj
origine sursa
+ origine
command: commando command
befehl prikaz
comando comanda
+ commande
commands: commandos commands
befehle prikazy
comandi comenzi
-component: component component
- component component
- component component
+ commandes
+ component: component component
+ component component
+ component component
+ composant
contrastcolor: contrastkleur contrastcolor
kontrastfarbe kontrastnibarva
colorecontrasto culoarecontrast
+ coleurcontraste
conversion: conversie conversion
konversion konverze
conversione conversie
+ conversion
headconversion: kopconversie headconversion
headconversion konverzehlavicky
- conversionetesta conversietitlu % TB
+ conversionetesta conversietitlu
+ conversiontete % TB
headlabel: koplabel headlabel
headlabel popisekhlavicky
- etichettatesta etichetatitlu % TB
+ etichettatesta etichetatitlu
+ etiquettetete
criterium: criterium criterium
kriterium kriterium
criterio criteriu
+ critere
date: datum date
datum datum
data data
+ date
default: default default
default implicitni
implicito implicit
+ defaut
depth: diepte depth
tiefe hloubka
profondita inaltime
+ profondeur
depthcorrection: dieptecorrectie depthcorrection
tiefekorrektur korekcehloubky
correzioneprofondita corectieadancime
-% dikte: dikte thickness
-% dicke tloustka
-% spessore grosime
+ correctionprofondeur
continue: doorgaan continue
fortsetzen pokracovat
continua continua
+ continue
doublesided: dubbelzijdig doublesided
doppelseitig oboustranne
doppiafaccia douafete
+ rectoverso
dummy: dummy dummy
dummy dummy
dummy dummy
+ dummy
unit: eenheid unit
einheit jednotka
unita unitate
+ unite
ownnumber: eigennummer ownnumber
eigenenummer vlastnicislo
numeroproprio numarpropriu
-% new
-% eigenschap: eigenschap property
-% property property
-% property property
+ numeroproprio
+% eigenschap: eigenschap property
+% property property
+% property property
+% property
evenmargin: evenmarge evenmargin
geraderand sudamarginalie
marginepari marginepara
+ margepaire
expansion: expansie expansion
expansion expanzen
espansione expansiune
-keyexpansion: sleutelexpansie keyexpansion
- keyexpansion keyexpansion
- keyexpansion keyexpansion
+ expansion
+ keyexpansion: sleutelexpansie keyexpansion
+ keyexpansion keyexpansion
+ keyexpansion keyexpansion
+ keyexpansion
factor: factor factor
faktor faktor
fattore factor
+ facteur
convertfile: converteerfile convertfile
konvertieredatei konverzesouboru
convertifile convertestefisier
+ conversionfichier
file: file file
datei soubor
file fisier
+ fichier
inputfile: inputfile inputfile
inputfile inputfile
- inputfile inputfile % !!
+ inputfile inputfile
+ fichierentree
size: formaat size
groesse velikost
dimensione dimensiune
+ dimension
autofocus: autofocus autofocus
autofocus autoostreni
autofocus autofocus
+ autofocus
focus: focus focus
focus zaostreni
- focus focus % GB
+ focus focus
+ focus
directory: gebied directory
verzeichnis adresar
directory director
+ repertoire
cache: cache cache
cache cache
cache cache
+ cache
grid: grid grid
gritter mrizka
griglia grid
+ grille
big: groot big
gross velky
grande mare
+ grand
get: haal get
hole ziskat
prendi adu
+ obtient
hang: hang hang
haengend zaveseni
sospendi suspenda
+ suspend
repeat: herhaal repeat
wiederholen opakovat
ripeti repeta
+ repete
hfactor: hfactor hfactor
hfaktor vfaktor
- hfactor hfactor % GB
+ hfactor hfactor
+ facteurhauteur
corner: hoek corner
winkel roh
angolo colt
+ coin
hoffset: hoffset hoffset
hoffset hoffset
- hoffset hoffset % GB
+ hoffset hoffset
+ decalagehauteur
frames: hokjes frames
umrahmen ramecky
cornici frames
+ cadres
header: hoofd header
kopfzeile zahlavi
intestazione antet
+ entete
headerdistance: hoofdafstand headerdistance
kopfzeilenabstand vzdalenostzahlavi
distanzaintestazione distantaantet
+ distanceentete
headerstate: hoofdstatus headerstate
kopfzeilenstatus statuszahlavi
statointestazione stareantet
+ etatentete
height: hoogte height
hoehe vyska
altezza inaltime
+ hauteur
maxheight: maxhoogte maxheight
maxhoehe maxvyska
altezzamax inaltimemaxima
+ hauteurmax
minheight: minhoogte minheight
minhoehe minvyska
altezzamin inaltimeminima
+ hauteurmin
mindepth: mindiepte mindepth
mindepth mindepth
- mindeoth mindepth % new GB
+ mindeoth mindepth
+ profondeurmin
current: huidige current
aktuell aktualni
corrente curent
+ courant
in: in in
in v
in in
+ in
indenting: inspringen indenting
einziehen odsazovani
rientro aliniat
+ composeenalinea
interaction: interactie interaction
interaktion interakce
interazione interactiune
+ interaction
interlinespace: interlinie interlinespace
zeilenabstande meziradkovamezera
interlinea spatiereinterliniara
+ espaceinterligne
items: items items
posten polozky
elementi elemente
+ elements
+ fallback: terugval fallback
+ fallback fallback
+ fallback fallback
+ fallback
frame: kader frame
rahmen ramecek
cornice frame
+ cadre
framedepth: kaderdiepte framedepth
rahmentiefe hloubkaramecku
profonditacornice adancimeframe
+ profondeurcadre
framecorner: kaderhoek framecorner
rahmenwinkel rohramecku
angolocornice coltframe
+ coincadre
framecolor: kaderkleur framecolor
rahmenfarbe barvaramecku
colorecornice culoareframe
+ couleurcadre
frameoffset: kaderoffset frameoffset
rahmenoffset offsetramecku
offsetcornice offsetframe
+ decalagecadre
frameradius: kaderstraal frameradius
rahmenradius polomerramecku
raggiocornice razaframe
+ rayoncadre
marginedge: kantlijn marginedge
marginalkante textovahrana
bordomargine coltbordura
+ bordmarge
marginedgetext: kantlijntekst marginedgetext
marginalkantetext textmarginalnihookraje
testobordomargine textcoltbordura
+ textebordmarge
aligncharacter: karakteruitlijnen aligncharacter
aligncharacter aligncharacter
- allineacarattere aliniazacaracter % TB TH
+ allineacarattere aliniazacaracter
+ caracterealigne
alignmentcharacter: uitlijnkarakter alignmentcharacter
alignmentcharacter alignmentcharacter
- carattereallineamento alierecaracter % TB TH
+ carattereallineamento alierecaracter
+ alignementcaractere
small: klein small
klein male
piccolo mic
+ petit
color: kleur color
farbe barva
colore culoare
+ couleur
column: kolom column
spalte sloupec
colonna coloana
+ colonne
columns: kolommen columns
spalten sloupce
colonne coloane
+ colonnes
columndistance: kolomafstand columndistance
spaltenabstand vzdalenostsloupcu
distanzacolonne distantacoloane
+ distancecolonne
headcommand: kopcommando headcommand
headcommand headcommand
headcommand headcommand
+ commandetete
headcolor: kopkleur headcolor
kopffarbe barvahlavicky
coloretesta culoaretitlu
+ couleurtete
headstyle: kopletter headstyle
kopfstil stylhlavicky
stiletesta stiltitlu
+ styletete
afterhead: kopna afterhead
nachkopf pohlavicce
dopotesta dupatitlu
+ aprestete
veroffset: kopoffset veroffset
kopfoffset offsethlavicky
- veroffset veroffset % GB
+ veroffset veroffset
+ veroffset
coupling: koppeling coupling
verknuepfung propojeni
accoppiamento cuplare
+ couplage
couplingway: koppelwijze couplingway
verkopplungsart zpusobpropojeni
modoaccoppiamento modcuplare
+ modecouplage
beforehead: kopvoor beforehead
vorkopf predhlavickou
primaditesta inaintetitlu
+ avanttete
topspace: kopwit topspace
kopfspatium svrchnimezera
spaziocima spatiusus
+ espacesup
bodyfont: korps bodyfont
fliesstext zakladnifont
fonttesto fonttext
+ policecorps
label: label label
label popisek
etichetta eticheta
+ etiquette
empty: leeg empty
leer prazdne
vuoto gol
+ vide
style: letter style
stil pismeno
stile stil
+ style
rule: lijn rule
linie linka
linea rigla
+ ligne
rulethickness: lijndikte rulethickness
liniendicke tloustkalinky
spessorelinea grosimerigla
+ epaisseurligne
rulecolor: lijnkleur rulecolor
linienfarbe barvalinky
colorelinea culoarerigla
+ couleurligne
list: lijst list
liste seznam
elenco lista
+ liste
leftwidth: linkerbreedte leftwidth
linkerbreite sirkavlevo
ampiezzasinistra latimestanga
+ largeurgauche
leftframe: linkerkader leftframe
linkerrahmen ramecekvlevo
cornicesinistra framestanga
+ cadregauche
leftcolor: linkerkleur leftcolor
linkerfarbe barvavlevo
coloresinistra culoarestanga
+ couleurgauche
leftstyle: linkerletter leftstyle
linkerstil stylvlevo
stilesinistra stilstanga
+ leftstyle
leftmargin: linkermarge leftmargin
linkerrand levyokraj
marginesinistro marginestanga
+ margegauche
leftmargindistance: linkermargeafstand leftmargindistance
linkerrandabstand vzdalenostlevehookraje
distanzamarginesinistro distantamarginestanga
+ distancemargegauche
leftoffset: linkeroffset leftoffset
linkeroffset levyoffset
offsetsinistro offsetstanga
+ decalagegauche
leftedge: linkerrand leftedge
linkekante levahrana
bordosinistro bordurastanga
+ brodgauche
leftedgedistance: linkerrandafstand leftedgedistance
linkerkantenabstand vzdalenostlevehrany
distanzabordosinistro distantabordurastanga
+ distancebordgauche
lefttext: linkertekst lefttext
linkertext textvlevo
- testosinistro textstanga % GB
+ testosinistro textstanga
+ textegauche
left: links left
links vlevo
sinistra stanga
+ gauche
nleft: nlinks nleft
nlinks nvlevo
nsinistra nstanga
+ ngauche
logo: logo logo
logo logo
logo logo
+ logo
logos: logos logos
logos loga
loghi logos
+ logos
local: lokaal local
lokal lokalne
locale local
+ local
margin: marge margin
marginalie marginalie
margine margine
+ marge
margindistance: margeafstand margindistance
marginalabstand vzdalenostokraje
distanzamargine distantamargine
+ distancemarge
margintext: margetekst margintext
marginaltext textmarginalie
testomargine textmargine
+ textemarge
marking: markering marking
beschriftung znaceni
marcatura marcaje
+ marquage
marcolor: markleur marcolor
beschrfarbe barvaznacky
coloremarcatura culoaremarcaj
+ couleurmarquage
marstyle: marletter marstyle
beschrstil stylsnacky
stilemarcatura stilmarcaj
+ stylemarquage
menu: menu menu
menue menu
menu meniu
+ menu
splitmethod: splitsmethode splitmethod
splitmethod splitmethod
splitmethod splitmethod
+ splitmethod
textmethod: tekstmethode textmethod
textmethod textmethod
textmethod textmethod
+ textmethod
sidemethod: zijmethode sidemethod
sidemethod sidemethod
sidemethod sidemethod
+ sidemethod
method: methode method
methode metoda
metodo metoda
+ methode
middle: midden middle
mittig stredni
- centro mijloc % GB
+ centro mijloc
+ milieu
middletext: middentekst middletext
mittigertext strednitext
- testocentro textmijloc % GB
+ testocentro textmijloc
+ textecentre
max: max max
max max
max max
+ max
min: min min
min min
min min
+ min
sample: monster sample
muster vzor
campione exemplu
+ echantillon
after: na after
nach po
dopo dupa
+ apres
name: naam name
name jmeno
nome nume
+ nom
commandafter: nacommando commandafter
zumbefehl prikazpo
comdandodopo comandadupa
+ commandeapres
ntop: nboven ntop
noben nvrsek
ncima nsus
+ nsup
level: niveau level
niveau uroven
livello nivel
+ niveau
levels: niveaus levels
niveaus urovne
livelli nivele
+ niveaux
nbottom: nonder nbottom
nunten nspodek
nfondo njos
+ ninf
norm: norm norm
norm norm
norma norm
+ norme
nlines: nregels nlines
zzeile nradky
nrighe nlinii
+ nlignes
number: nummer number
nummer cislo
numero numar
+ numero
numbercommand: nummercommando numbercommand
nummerbefehl ciselnyprikaz
comandonumero comandanumar
+ commandenumero
numbering: nummeren numbering
nummerierung cislovani
numerazione numerotare
+ numerotation
numbercolor: nummerkleur numbercolor
nummernfarbe barvacisla
colorenumero culoarenumar
+ couleurnumero
numberstyle: nummerletter numberstyle
nummernstil stylcisla
stilenumero stilnumar
+ stylenumero
numberseparator: nummerscheider numberseparator
nummernseperator oddelovaccisla
separatorenumero separatornumar
+ separateurnumbero
object: object object
objekt objekt
oggetto obiect
+ objet
offset: offset offset
offset offset
offset offset
+ offset
bottom: onder bottom
unten spodek
fondo jos
+ inf
bottomdistance: onderafstand bottomdistance
abstandunten vzdalenostspodku
distanzafondo distantajos
+ distanceinf
bottomframe: onderkader bottomframe
untenrahmen ramecekdole
cornicefondo framejos
+ cadreinf
bottomoffset: onderoffset bottomoffset
untenoffset offsetspodku
offsetfondo offsetjos
+ decalageinf
bottomstate: onderstatus bottomstate
untenstatus statusspodku
statofondo starejos
+ etatinf
oddmargin: onevenmarge oddmargin
ungeraderand lichyokraj
marginedispari margineimpara
+ margepaire
at: op at
bei u
ad la
+ a
option: optie option
option volba
opzione optiune
+ option
page: pagina page
seite stranka
pagina pagina
+ page
pagecommand: paginacommando pagecommand
seitenbefehl strankovyprikaz
comandopagina comandapagina
+ commandepage
pagecolor: paginakleur pagecolor
seitenfarbe barvastranky
colorepagina culoarepagina
+ couleurpage
pagestyle: paginaletter pagestyle
seitenstil stylstranky
stilepagina stilpagina
+ stylepage
pagenumber: paginanummer pagenumber
seitennummer cislostranky
numeropagina numarpagina
+ numeropage
headnumber: kopnummer headnumber
kopfnummer cislonadpisu
numerotesta numartitlu
+ numerotete
pageboundaries: paginaovergangen pageboundaries
seitenbegrenzung hranicestranky
limitipagina marginipagina
+ limitespage
pagestate: paginastatus pagestate
pagestate pagestate
- statopagina pagestate % TODO
+ statopagina pagestate
+ etatpage
palet: palet palet
palette paleta
tavolozza paleta
+ palette
paper: papier paper
papier papir
carta hartie
+ papier
location: plaats location
platz misto
luogo locatie
+ emplacement
placestopper: plaatsafsluiter placestopper
setzetrenner predelmista
- mettistopper punestopper % GB
+ mettistopper punestopper
+ emplacementstopper
place: plaatsen place
platziere umistit
- metti pune % GB
+ metti pune
+ place
placehead: plaatskop placehead
setzekopf umistihlavicku
- mettitesta punetitlu % GB
+ mettitesta punetitlu
+ placetete
position: positie position
position position
- posizione pozitie % TB TH
+ posizione pozitie
+ position % TB TH
prefix: prefix prefix
prefix prefix
prefisso prefix
+ prefixe
preset: preset preset
voreinstellung prednastaveni
- preimpostato preset % GB
+ preimpostato preset
+ prereglage
preview: preview preview
vorschau nahled
anteprima previzualizare
-process: proces process
- process process
- process process
- spot: spot spot
- spot spot
- spot spot
+ previsualisation
+ process: proces process
+ process process
+ process process
+ process
+ spot: spot spot
+ spot spot
+ spot spot
+ spot
dot: punt dot
punkt tecka
punto punct
+ point
arrow: pijl arrow
pfeil sipka
freccia sageata
+ fleche
edge: rand edge
kante hrana
bordo bordura
+ bord
edgedistance: randafstand edgedistance
kantenabstand vzdalenosthrany
distanzabordo distantabordura
+ distancebord
screen: raster screen
raster rastr
schermo ecran
+ ecran
rightwidth: rechterbreedte rightwidth
rechterbreite sirkavpravo
ampiezzadestra marginedreapta
+ largeurdroite
rightframe: rechterkader rightframe
rechterrahmen ramecekvpravo
cornicedestra framedreapta
+ cadredroit
rightcolor: rechterkleur rightcolor
rechterfarbe barvavpravo
coloredestra culoaredreapta
+ couleurdroite
rightstyle: rechterletter rightstyle
rechterstil stylvpravo
stiledestra stildreapta
+ styledroit
rightmargin: rechtermarge rightmargin
rechterrand pravyokraj
marginedestro marginedreapta
+ margedroite
rightmargindistance: rechtermargeafstand rightmargindistance
rechterrandabstand vzdalenostpravehookraje
distanzamarginedestro distantamarginedreapta
+ distancemargedroite
rightoffset: rechteroffset rightoffset
rechterabstand pravyoffset
offsetdestro offsetdreapta
+ rightoffset
rightedge: rechterrand rightedge
rechtekante pravahrana
bordodestro borduradreapta
+ borddroit
rightedgedistance: rechterrandafstand rightedgedistance
rechterkantenabstand vzdalenostpravehrany
distanzabordodestro distantacoltdreapta
+ distanceborddroit
righttext: rechtertekst righttext
rechtertext textvpravo
- testodestro textdreapta % GB
+ testodestro textdreapta
+ textedroit
right: rechts right
rechts vpravo
destra dreapta
+ droite
nright: nrechts nright
nrechts nvpravo
ndestra ndreapta
+ ndroite
reduction: reductie reduction
reduktion redukce
riduzione reducere
+ reduction
referencing: refereren referencing
referieren odkazujici
- referencing referinta % GB
+ referencing referinta
+ referencing
line: regel line
zeile radek
riga linie
+ ligne
linecorrection: regelcorrectie linecorrection
zeilekorrektur korekceradku
correzioneriga corectielinie
+ correctionligne
lines: regels lines
zeilen radky
righe linii
+ lignes
stretch: rek stretch
strecken natahnout
- dilata dilatat % CHECK
+ dilata dilatat
+ etire
resolution: resolutie resolution
aufloesung rozliseni
risoluzione rezolutie
+ resolution
rotation: rotatie rotation
rotation rotace
rotazione rotatie
-% new
+ rotation
orientation: orientatie orientation
orientation orientation
orientation orientation
-
+ orientation
horoffset: rugoffset horoffset
rumpfabstand horoffset
- horoffset offsetoriz % GB
+ horoffset offsetoriz
+ horoffset
backspace: rugwit backspace
rumpfspatium zpetnamezera
- backspace spatiuspate % GB
+ backspace spatiuspate
+ retour
direction: richting direction
richtung smer
direzione directie
+ direction
scale: schaal scale
format meritko
scala scala
+ echelle
separator: scheider separator
seperator oddelovac
separatore separator
+ separateur
display: scherm display
bildschirm obrazovka
- display display % GB
+ display display
+ affichage
scope: scope scope
bereich rozsah
- scope scop % GB
+ scope scop
+ scope
+ % beware: section is already used for 'paragraph'
section: sectie section
abschnitt oddil
sezione sectiune
+ section
sectionnumber: sectienummer sectionnumber
abschnittsnummer cislooddilu
numerosezione numarsectiune
-setups: setups setups
- setups setups
- setups setups
+ numerosection
+ setups: setups setups
+ setups setups
+ setups setups
+ reglages
cutspace: snijwit cutspace
cutspace cutspace
- cutspace cutspace % GB
+ cutspace cutspace
+ cutspace
family: soort family
familie rodina
famiglia familie
+ famille
space: spatie space
spatium mezera
spazio spatiu
+ espace
spacing: spatiering spacing
spatiumausgleich mezerovani
spaziatura spatiere
+ espacement
split: splitsen split
split split
- separa split % TB TH
-splitoffset: splitsoffset splitoffset
- splitoffset splitoffset
- splitoffset splitoffset % TB TH
+ separa split
+ split
+ splitoffset: splitsoffset splitoffset
+ splitoffset splitoffset
+ splitoffset splitoffset
+ splitoffset
indentnext: springvolgendein indentnext
ziehefolgendeein odsadpristi
rientrasuccessivo aliniaturmator
+ indentesuivant
step: stap step
schritt krok
passo pas
+ pas
stack: stapel stack
stack stack
- stack stack % TB GB
+ stack stack
+ stack
start: start start
start start
inizia start
+ demarre
state: status state
status status
stato stare
+ etat
stop: stop stop
stop stop
termina stop
+ stoppe
radius: straal radius
radius polomer
raggio raza
+ rayon
dash: streep dash
strich pomlcka
- dash dash % GB
+ dash dash
+ pointille
sub: sub sub
unter pod
sotto sub
+ sous
subtitle: subtitel subtitle
untertitel podtitulek
sottotitolo subtitlu
+ soustitre
symbol: symbool symbol
symbol symbol
simbolo simbol
+ symbole
symbolset: symboolset symbolset
symbolset sadasymbolu
setsimboli setsimbol
+ jeusymbole
symcolor: symkleur symcolor
symfarbe barvasymbolu
coloresimbolo culoaresimbol
+ couleursym
symstyle: symletter symstyle
symstil stylsymboly
stilesimbolo stilsimbol
+ stylesym
synonym: synoniem synonym
synonym synonymum
sinonimo sinonim
+ synonyme
synonymcolor: synoniemkleur synonymcolor
synonymfarbe barvasynonyma
coloresinonimi culoaresinonim
+ couleursynonyme
synonymstyle: synoniemletter synonymstyle
synonymstil stylsynonyma
stilesinonimi stilsinonim
+ stylesynonyme
tab: tab tab
tab tab
tab tab
+ tab
sign: teken sign
zeichen znak
segno semn
+ signe
text: tekst text
text text
testo text
+ texte
listtext: lijsttekst listtext
listtext listtext
listtext listtext
+ texteliste
textwidth: tekstbreedte textwidth
textbreite sirkatextu
ampiezzatesto latimetext
+ largeurtexte
textcommand: tekstcommando textcommand
textbefehl textovyprikaz
comandotesto comandatext
+ commandetexte
textsize: tekstformaat textsize
textgroesse velikosttextu
dimensionetesto dimensiunetext
+ tailletexte
textcolor: tekstkleur textcolor
textfarbe barvatextu
coloretesto culoaretext
+ couleurtexte
textstyle: tekstletter textstyle
textstil styltextu
stiletesto stiltext
+ styletexte
textseparator: tekstscheider textseparator
textseparator oddelovactextu
separatoretesto separatortext
+ separateurtexte
textstate: tekststatus textstate
textstatus statustextu
statotesto staretext
+ etattexte
title: titel title
titel titul
titolo titlu
+ titre
titlestyle: titelletter titlestyle
titelstil styltitulek
stiletitolo stiltitlu
+ styletitre
titlecolor: titelkleur titlecolor
titelfarbe barvatitulek
coloretitolo culoaretitlu
+ couleurtitre
titledistance: titelafstand titledistance
titelabstand vzdalenosttitulek
distanzatitolo distantatitlu
+ distancetitre
aligntitle: titeluitlijnen aligntitle
titelausrichten zarovnejtitul
allineatitolo alinieretitlu
+ alignementtitre
tolerance: tolerantie tolerance
toleranz tolerance
tolleranza toleranta
+ tolerance
inbetween: tussen inbetween
zwischen mezi
tra intre
+ entre
type: type type
typ typ
- type type % GB
+ type type
+ type
align: uitlijnen align
ausrichtung zarovnani
allinea aliniere
+ alignement
urlspace: urlspatie urlspace
urlspatium prostorurl
spaziourl spatiuurl
+ espaceurl
urlalternative: urlvariant urlalternative
urlalternative urlalternativa
alternativaurl urlalternativ
+ alternativeurl
from: van from
von z
da dela
+ de
alternative: variant alternative
alternative alternativa
alternativa alternativ
+ alternative
increment: verhoog increment
erhoehen zvysit
- incremento increment % GB
+ incremento increment
+ incremente
incrementnumber: verhoognummer incrementnumber
nummererhoehen zvysujicicislo
incrementanumero numarincrement
-resetnumber: resetnummer resetnumber
- resetnumber resetnumber
- resetnumber resetnumber
+ incrementenumero
+ resetnumber: resetnummer resetnumber
+ resetnumber resetnumber
+ resetnumber resetnumber
+ raznumero
reference: verwijzing reference
referenz odkaz
riferimento referinta
+ reference
unknownreference: onbekendeverwijzing unknownreference
unbekantereferenz neznamyodkaz
riferimentoingoto referintanecunoscuta
+ referenceinconnue
footer: voet footer
fusszeile upati
piedipagina subsol
+ pdp
footerdistance: voetafstand footerdistance
fusszeilenabstand vzdalenostupati
distanzapdp distantasubsol
+ dsitancepdp
footerstate: voetstatus footerstate
fusszeilenstatus statusupati
statopdp staresubsol
+ etatpdp
voffset: voffset voffset
voffset voffset
voffset voffset
+ voffset
next: volgende next
folgende dalsi
successivo urmatorul
+ suivant
before: voor before
vor pred
prima inainte
+ avant
commandbefore: voorcommando commandbefore
vorbefehl predchoziprikaz
comandoprima comandainainte
+ commandeavant
previous: vorige previous
vorige predchozi
precedente precendent
+ precedent
previousnumber: vorigenummer previousnumber
vorigenummer predchozicislo
numeroprecedente numarprecedent
+ numeroprecedent
delay: wachttijd delay
wartezeit prodleva
attesa intarziere
+ delai
way: wijze way
art zpusob
modo mod
+ mode
random: willekeur random
zufaellig nahodne
casuale aleator
+ aleatoire
white: wit white
weiss bily
bianco alb
+ blanc
xfactor: xfactor xfactor
xfaktor xfaktor
- xfactor xfactor %GB
+ xfactor xfactor
+ xfactor
xmax: xmax xmax
xmax xmax
- xmax xmax % GB
+ xmax xmax
+ xmax
xoffset: xoffset xoffset
xoffset xoffset
- xoffset xoffset % GB
+ xoffset xoffset
+ xoffset
xscale: xschaal xscale
xformat xmeritko
- xscale xscala % GB
+ xscale xscala
+ xscale
xstep: xstap xstep
xschritt xkrok
- xstep xstep % GB
+ xstep xstep
+ xstep
yfactor: yfactor yfactor
yfaktor yfaktor
- yfactor yfactor % GB
+ yfactor yfactor
+ yfactor
ymax: ymax ymax
ymax ymax
- ymax ymax % GB
+ ymax ymax
+ ymax
yoffset: yoffset yoffset
yoffset yoffset
- yoffset yoffset % GB
+ yoffset yoffset
+ yoffset
yscale: yschaal yscale
yformat ymeritko
- yscale yscala % GB
+ yscale yscala
+ yscale
ystep: ystap ystep
yschritt ykrok
- ystep ystep % GB
+ ystep ystep
+ ystep
samepage: zelfdepagina samepage
selbeseite stejnastranka
stessapagina aceeasipagina
- sidealign: zijuitlijnen sidealign
- sidealign sidealign
- sidealign sidealign
+ memepage
+ sidealign: zijuitlijnen sidealign
+ sidealign sidealign
+ sidealign sidealign
+ sidealign
side: zij side
objektabstand pocitat
lato parte
-% new
- fieldlayer: veldlaag fieldlayer
- fieldlayer fieldlayer
- fieldlayer fieldlayer
-textlayer: tekstlaag textlayer
- textlayer textlayer
- textlayer textlayer
+ cote
+ fieldlayer: veldlaag fieldlayer
+ fieldlayer fieldlayer
+ fieldlayer fieldlayer
+ calquechamp
+ textlayer: tekstlaag textlayer
+ textlayer textlayer
+ textlayer textlayer
+ calquetexte
fieldbackgroundcolor: veldachtergrondkleur fieldbackgroundcolor
feldhintergrundfarbe barvapozadipole
coloresfondocampo culoarefundalcamp
+ couleurarrierreplanchamp
fieldframecolor: veldkaderkleur fieldframecolor
feldrahmenfarbe barvarameckupole
colorecornicecampo culoareframecamp
+ couleurcadrechamp
fieldoffset: veldoffset fieldoffset
feldoffset offsetpole
offsetcampo offsetcamp
+ offsetchamp
openaction: openactie openaction
oeffenaktion otevriakci
azioneapri actiunedeschidere
+ actionouverture
closeaction: sluitactie closeaction
schliessenaktion zavriakci
azionechiudi actiuneinchidere
+ actionfermeture
openpageaction: openpaginaactie openpageaction
openpageaction akceotevrenistranky
- azioneapripagina actiunedeschiderepagina % TB
+ azioneapripagina actiunedeschiderepagina
+ actionouverturepage
closepageaction: sluitpaginaactie closepageaction
closepageaction akcezavrenistranky
- azionechiudipagina actiuneinchiderepagina % TB
+ azionechiudipagina actiuneinchiderepagina
+ actionfermeturepage
clickin: klikin clickin
klickin klikuvnitr
clickdentro clickintru
+ clicinterieur
clickout: klikuit clickout
klickaus klikvne
clickfuori clickies
+ clicexterieur
regionin: gebiedin regionin
regionin oblastuvnitr
entraregione regiuneintrare
+ entreregion
regionout: gebieduit regionout
regionaus oblastvne
esciregione regiuneiesire
+ regionexterieure
focusin: focusin focusin
focusin focusin
focusin focusin
+ focusin
focusout: focusuit focusout
focusout focusout
focusout focusout
+ focusout
afterkey: natoets afterkey
nachtaste klavesapo
dopotasto dupatasta
+ aprescle
format: formatteer format
formatieren formatovat
- format format % GB
+ format format
+ formatter
validate: valideer validate
validieren validovat
verifica verifica
+ valider
calculate: bereken calculate
berechnen pocitat
calcola calculeaza
+ calculer
click: klik click
klick klik
click click
+ clic
vcommand: vcommando vcommand
vbefehl vprikaz
vcomando comandav
+ vcommande
icommand: icommando icommand
ibefehl iprikaz
icomando comandai
+ icommande
ccommand: ccommando ccommand
cbefehl cprikaz
ccomando comandac
-
+ ccommande
textdistance: tekstafstand textdistance
textdistance textdistance
- distanzatesto textdistance % TB TH
+ distanzatesto textdistance
+ distancetexte
+ numberdistance: nummerafstand numberdistance
+ numberdistance numberdistance
+ numberdistance numberdistance
+ numberdistance
textmargin: tekstmarge textmargin
textmargin textmargin
- textmargin textmargin % TB TH
-
- keyword: trefwoord keyword
- keyword keyword
- parolachiave keyword
+ textmargin textmargin
+ margetexte
+ keyword: trefwoord keyword
+ keyword keyword
+ parolachiave keyword
+ motcle
+
+ deeptextcommand: dieptekstcommando deeptextcommand
+ deeptextcommand deeptextcommand
+ deeptextcommand deeptextcommand
+ deeptextcommand
+ deepnumbercommand: diepnummercommando deepnumbercommand
+ deepnumbercommand deepnumbercommand
+ deepnumbercommand deepnumbercommand
+ deepnumbercommand
\stopconstants
@@ -1517,10 +2007,12 @@ textlayer: tekstlaag textlayer
\startconstants dutch english
german czech
italian romanian
+ french
extras: extras extras
extras extras
extras extras
+ extras
\stopconstants
@@ -1535,863 +2027,1167 @@ textlayer: tekstlaag textlayer
\startvariables dutch english
german czech
italian romanian
+ french
on: aan on
an zap
attivo on
+ actif
+ test: test test
+ test test
+ test test
+ test
serried: aanelkaar serried
kleinerabstand semknuto
vicino serried
+ serried
joinedup: aansluitend joinedup
keinabstand spojeno
unito unit
+ joinedup
absolute: absoluut absolute
absolut absolutni
assoluto absolut
+ absolute
background: achtergrond background
hintergrund pozadi
sfondo fundal
+ arriereplan
backward: achteruit backward
rueckwaerts zpet
indietro inapoi
+ retourarriere
subbackward: subachteruit subbackward
unterrueckwaerts podzpet
sottoindietro subinapoi
+ sousretourarriere
action: actie action
aktion akce
azione actiune
+ action
stopper: afsluiter stopper
trenner predel
stopper stopper
+ stopper
paragraph: alinea paragraph
absatz odstavec
capoverso paragraf
+ paragraphe
all: alles all
alles vse
tutti tot
+ tout
always: altijd always
immer vzdy
sempre totdeauna
+ toujours
auto: auto auto
auto auto
auto auto
+ auto
autointro: autointro autointro
autointro autouvod
autointro autointro
+ autointro
both: beide both
beide obe
entrambi ambele
+ lesdeux
inner: binnen inner
innen uvnitr
interno intern
+ interieur
blank: blanko blank
blanko prazdny
rigovuoto blank
+ vide
disable: blokkeer disable
sperren zablokovat
disattiva dezactivat
+ desactiver
top: boven top
oben vrsek
cima sus
+ sup
wide: breed wide
breit siroce
ampio larg
+ ample
width: breedte width
breite sirka
ampiezza latime
+ largeur
+ minwidth: minbreedte minwidth
+ minbreite minsirka
+ ampiezzamin latimeminima
+ largeurmin
outer: buiten outer
aussen vnejsi
esterno extern
+ exterieur
numbers: cijfers numbers
ziffern cisla
numeri numere
+ numeros
Numbers: Cijfers Numbers
Ziffern Cisla
Numeri Numere
+ Numeros
command: commando command
befehl prikaz
comando comanda
+ commande
commands: commandos commands
befehle prikazy
comandi comenzi
+ commandes
concept: concept concept
konzept koncept
concetto concept
+ concept
day: dag day
tag den
giorno zi
+ jour
date: datum date
datum datum
data data
+ date
default: default default
default implicitni
implicito implicit
+ defaut
final: definitief final
endfassung finalni
finale final
+ final
+ float: blok float
+ gleitobjekt plvouciobjekt
+ oggettomobile obiectmobil
+ flottant
depth: diepte depth
tiefe podlehloubky
profondita adancime
+ profondeur
doublesided: dubbelzijdig doublesided
doppelseitig dvoustranny
doppiafaccia douafete
+ rectoverso
first: eerste first
erste prvni
primo primul
+ premier
each: elk each
jede kazdy
ogni fiecare
+ chaque
singlesided: enkelzijdig singlesided
einzelseitig jednostranne
facciasingola ofata
+ recto
somewhere: ergens somewhere
irgendwo nekde
daqualcheparte undeva
+ qqpart
nowhere: nergens nowhere
nirgens nikde
danessunaparte niciunde
+ nulpart
even: even even
gerade sude
pari par
+ paire
external: extern external
extern externi
esterno extern
+ external
file: file file
datei soubor
file fisier
+ fichier
flexible: flexibel flexible
flexibel prizpusobive
flessibile flexibil
+ flexible
force: forceer force
zwinge sila
forza fortat
+ force
used: gebruikt used
verwende uzito
usato folosit
+ used
none: geen none
kein zadny
nessuno niciunul
+ rien
nomarking: geenmarkering nomarking
keinebeschriftung zadneznaceni
nomarcature faramarcare
+ sansmarquage
nonumber: geennummer nonumber
nonumber nonumber
- nonumber nonumber % GB ETC NEW
+ nonumber nonumber
+ sansnumero
% geentekst: geentekst notext
% notext notext
-% notext notext % GB ETC NEW
+% notext notext
nowhite: geenwit nowhite
keinweiss zadnabila
nobianco faraalb
+ sansblanc
rotated: geroteerd rotated
gedreht otoceno
ruotato rotat
+ tourne
mirrored: gespiegeld mirrored
gespiegelt zrcadleno
riflesso oglindit
+ reflete
global: globaal global
global globalne
globale global
+ global
grid: grid grid
gritter mrizka
griglia grila
+ grille
big: groot big
gross velke
grande mare
+ grand
bigbodyfont: grootkorps bigbodyfont
bigbodyfont bigbodyfont
- grossofontdeltesto bigbodyfont %%
+ grossofontdeltesto bigbodyfont
+ grandepolicecorp
bigpreference: grotevoorkeur bigpreference
grosszuegig vysokapriorita
grandepreferenza preferintamare
+ grandepreference
gray: grijs gray
grau seda
grigio gri
+ gris
halfline: halveregel halfline
halbezeile pulradku
mezzariga jumatatelinie
+ demiligne
keep: handhaaf keep
behalte drzet
mantieni mentine
+ maintient
hanging: hangend hanging
haengend visici
sospeso suspendat
+ suspend
spacing: spatiering spacing
spatiumausgleich mezerovani
spaziatura spatiere
+ espacement
nospacing: geenspatiering nospacing
nospacing nospacing
nospacing nospacing
+ sansespacement
repeat: herhaal repeat
wiederholen opakovat
ripeti repetat
+ repete
fix: herstel fix
stellewiederher fixuj
fisso fix
+ fixe
here: hier here
hier zde
qui aici
+ ici
header: hoofd header
kopfzeile zahlavi
intestazione antet
+ entete
high: hoog high
hoch vysoko
alto inalt
+ haut
height: hoogte height
hoehe vyska
altezza inaltime
+ hauteur
+ minheight: minhoogte minheight
+ minhoehe minvyska
+ altezzamin inaltimeminima
+ hauteurmin
horizontal: horizontaal horizontal
horizontal horizontalne
orizzontale orizontal
+ horizontale
current: huidige current
aktuell aktualni
corrente curent
+ courant
hz: hz hz
hz hz
hz hz
+ hz
nohz: geenhz nohz
nohz nohz
nohz nohz
+ nohz
italic: italic italic
italic kurziva
corsivo italic
+ italique
inherit: erf inherit
inherit inherit
- inherit inherit % new
+ inherit inherit
+ herite
inleft: inlinker inleft
imlinken vlevo
insinistra instanga
+ dansgauche
inmargin: inmarge inmargin
imrand naokraji
inmargine inmargine
+ dansmarge
inright: inrechter inright
imrechten vpravo
indestra indreapta
+ dansdroit
interaction: interactie interaction
interaktion interakce
interazione interactiune
+ interaction
intext: intekst intext
imtext dotextu
intesto intext
+ danstexte
intro: intro intro
intro uvod
intro intro
+ intro
its: its its
its pol
- its propriu % GB
+ its propriu
+ its
yes: ja yes
ja ano
si da
+ oui
year: jaar year
jahr rok
anno an
+ annee
frame: kader frame
rahmen ramecek
cornice incadrat
+ cadre
marginedge: kantlijn marginedge
marginalkante textovahrana
bordomargine marginebordura
+ bordmarge
cap: kap cap
kap kap
cap cap
+ cap
capital: kapitaal capital
versalien kapitalky
maiuscolo majuscula
+ capitale
referral: kenmerk referral
merkmal znacka
referral referinta
+ referral
small: klein small
klein male
piccolo mic
+ petit
smallnormal: kleinnormaal smallnormal
kleinnormal malenormalni
piccolonormale micnormal
+ normalpetit
smallslanted: kleinschuin smallslanted
kleingeneigt malesklonene
piccoloinclinato micinclinat
+ inclinepetit
smallslantedbold: kleinschuinvet smallslantedbold
kleingeneigtfett malesklonenetucne
piccoloinclinatograssetto micinclinataldin
+ grasinclinepetit
smallitalic: kleinitalic smallitalic
kleinitalic malekurzivni
piccolocorsivo micitalic
+ italiquepetit
smallitalicbold: kleinitalicvet smallitalicbold
kleinitalicfett malekurzivnitucne
piccolocorsivograssetto micitalicaldin
+ grasitaliquepetit
smalltype: kleintype smalltype
kleintippen maletype
piccolotype mictype
+ petittype
smallbold: kleinvet smallbold
kleinfett maletucne
piccolograssetto micaldin
+ graspetit
smallboldslanted: kleinvetschuin smallboldslanted
kleinfettgeneigt maletucnesklonene
piccolograssettoinclinato micaldininclinat
+ inclinegraspetit
smallbolditalic: kleinvetitalic smallbolditalic
kleinfettitalic maletucnekurzivni
piccolograssettocorsivo micaldininclinat
+ italiquegraspetit
smallbodyfont: kleinkorps smallbodyfont
smallbodyfont smallbodyfont
- piccolofontdelcorpo smallbodyfont %%
+ piccolofontdelcorpo smallbodyfont
+ petitepolicecorps
+ split: splitsen split
+ split split
+ separa split
+ split
toggle: toggle wissel
toggle toggle
toggle toggle
+ toggle
color: kleur color
farbe barevne
colore culoare
+ couleur
column: kolom column
column column
- colonna coloana % TB TH
+ colonna coloana
+ colonne
columns: kolommen columns
spalten sloupce
colonne coloane
+ colonnes
head: kop head
kopf hlavicka
- testa antet % GB
+ testa antet
+ tete
low: laag low
tief nizko
basso jos
+ bas
last: laatste last
letzte posledni
ultimo ultim
+ dernier
label: label label
label popisek
etichetta eticheta
+ etiquette
lohi: laho lohi
hoti nivy
- pedap lohi % TB TH
+ pedap lohi
+ baha
tall: lang tall
lang vysoko
- alto inalt % GB
+ alto inalt
+ long
empty: leeg empty
leer prazdne
vuoto gol
+ vide
Character: Letter Character
Buchstabe Pismeno
Lettera Caracter
+ Caratere
character: letter character
buchstabe pismeno
lettera caracter
+ caractere
Characters: Letters Characters
Buchstaben Pismena
Lettere Caractere
+ Caracteres
characters: letters characters
buchstaben pismena
lettere caractere
+ caracteres
landscape: liggend landscape
querformat nasirku
orizzontale vedere
+ paysage
rule: lijn rule
linie linka
linea rigla
+ regle
list: lijst list
liste seznam
elenco lista
+ liste
leftmargin: linkermarge leftmargin
linkerrand levyokraj
marginesinistro marginestanga
+ margegauche
leftpage: linkerpagina leftpage
linkerseite levastranka
paginasinistra paginastanga
+ pagegauche
leftedge: linkerrand leftedge
linkekante levahrana
bordosinistro bordurastanga
+ bordgauche
left: links left
links vlevo
sinistra stanga
+ gauche
local: lokaal local
lokal lokalne
locale local
+ local
new: nieuw new
neu novy
nuovo nou
+ nouveau
MONTH: MAAND MONTH
MONAT MESIC
MESE LUNA
+ MOIS
month: maand month
monat mesic
mese luna
+ mois
mar: mar mar
mar mar
mar mar
+ mar
+ marking: markering marking
+ beschriftung znaceni
+ marcatura marcaje
+ marquage
margin: marge margin
marginalie marginalie
margine margine
+ marge
max: max max
max max
max max
+ max
min: min min
min min
min min
+ min
mediaeval: mediaeval mediaeval
mittelalterlich stredoveky
medievale medieval
+ medieval
medium: middel medium
mittel stredni
medio mediu
+ moyen
middle: midden middle
mittig nastred
centro centru
+ milieu
after: na after
nach po
dopo dupa
+ apres
name: naam name
name jmeno
nome nume
+ nom
opposite: naast opposite
gegenueber naproti
opposto opus
+ opposition
no: nee no
nein ne
no nu
+ non
negative: negatief negative
negativ negativ
negativo negativ
+ negatif
positive: positief positive
positiv positiv
positivo positiv
+ positif
not: niet not
nicht ne
non nu
+ pas
never: nooit never
nie nikdy
mai niciodata
+ jamais
normal: normaal normal
normal normalni
normale normal
+ normal
number: nummer number
nummer cislo
numero numar
+ numero
offset: offset offset
offset offset
offset offset
+ offset
unknown: onbekend unknown
unbekannt neznamy
ignoto necunoscut
+ inconnu
bottom: onder bottom
unten spodek
fondo subsol
+ inf
odd: oneven odd
ungerade liche
dispari impar
+ impair
packed: opelkaar packed
gepackt zhustene
impaccato impachetat
+ groupe
unpacked: vanelkaar unpacked
ungepackt rozbalene
unpacked despachetat
+ degroupe
makeup: opmaak makeup
umbruch zlom
makeup marcaj
+ makeup
atmargin: opmarge atmargin
amrand naokraji
almargine lamargine
+ alamarge
overlay: overlay overlay
overlay prekryv
sovrapponi overlay
+ revetement
page: pagina page
seite stranka
pagina pagina
+ page
pagenumber: paginanummer pagenumber
seitennummer cislostranky
numeropagina numarpagina
+ numeropage
paper: papier paper
papier papir
carta foaie
+ papier
display: scherm display
bildschirm obrazovka
- schermo display % new
+ schermo display
+ affichage
reverse: omgekeerd reverse
reverse reverse
- invertito reverse % new
+ invertito reverse
+ inverse
fit: passend fit
passend prizpusobive
adatta ajustat
+ adapte
postscript: postscript postscript
postscript postscript
postscript postscript
+ postscript
preview: preview preview
vorschau nahled
anteprima previzualizare
+ previsualisation
program: programma program
programm program
programma program
-process: proces process
- process process
- process process
- spot: spot spot
- spot spot
- spot spot
+ programme
+ process: proces process
+ process process
+ process process
+ process
+ spot: spot spot
+ spot spot
+ spot spot
+ spot
dot: punt dot
punkt tecka
punto punct
+ point
ran: ran ran
ran rozsah
corse rulat
+ cours
edge: rand edge
kante hrana
bordo bordura
+ bord
screen: raster screen
raster rastr
schermo ecran
+ ecran
rectangular: recht rectangular
rechteckig pravouhly
rettangolare rectangular
+ rectangulaire
rightmargin: rechtermarge rightmargin
rechterrand pravyokraj
marginedestro marginedreapta
+ margedroite
rightpage: rechterpagina rightpage
rechterseite pravastranka
paginadestra paginadreapta
+ pagedroite
rightedge: rechterrand rightedge
rechterkante pravahrana
bordodestro borduradreapta
+ borddroit
right: rechts right
rechts vpravo
destra dreapta
+ droite
line: regel line
zeile radek
riga linie
+ ligne
+ hang: hang hang
+ haengend zaveseni
+ sospendi suspenda
+ suspend
register: register register
register rejstrik
registro registru
+ registre
relative: relatief relative
relativ relativni
relativo relativ
+ relatif
reset: reset reset
zuruecksetzten reset
reimposta reset
+ raz
Romannumerals: Romeins Romannumerals
Roemischezahlen Rimskecislice
Numeriromani Numereromane
+ Chiffresromains
romannumerals: romeins romannumerals
roemischezahlen rimskecislice
numeriromani numereromane
+ chiffresromains
greek: grieks greek
griechisch recky
greco grec
+ grec
Greek: Grieks Greek
Griechisch Recky
Greco Grec
+ Grec
round: rond round
rund zaobleny
rotondo rotund
+ rond
rotate: roteer rotate
drehe otoc
ruota rotit
+ oriente
stretch: rek stretch
strecken natahnout
dilata dilatat
+ etire
backspace: rugwit backspace
rumpfspatium zpetnamezera
- backspace spatiuspate % GB
+ backspace spatiuspate
+ retourarriere
broad: ruim broad
breit siroky
ampio broad
+ large
row: rij row
row row
row rand
+ rang
slanted: schuin slanted
geneigt sklonene
inclinato inclinat
+ incline
slantedbold: schuinvet slantedbold
geneigtfett sklonenetucne
inclinatograssetto inclinataldin
+ grasincline
synchronize: synchroniseer synchronize
synchronize synchronize
synchronize synchronize
+ synchronize
italicbold: italicvet italicbold
italicfett kurzivnitucne
corsivograssetto italicaldin
+ grasitalique
sectionnumber: sectienummer sectionnumber
abschnittsnummer cislooddilu
numerosezione numarsetiune
+ numerosection
narrow: smal narrow
schmall uzky
stretto ingust
+ etroit
cutspace: snijwit cutspace
cutspace cutspace
- cutspace cutspace % GB
+ cutspace cutspace
+ cutspace
tolerant: soepel tolerant
tolerant tolerantni
tollerante tolerant
+ tolerant
space: spatie space
spatium mezera
- spazio spatiu %% check
+ spazio spatiu
+ espace
standard: standaard standard
standard standardni
standard standard
+ standard
start: start start
start start
inizia start
+ demarre
stop: stop stop
stop stop
termina stop
+ stoppe
strict: streng strict
streng striktni
rigido strict
+ strict
strut: strut strut
strut strut
strut strut
+ strut
sub: sub sub
unter pod
sotto sub
+ sous
sym: sym sym
sym sym
sim sym
+ sym
+ txt: txt txt
+ txt txt
+ txt txt
+ txt
symbol: symbool symbol
symbol symbol
simbolo simbol
+ symbole
text: tekst text
text text
testo text
+ texte
back: terug back
zurueck zpet
dietro inapot
+ retour
test: test test
test test
- test text
+ test test
+ test
inbetween: tussen inbetween
zwischen mezi
tra intre
+ entre
type: type type
tippen type
- type type % GB
+ type type
+ type
off: uit off
aus vyp
disattivo dezactivat
+ desactive
url: url url
url url
url url
+ url
URL: URL URL
URL URL
URL URL
+ URL
fixed: vast fixed
fest fixne
fisso fixat
+ fixe
loose: los loose
lose uvolnene
lento larg
+ perte
continue: verder continue
fortsetzten pokracovat
continua continuu
+ continue
vertical: vertikaal vertical
vertikal vertikalne
verticale vertical
+ verticale
bold: vet bold
fett tucne
grassetto aldin
+ gras
boldslanted: vetschuin boldslanted
fettgeneigt tucnesklonene
grassettoinclinato aldininclinat
+ inclinegras
bolditalic: vetitalic bolditalic
fettitalic tucnekurzivni
grassettocorsivo aldinitalic
+ italiquegras
quadruple: viertal quadruple
viertel ctyrnasobny
quadruplo cvadrupul
+ quadruple
footer: voet footer
fusszeile upati
piedipagina subsol
+ pdp
next: volgende next
folgende dalsi
successivo urmatorul
+ prochain
before: voor before
vor pred
prima inainte
+ avant
foreground: voorgrond foreground
vordergrund popredi
foreground primplan
+ premierplan
preference: voorkeur preference
einstellung nastaveni
preferenza preferinta
+ preference
temporary: voorlopig temporary
temporaer docasne
temporaneo temporar
+ temporaire
forward: vooruit forward
vorwaerts vpred
avanti avans
+ avance
subforward: subvooruit subforward
untervorwaerts podvpred
sottoavanti subavans
+ sousavance
previous: vorige previous
vorig predchozi
precedente precedent
+ precedent
value: waarde value
wert hodnota
valore valoare
+ valeur
week: week week
woche tyden
settimana saptamana
+ semaine
weekday: weekdag weekday
wochentag vsedniden
giornosettimana zisaptamana
+ joursemaine
WEEKDAY: WEEKDAG WEEKDAY
WOCHENTAG VSEDNIDEN
GIORNOSETTIMANA ZISAPTAMANA
+ JOURSEMAINE
random: willekeurig random
zufaellig nahodny
casuale aleator
+ aleatoire
white: wit white
weiss bily
bianco alb
+ blanc
very: zeer very
sehr velmi
molto foarte
+ tres
verytolerant: zeersoepel verytolerant
sehrtolerant velmitolerantni
moltotollerante foartetolerant
+ trestolerant
verystrict: zeerstreng verystrict
sehrstreng velmistriktni
- moltorigido foartestrict % GB
+ moltorigido foartestrict
+ tresstrict
see: zie see
sieh viz
vedi vezi
+ voit
smallcaps: smallcaps smallcaps
smallcaps kapitalky
maiuscoletto majusculemici
+ petitescapitales
WORD: WOORD WORD
WORT SLOVO
PAROLA CUVANT
+ MOT
firstpage: eerstepagina firstpage
ersteseite prvnistranka
primapagina primapagina
+ premierepage
firstcolumn: eerstekolom firstcolumn
firstcolumn firstcolumn
firstcolumn firstcolumn
+ premierecolonne
previouspage: vorigepagina previouspage
vorigeseite predchozistranka
paginaprecedente paginaanterioara
+ pageprecedente
nextpage: volgendepagina nextpage
folgendeseite dalsistranka
paginasuccessiva paginaurmatoare
+ pagesuivante
lastpage: laatstepagina lastpage
letzteseite poslednistrana
ultimapagina ultimapagina
+ dernierepage
lastcolumn: laatstekolom lastcolumn
lastcolumn lastcolumn
lastcolumn lastcolumn
+ dernierecolonne
lastpagenumber: laatstepaginanummer lastpagenumber
lastpagenumber lastpagenumber
lastpagenumber lastpagenumber
+ derniernumeropage
subpage: subpagina subpage
unterseite podstranka
sottopagina subpagina
+ souspage
firstsubpage: eerstesubpagina firstsubpage
ersteunterseite prvnipodstranka
primasottopagina primasubpagina
+ premieresouspage
previoussubpage: vorigesubpagina previoussubpage
vorigeunterseite predchozipodstranka
sottopaginaprecedente subpaginaanterioara
+ souspageprecedente
nextsubpage: volgendesubpagina nextsubpage
folgendeunterseite dalsipodstranka
sottopaginasuccessiva urmatoareasubpagina
+ souspagesuivante
lastsubpage: laatstesubpagina lastsubpage
letzteunterseite poslaednipodstranka
ultimasottopagina ultimasubpagina
+ dernieresouspage
nextevenpage: volgendeevenpagina nextevenpage
naechstegeradeseite dalsisudastranka
paginaparisuccessiva paginaparaurmatoarea
+ pagepairesuivante
nextoddpage: volgendeonevenpagina nextoddpage
naechsteungeradeseite dalsilichastranka
paginadisparisuccessiva paginaimparaurmatoarea
+ pageimpairesuivante
previousevenpage: vorigeevenpagina previousevenpage
vorigegeradeseite predchozisudastranka
paginapariprecedente paginaparaprecedenta
+ pagepaireprecedente
previousoddpage: vorigeonevenpagina previousoddpage
vorigeungeradeseite predchozilichastranka
paginadispariprecedente paginaimparaprecedenta
+ pageimpaireprecedente
readonly: alleenleesbaar readonly
nurlesbar pouzeprocteni
solalettura readonly
+ lectureseule
required: verplicht required
obligatorisch pozadovane
richiestp obligatoriu
+ recquis
protected: beschermd protected
geschuetzt chranene
protetto protejat
+ protege
sorted: gesorteerd sorted
sortiert tridene
ordinato sortat
+ trie
unavailable: nietbeschikbaar unavailable
nichtverfuegbar nedostupne
nondisponibile nedisponibil
+ indisponible
hidden: verborgen hidden
versteckt skryte
nascosto ascuns
+ cache
printable: printbaar printable
druckbar tisknutelne
stampabile tiparibil
+ editable
bookmark: bookmark bookmark
bookmark zalozka
segnalibro semncarte
-
- nocheck: geencontrole nocheck
- nocheck nocheck
- nocheck nocheck
-
-% GB TB TH :
-
+ marquepage
+ nocheck: geencontrole nocheck
+ nocheck nocheck
+ nocheck nocheck
+ nonverifie
innermargin: binnenmarge innermargin
innermargin innermargin
margineinterno innermargin
+ margeinterieure
outermargin: buitenmarge outermargin
outermargin outermargin
margineesterno outermargin
+ margeexterieure
inneredge: binnenrand inneredge
inneredge inneredge
bordointerno inneredge
+ bordinterieur
outeredge: buitenrand outeredge
outeredge outeredge
bordoesterno outeredge
-
+ bordexterieur
controls: sturing controls
controls controls
controlli controale
+ controles
nothanging: niethangend nothanging
nothanging nothanging
nonsospeso nothanging
+ nonsuspendu
hyphenated: afgebroken hyphenated
hyphenate hyphenated
sillabato despsilabe
+ hyphenated
nothyphenated: nietafgebroken nothyphenated
nothyphenated nothyphenated
nonsillabato nedespsilabe
-
+ nothyphenated
overprint: overprint overprint
overprint overprint
- overprint overprint % new
+ overprint overprint
+ overprint
knockout: knockout knockout
knockout knockout
- knockout knockout % new
-
+ knockout knockout
+ knockout
xml: xml xml
xml xml
xml xml
-
+ xml
enumeration: doornummering enumeration
nummerierung vycet
enumerazione enumerare
+ enumeration
description: doordefinitie description
beschreibung popis
descrizione descriere
+ description
\stopvariables
\startconstants dutch english
german czech
italian romanian
+ french
controls: sturing controls
controls controls
controlli controale
+ controles
global: globaal global
global globalne
globale global
-
+ global
overprint: overprint overprint
overprint overprint
- overprint overprint % new
+ overprint overprint
+ overprint
\stopconstants
@@ -2407,13 +3203,16 @@ process: proces process
\startvariables dutch english
german czech
italian romanian
+ french
conversion: conversie conversion
konversion konverze
coversione conversie
+ conversion
by: per by
pro skrz
da de
+ par
\stopvariables
@@ -2439,6 +3238,7 @@ process: proces process
vfil: vfil
hfil: hfil
strut: strut
+ autostrut: autostrut
reset: reset
set: set
escape: escape
@@ -2456,40 +3256,52 @@ process: proces process
\startvariables dutch english
german czech
italian romanian
+ french
calligraphic: calligrafie calligraphic
kalligraphie kaligraficke
calligrafico caligrafic
+ calligraphique
handwritten: handschrift handwritten
handschrift rukopisne
grafiamanuale scrismanual
+ manuscript
sansserif: schreefloos sansserif
grotesk bezserifu
- sansserif sansserif % GB
+ sansserif sansserif
+ sansserif
roman: romaan roman
antiqua antikva
- roman roman % GB
+ roman roman
+ roman
teletype: teletype teletype
fernschreiber strojopis
- teletype teletype % GB
+ teletype teletype
+ teletype
type: type type
tippen opis
- type type % GB
+ type type
+ type
serif: serif serif
serif serif
- serif serif % GB
+ serif serif
+ serif
regular: regular regular
regular pravidelne
regolare regular
+ regulier
support: support support
support podpora
supporto suport
+ support
sans: sans sans
sans sans
sans sans
+ sans
mono: mono mono
mono mono
mono mono
+ mono
\stopvariables
@@ -2506,76 +3318,101 @@ process: proces process
\startsetupvariables dutch english
german czech
italian romanian
+ french
enumeration: doornummering enumeration
nummerierung vycet
enumerazione enumerare
+ enumeration
description: doordefinitie description
beschreibung popis
descrizione descriere
+ description
indentation: doorsprong indentation
einzug odsazovani
rientro indentare
+ indentation
labeling: doorlabel labeling
beschriften oznacovani
etichettatura etichetare
+ etiquettage
combinedlist: samengesteldelijst combinedlist
kombiniereliste kombinovanyseznam
elencocombinato listacombinata
+ listeimbriquee
+ % beware: section clashes with sectionlevel
section: sectie section
abschnitt oddil
sezione sectiune
+ section
register: register register
register rejstrik
registro registru
+ registre
interaction: interactie interaction
interaktion interakce
interazione interactiune
+ interaction
synonym: synoniem synonym
synonym synonymum
sinonimo sinonim
+ synonyme
synonyms: synoniemen synonyms
synonyme synonyma
sinonimi sinonime
+ synonymes
sort: sorteer sort
sortiere trid
- sort sortare % GB
+ sort sortare
+ tri
sorts: sorteren sorts
sortieren tridit
- sorts sortari % GB
+ sorts sortari
+ tris
name: naam name
name jmeno
nome nume
+ name
float: blok float
gleitobjekt plvouciobjekt
oggettomobile obiectmobil
+ flottant
floats: blokken floats
gleitobjekte plvouciobjekty
oggettimobili obiectemobile
+ flottants
paragraph: alinea paragraph
absatz odstavec
capoverso paragraf
+ paragraphe
framedtext: kadertekst framedtext
umrahmtertext oramovanytext
testoincorniciato textinconjurat
+ texteencadre
itemgroup: itemgroup itemgroup
itemgroup itemgroup
itemgroup itemgroup
+ itemgroup
typing: typen typing
tippen typing
- typing typing % GB
+ typing typing
+ typing
buffer: buffer buffer
puffer buffer
buffer buffer
+ buffer
formula: formule formula
formel rovnice
formula formula
+ formule
subformula: subformule subformula
unterformel podrovnice
sottoformula subformula
+ sousformule
tabulate: tabulatie tabulate
tabulator tabelator
tabulato tabulate
+ tabule
\stopsetupvariables
@@ -2590,85 +3427,112 @@ process: proces process
\startelements dutch english
german czech
italian romanian
+ french
begin: beginvan begin
anfang zacatek
inizio inceput
+ debut
end: eindvan end
ende konec
fine sfarsit
+ fin
coupled: gekoppelde coupled
verknuepft propojene
accoppiato cuplat
+ couple
get: haal get
get ziskat
prendi get
+ obtient
currentlocal: huidigelokale currentlocal
aktuelllokal aktualnelokalni
correntelocale localcurent
+ localcourant
endsetup: in -
ein -
- -
+ -
load: laad load
laden nacist
carica incarca
+ charge
emptyone: leeg empty
vuoto leer
prazdne gol
+ vide
emptytwo: lege empty
leer prazdne
vuoti gol
+ vide
list: lijst list
auflisten seznam
elenco lista
+ liste
listof: lijstmet listof
auflistenvon seznam
elencodi listade
+ listede
local: lokale local
lokal lokalne
locale local
+ local
place: plaats place
platziere umisti
metti pune
+ place
reserve: reserveer reserve
reservieren rezervovat
riserva rezervat
+ reserver
start: start start
start start
inizia start
+ demarre
setup: stel setup
stelle nastaveni
imposta setare
+ regle
stop: stop stop
stop stop
termina stop
+ stoppe
increment: verhoog increment
erhoehen zvysit
incrementa increment
+ incremente
next: volgende next
folgende dalsi
successivo urmatorul
+ suivant
complete: volledige complete
vollende uplny
completo complet
+ complete
previous: vorige previous
vorige predchozi
precedente precedent
+ precedent
previouslocal: vorigelokale previouslocal
voriglokal predchozilokalni
precedentelocale precedentlocal
+ localprecedent
see: zie see
sieh viz
vedi vezi
+ voit
type: type type
type opis
- type type % GB
+ type type
+ type
makeup: opmaak makeup
umbruch zlom
- makeup makeup % GB
+ makeup makeup
+ makeup
text: tekst text
text text
testo text
+ texte
\stopelements
@@ -2677,64 +3541,84 @@ process: proces process
\startvariables dutch english
german czech
italian romanian
+ french
buffer: buffer buffer
puffer buffer
buffer buffer
+ buffer
linenote: regelnoot linenote
linenote linenote
linenote linenote
+ noteligne
comment: commentaar comment
kommentar komentar
commento comentariu
+ commentaire
interactionmenu: interactiemenu interactionmenu
interaktionsmenue interaktivnimenu
menuinterattivo meniuinteractiune
+ menuinteraction
postponing: uitstellen postponing
verschieben odlozit
- posporre postponing % GB
+ posporre postponing
+ postponing
hiding: verbergen hiding
verbergen skryt
nascondere ascundere
+ cache
tabulate: tabulatie tabulate
tabulator tabelator
tabulato tabulate
+ tabule
tabulatehead: tabulatiekop tabulatehead
tabulatehead tabulatehead
- testatabulato tabulatehead %
+ testatabulato tabulatehead
+ tetetabule
tabulatetail: tabulatiestaart tabulatetail
tabulatetail tabulatetail
- codatabulato tabulatetail %
+ codatabulato tabulatetail
+ queuetabule
fact: gegeven fact
gegeben fakt
fatto fapt
+ fait
legend: legenda legend
legende legenda
legenda legenda
+ legende
formula: formule formula
formel rovnice
formula formula
+ formule
tablehead: tabelkop tablehead
tabellenueberschrift zahlavitabulky
testatabella antettabel
+ tetetableau
tabletail: tabelstaart tabletail
tabellenende konectabulky
codatabella subsoltabel
+ queuetableau
setups: instellingen setups
impostazioni einstellungen
nastaveni setari
+ reglages
helptext: helptekst helptext
hilfetext textnapovedy
testoaiuto textajutator
+ texteaide
localenvironment: deelomgeving localenvironment
lokaleumgebung lokalnihoprostredi
ambientelocale mediulocal
+ environementlocal
sectionblockenvironment: sectieblokomgeving sectionblockenvironment
sectionblockenvironment sectionblockenvironment
- ambientebloccosezione blocsectiuneambient % TB TH
+ ambientebloccosezione blocsectiuneambient
+ environementblocsection
pagecomment: paginacommentaar pagecomment
pagecomment komentarstranky
- commentopagina comentariupagina % TB
+ commentopagina comentariupagina
+ commentairepage
\stopvariables
@@ -2749,141 +3633,176 @@ process: proces process
\startvariables dutch english
german czech
italian romanian
+ french
FirstPage: EerstePagina FirstPage
ErsteSeite PrvniStrana
PrimaPagina PrimaPagina
+ PremierePage
PreviousPage: VorigePagina PreviousPage
VorigeSeite PredchoziStrana
PaginaPrecedente PaginaPrecedenta
+ PagePrecedente
NextPage: VolgendePagina NextPage
FolgendeSeite DalsiStrana
PaginaSuccessiva PaginaUrmatoare
+ PageSuivante
LastPage: LaatstePagina LastPage
LetzteSeite PosledniStrana
UltimaPagina UltimaPagina
+ DernierePage
PreviousJump: VorigeSprong PreviousJump
VorigerSprung PredchoziSkok
SaltoPrecedente SaltPrecedent
+ SautPrecedent
NextJump: VolgendeSprong NextJump
NaechsterSprung NasledujiciSkok
SaltoSuccessivo SaltUrmator
+ SautSuivant
ToggleViewer: WisselViewer ToggleViewer
WechseleViewer ZmenitProhlizec
ScambiaVisualizzatore SchimbaVizualizator
+ ChangeVisualisateur
ExitViewer: VerlaatViewer ExitViewer
BeendeViewer UkoncitProhlizec
EsciVisualizzatore IesireVizualizator
+ SortVisualisateur
CloseDocument: SluitDocument CloseDocument
SchliesseDokument ZavritDokument
ChiudiDocumento InchideDocument
+ FermeDocument
SaveDocument: BewaarDocument SaveDocument
SpeichereDokument UlozitDokument
SalvaDocumento SalvareDocument
+ SauvegardeDocument
SaveNamedDocument: BewaarDocumentOpNaam SaveNamedDocument
SaveNamedDocument SaveNamedDocument
SaveNamedDocument SaveNamedDocument
+ SauvegardeDocumentNomme
OpenNamedDocument: OpenDocumentOpNaam OpenNamedDocument
OpenNamedDocument OpenNamedDocument
OpenNamedDocument OpenNamedDocument
+ OuvreDocumentNomme
ViewerHelp: ViewerHelp ViewerHelp
ViewerHilfe NapovedaProhlizece
AiutoVisualizzatore AjutorVizualizator
+ AideVisualisateur
PrintDocument: PrintDocument PrintDocument
DruckeDokument VytisknoutDokument
StampaDocumento TiparesteDocument
+ ImprimeDocument
SearchDocument: DoorzoekDocument SearchDocument
DokumentDurchsuchen ProhledatDokument
CercaDocumento CautaDocument
+ RechercheDocument
SearchAgain: HerhaalZoeken SearchAgain
WeiterSuchen HledatZnovu
CercaAncora CautaDinNou
+ RechercheSuivant
Query: RaadpleegDocument Query
Query Query
- Richiesta Query % TB TH GB
+ Richiesta Query
+ Query
QueryAgain: HerhaalRaadplegen QueryAgain
QueryAgain QueryAgain
- RinnovaRichiesta QueryAgain % TB TH GB
+ RinnovaRichiesta QueryAgain
+ QueryAgain
GotoPage: GaNaarPagina GotoPage
GotoPage JdiNaStranku
- VaiAPagina LaPagina % TB
+ VaiAPagina LaPagina
+ VaalaPage
StartMovie: StartFilm StartMovie
StartFilm SpustitFilm
IniziaFilm StartFilm
+ DemarreFilm
StopMovie: StopFilm StopMovie
StopFilm ZastavitFilm
FermaFilm StopFilm
+ StoppeFilm
PauseMovie: PauzeerFilm PauseMovie
PauseFilm PozastavitFilm
PausaFilm PauzaFilm
+ PauseFilm
ResumeMovie: HervatFilm ResumeMovie
FortsetzenFilm PokracovatFilm
RiprendiFilm RepornesteFilm
+ ReprendFilm
StartSound: StartGeluid StartSound
StartSound StartZvuk
- IniziaSuono StartSunet % TB
+ IniziaSuono StartSunet
+ DemarreSon
StopSound: StopGeluid StopSound
StopSound StopZvuk
- FermaSuono StopSunet % TB
+ FermaSuono StopSunet
+ StoppeSon
PauseSound: PauzeerGeluid PauseSound
PauseSound PozastavitZvuk
- PausaSuono PauzaSunet % TB
+ PausaSuono PauzaSunet
+ PauseSon
ResumeSound: HervatGeluid ResumeSound
ResumeSound PokracovatZvuk
- RiprendiSuono RepornesteSunet % TB
-
-% new
-
+ RiprendiSuono RepornesteSunet
+ ReprendSon
StartRendering: StartRendering StartRendering
StartRendering StartRendering
StartRendering StartRendering
+ StartRendering
StopRendering: StopRendering StopRendering
StopRendering StopRendering
StopRendering StopRendering
+ StopRendering
PauseRendering: PauzeerRendering PauseRendering
PauseRendering PauseRendering
PauseRendering PauseRendering
+ PauseRendering
ResumeRendering: HervatRendering ResumeRendering
ResumeRendering ResumeRendering
ResumeRendering ResumeRendering
-
-% new
-
+ ResumeRendering
SaveForm: BewaarFormulier SaveForm
SpeicheFormular UlozitFormular
SalvaForm SalveazaFormular
+ SauvegardeForm
LoadForm: LaadFormulier LoadForm
LadeFormular NacistFormular
CaricaForm IncarcaFormular
+ ChargeForm
ResetForm: ResetFormulier ResetForm
ZuruecksetzenFormular ResetFormulare
ReimpostaForm ResetareFormular
+ RazForm
SubmitForm: VerzendFormulier SubmitForm
VersendeFormular PoslatFormular
MandaForm TrimiteFormular
+ SoumettreForm
HideField: VerbergVeld HideField
VerbergeFeld SkryjPole
NascondiCampo AscundeCamp
+ CacheChamp
ShowField: ToonVeld ShowField
ZeigeFeld UkazPole
MostraCampo AfiseazaCamp
-
+ MontreChamp
FitWidth: BreedtePassend FitWidth
BreitePassend FitWidth
FitWidth AjustatLatime
+ AjusteLargeur
FitHeight: HoogtePassend FitHeight
HoehePassend FitHeight
FitHeight AjustatInaltime
-
- HideLayer: VerbergLaag HideLayer
- HideLayer HideLayer
- HideLayer HideLayer
- VideLayer: ToonLaag VideLayer
- VideLayer VideLayer
- VideLayer VideLayer
-ToggleLayer: WisselLaag ToggleLayer
- ToggleLayer ToggleLayer
- ToggleLayer ToggleLayer
+ AjusteHauteur
+ HideLayer: VerbergLaag HideLayer
+ HideLayer HideLayer
+ HideLayer HideLayer
+ CacheCalque
+ VideLayer: ToonLaag VideLayer
+ VideLayer VideLayer
+ VideLayer VideLayer
+ VideLayer
+ ToggleLayer: WisselLaag ToggleLayer
+ ToggleLayer ToggleLayer
+ ToggleLayer ToggleLayer
+ ToggleLayer
\stopvariables
@@ -2893,25 +3812,32 @@ ToggleLayer: WisselLaag ToggleLayer
\startvariables dutch english
german czech
italian romanian
+ french
New: Nieuw New
Neu Novy
Nuovo Nou
+ Nouveau
Balloon: Ballon Balloon
Ballon Bublinka
Pallone Balon
+ Ballon
Addition: Toevoeging Addition
Zusatz Pridavek
Aggiunta Adaugare
+ Ajout
Help: Help Help
Hilfe Napoveda
Aiuto Ajutor
+ Aide
Paragraph: Paragraaf Paragraph
Absatz Odstavec
Capoverso Paragraf
+ Paragraphe
Key: Sleutel Key
Schluessel Klavesa
Tasto Cheie
+ Cle
\stopvariables
%D \stopcompressdefinitions
@@ -2942,8 +3868,6 @@ ToggleLayer: WisselLaag ToggleLayer
\stopvariables
-%D \stopcompressdefinitions
-
\stoplogginginterface
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mult-ini.tex b/Master/texmf-dist/tex/context/base/mult-ini.tex
index abc01562a56..69ef0a6ac10 100644
--- a/Master/texmf-dist/tex/context/base/mult-ini.tex
+++ b/Master/texmf-dist/tex/context/base/mult-ini.tex
@@ -17,15 +17,22 @@
%D supported:
%D
%D \starttabulate[|l|l|c|c|]
-%D \NC\bf language\NC\bf translator \NC\bf messages\NC\bf interface\NC\NR
-%D \NC dutch \NC Hans Hagen \NC yes \NC yes \NC\NR
-%D \NC english \NC Hans Hagen \NC yes \NC yes \NC\NR
-%D \NC german \NC Tobias Burnus \NC yes \NC yes \NC\NR
-%D \NC czech \NC Tom Hudec \NC yes \NC yes \NC\NR
-%D \NC italian \NC Giuseppe Bilotta \NC yes \NC yes \NC\NR
-%D \NC norwegian \NC Hans Fredrik Nordhaug\NC yes \NC no \NC\NR
+%D \NC\bf language\NC\bf translator \NC\bf messages\NC \bf interface\NC\NR
+%D \NC dutch \NC Hans Hagen \NC yes \NC yes \NC\NR
+%D \NC english \NC Hans Hagen \& SPQR \NC yes \NC yes \NC\NR
+%D \NC german \NC Tobias Burnus \NC yes \NC yes \NC\NR
+%D \NC czech \NC Tom Hudec \NC yes \NC yes \NC\NR
+%D \NC italian \NC Giuseppe Bilotta \NC yes \NC yes \NC\NR
+%D \NC french \NC Renaud Aubin \NC yes \NC yes \NC\NR
+%D \NC romanian \NC .... \NC yes \NC yes \NC\NR
+%D \NC norwegian \NC Hans Fredrik Nordhaug \NC yes \NC no \NC\NR
%D \stoptabulate
+%D to be translated:
+%D
+%D message : floatblocks/13
+%D variables : sorttype compress autohang
+
\writestatus{loading}{Context Multilingual Macros / Initialization}
\unprotect
@@ -842,14 +849,10 @@
{\let\c!internal!\c!internal!n
\ifcsname\k!prefix!#3\endcsname
\let\c!internal!\c!internal!y
- % \@EAEAEA\def\@EA\@EA
- % \csname#1\csname\k!prefix!#3\endcsname
- % \endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
\@EA\def\csname#1\csname\k!prefix!#3\endcsname
\@EA\endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
\else
\let\c!internal!\c!internal!y
- %\@EAEAEA\def\@EA\@EA\csname#1#3\endcsname\@EA{\csname#2#3\endcsname}%
\@EA\def\csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}%
\fi}
@@ -1541,7 +1544,7 @@
\def\contextversion{unknown}
\def\contextversionnumber{0}
\else
- \def\contextversionnumber#1.#2.#3\relax{#1\ifnum#2<10 0\fi#2\ifnum#3<10 0\fi#3}
+ \def\contextversionnumber#1.#2.#3 #4:#5\relax{#1\ifnum#2<10 0\fi#2\ifnum#3<10 0\fi#3 #4:#5}
\edef\contextversionnumber{\expandafter\contextversionnumber\contextversion\relax}
\fi
diff --git a/Master/texmf-dist/tex/context/base/mult-sys.tex b/Master/texmf-dist/tex/context/base/mult-sys.tex
index 5a398b25df3..716c6d6bfdd 100644
--- a/Master/texmf-dist/tex/context/base/mult-sys.tex
+++ b/Master/texmf-dist/tex/context/base/mult-sys.tex
@@ -32,36 +32,37 @@
%D First we define some system constants used for both the
%D multi||lingual interface and multi||linguag typesetting.
-\definesystemconstant {afrikaans} \definesystemconstant {af}
-\definesystemconstant {catalan} \definesystemconstant {ca}
-\definesystemconstant {chinese} \definesystemconstant {cn}
-\definesystemconstant {croation} \definesystemconstant {hr}
-\definesystemconstant {czech} \definesystemconstant {cz}
-\definesystemconstant {danish} \definesystemconstant {da}
-\definesystemconstant {dutch} \definesystemconstant {nl}
-\definesystemconstant {english} \definesystemconstant {en}
-\definesystemconstant {finish} \definesystemconstant {fi}
-\definesystemconstant {french} \definesystemconstant {fr}
-\definesystemconstant {german} \definesystemconstant {de}
-\definesystemconstant {hungarian} \definesystemconstant {hu}
-\definesystemconstant {italian} \definesystemconstant {it}
-\definesystemconstant {latin} \definesystemconstant {la}
-\definesystemconstant {norwegian} \definesystemconstant {no}
-\definesystemconstant {polish} \definesystemconstant {pl}
-\definesystemconstant {portuguese} \definesystemconstant {pt}
-\definesystemconstant {romanian} \definesystemconstant {ro}
-\definesystemconstant {russian} \definesystemconstant {ru}
-\definesystemconstant {slovak} \definesystemconstant {sk}
-\definesystemconstant {slovenian} \definesystemconstant {sl}
+\definesystemconstant {afrikaans} \definesystemconstant {af}
+\definesystemconstant {catalan} \definesystemconstant {ca}
+\definesystemconstant {chinese} \definesystemconstant {cn}
+\definesystemconstant {croation} \definesystemconstant {hr}
+\definesystemconstant {czech} \definesystemconstant {cz}
+\definesystemconstant {danish} \definesystemconstant {da}
+\definesystemconstant {dutch} \definesystemconstant {nl}
+\definesystemconstant {english} \definesystemconstant {en}
+\definesystemconstant {finish} \definesystemconstant {fi}
+\definesystemconstant {french} \definesystemconstant {fr}
+\definesystemconstant {german} \definesystemconstant {de}
+\definesystemconstant {hungarian} \definesystemconstant {hu}
+\definesystemconstant {italian} \definesystemconstant {it}
+\definesystemconstant {latin} \definesystemconstant {la}
+\definesystemconstant {norwegian} \definesystemconstant {no}
+\definesystemconstant {polish} \definesystemconstant {pl}
+\definesystemconstant {portuguese} \definesystemconstant {pt}
+\definesystemconstant {romanian} \definesystemconstant {ro}
+\definesystemconstant {russian} \definesystemconstant {ru}
+\definesystemconstant {slovak} \definesystemconstant {sk}
+\definesystemconstant {slovenian} \definesystemconstant {sl}
\definesystemconstant {slovene}
-\definesystemconstant {spanish} \definesystemconstant {es}
-\definesystemconstant {swedish} \definesystemconstant {sv}
-\definesystemconstant {turkish} \definesystemconstant {tr}
-\definesystemconstant {ukenglish} \definesystemconstant {uk}
-\definesystemconstant {ukrainian} \definesystemconstant {ua}
-\definesystemconstant {usenglish} \definesystemconstant {us}
-\definesystemconstant {greek} \definesystemconstant {gr}
-\definesystemconstant {vietnamese} \definesystemconstant {vn}
+\definesystemconstant {spanish} \definesystemconstant {es}
+\definesystemconstant {swedish} \definesystemconstant {sv}
+\definesystemconstant {turkish} \definesystemconstant {tr}
+\definesystemconstant {ukenglish} \definesystemconstant {uk}
+\definesystemconstant {ukrainian} \definesystemconstant {ua}
+\definesystemconstant {usenglish} \definesystemconstant {us}
+\definesystemconstant {greek} \definesystemconstant {gr}
+\definesystemconstant {ancientgreek} \definesystemconstant {agr}
+\definesystemconstant {vietnamese} \definesystemconstant {vn}
%D For proper \UNICODE\ support we need a few font related
%D constants.
@@ -81,6 +82,8 @@
\definesystemconstant {Normal}
\definesystemconstant {Caps}
+\definesystemconstant {mnem} % kind of generic short tag
+
%D As the name of their define command states, the next set of
%D constants is used in the message macro's.
@@ -105,6 +108,7 @@
\definemessageconstant {verbatims}
\definemessageconstant {versions}
+
%D The word \type{height} takes 6~token memory cells. The
%D control sequence \type{\height} on the other hand uses only
%D one. Knowing this, we can improve the performance of \TEX,
@@ -165,6 +169,8 @@
\definesystemconstant {font}
+\definesystemconstant {section} \let\v!sectionlevel\s!section % for old times sake
+
%D A more experienced \TEX\ user will recognize the next four
%D constants. We need these because font-definitions are
%D partially english.
@@ -401,6 +407,7 @@
\definesystemvariable {bl} % BLanko
\definesystemvariable {bg} % BleedinG
\definesystemvariable {bo} % BlankO (definitions)
+\definesystemvariable {br} % sideBaR
\definesystemvariable {bs} % SelecteerBlokken
\definesystemvariable {bt} % BuTton
\definesystemvariable {bu} % BUffer
@@ -408,6 +415,7 @@
\definesystemvariable {by} % Per
\definesystemvariable {cb} % CollectBox
\definesystemvariable {cc} % Comment
+\definesystemvariable {ce} % CasEs
\definesystemvariable {ci} % CItaat
\definesystemvariable {cl} % kleur (CoLor setup)
\definesystemvariable {cn} % CollumN
@@ -431,6 +439,7 @@
\definesystemvariable {ec} % EnCoding
\definesystemvariable {en} % ENvironments
\definesystemvariable {ep} % ExternfiguurPreset
+\definesystemvariable {eq} % EQalign
\definesystemvariable {er} % external resources
\definesystemvariable {ex} % ExterneFiguren
\definesystemvariable {ht} % HiddenText
@@ -479,6 +488,7 @@
\definesystemvariable {lb} % LaBels
\definesystemvariable {ld} % LegenDa
\definesystemvariable {le} % LinetablE
+\definesystemvariable {lf} % LocalFigures
\definesystemvariable {lg} % taal (LanGuage)
\definesystemvariable {li} % LIjst
\definesystemvariable {ll} % Layers
@@ -489,11 +499,13 @@
\definesystemvariable {ly} % LaYout
\definesystemvariable {ma} % MargeAchtergrond
\definesystemvariable {mb} % MargeBlokken
+\definesystemvariable {md} % MoDule
\definesystemvariable {mg} % Metapost paGe
\definesystemvariable {mk} % MarKering
\definesystemvariable {mt} % inline MaTh
\definesystemvariable {mo} % Math Options
\definesystemvariable {nm} % Nummering
+\definesystemvariable {mx} % MatriX
\definesystemvariable {np} % NaastPlaatsen
\definesystemvariable {nr} % Nummeren
\definesystemvariable {of} % OFfset
@@ -552,6 +564,7 @@
\definesystemvariable {st} % STickers
\definesystemvariable {su} % SetUp
\definesystemvariable {sv} % SysteemVariabelen
+\definesystemvariable {sx} % Selector
\definesystemvariable {sy} % SYnchronisatie
\definesystemvariable {ta} % TAb
\definesystemvariable {tb} % TekstBlokken
@@ -826,6 +839,13 @@
3: -- -- inlocuieste un macro, folositi MAJUSCULE!
\stopmessages
+\startmessages french library: check
+ title: vérification
+ 1: manquant ou dégroupé '=' après '--' à la ligne --
+ 2: -- argument(s) attendu(s) à la ligne --
+ 3: -- -- remplace une macro, utilisez des MAJUSCULES !
+\stopmessages
+
\fi
%D Ok, here are some more, because we've got ouselves some
diff --git a/Master/texmf-dist/tex/context/base/page-app.tex b/Master/texmf-dist/tex/context/base/page-app.tex
index 6a9a10d33dd..f31e3ad2da1 100644
--- a/Master/texmf-dist/tex/context/base/page-app.tex
+++ b/Master/texmf-dist/tex/context/base/page-app.tex
@@ -155,8 +155,10 @@
\else % pdf
\executesystemcommand{dvips \bufferprefix\@@texapp}%
\executesystemcommand{ps2pdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}%
+% \executesystemcommand{texmfstart pstopdf \bufferprefix\@@texapp.ps \bufferprefix\@@texapp.pdf}%
\fi
\restoreTEXapplication % dimensions
+ \doifelse\jobsuffix{dvi}\donetrue\donefalse
\setbox\scratchbox\hbox
{\expanded{\externalfigure
[\bufferprefix\@@texapp.\ifdone eps\else pdf\fi]
diff --git a/Master/texmf-dist/tex/context/base/page-bck.tex b/Master/texmf-dist/tex/context/base/page-bck.tex
index e95ab8bf6ca..2054be5fb0d 100644
--- a/Master/texmf-dist/tex/context/base/page-bck.tex
+++ b/Master/texmf-dist/tex/context/base/page-bck.tex
@@ -43,6 +43,10 @@
8: se calculeaza fundalurile
\stopmessages
+\startmessages french library: layouts
+ 8: calcul des arrières-plans
+\stopmessages
+
%D \macros
%D {recalculatebackgrounds}
%D
@@ -221,7 +225,7 @@
% \def\setbackgroundboxes
% {\showmessage\m!layouts8\empty
% \setbackgroundbox\leftbackground\relax
-% \ifdubbelzijdig
+% \ifdoublesided
% \setbackgroundbox\rightbackground\doswapmargins
% \fi
% \doifnot\@@mastatus\v!herhaal{\global\newbackgroundfalse}}
@@ -520,7 +524,7 @@
\setupbackgrounds
[\v!paper,\v!page,\v!leftpage,\v!rightpage]
[\c!frame=\v!off,
- \c!radius=.5\korpsgrootte,
+ \c!radius=.5\bodyfontsize,
\c!corner=\v!rectangular,
\c!background=,
\c!screen=\@@rsscreen,
@@ -586,19 +590,35 @@
\resetglobal \expandafter\gobbleoneargument
\fi}
+% \def\doaddlocalbackground#1%
+% {\edef\next
+% {\noexpand\redoglobal\wd#1\the\wd#1%
+% \noexpand\redoglobal\ht#1\the\ht#1%
+% \noexpand\dodoglobal\dp#1\the\dp#1}%
+% \dodoglobal\setbox#1\hbox
+% {\fastlocalframed
+% [\??ma\v!local]
+% [\c!component=local,\c!frame=\v!off,\c!offset=\v!overlay,\c!setups=,%
+% \c!width=\wd#1,\c!height=\ht#1,% no \c!depth=\dp#1 in cont-exp.tex, to be checked !
+% \c!background=\localbackground]%
+% {\registerMPlocaltextarea{\box#1}}}%
+% \next
+% \doglobal\increment\localpositionnumber\relax} % afterwards !
+
\def\doaddlocalbackground#1%
{\edef\next
{\noexpand\redoglobal\wd#1\the\wd#1%
\noexpand\redoglobal\ht#1\the\ht#1%
- \noexpand\dodoglobal\dp#1\the\dp#1}%
- \dodoglobal\setbox#1\hbox
+ \noexpand\redoglobal\dp#1\the\dp#1}%
+ \redoglobal\setbox#1\hbox
{\fastlocalframed
[\??ma\v!local]
[\c!component=local,\c!frame=\v!off,\c!offset=\v!overlay,\c!setups=,%
- \c!width=\wd#1,hoogte=\ht#1,% no diepte=\dp#1 in cont-exp.tex, to be checked !
+ \c!width=\wd#1,\c!height=\ht#1,% no \c!depth=\dp#1 in cont-exp.tex, to be checked !
\c!background=\localbackground]%
{\registerMPlocaltextarea{\box#1}}}%
\next
+ \resetglobal
\doglobal\increment\localpositionnumber\relax} % afterwards !
% Test how previous macro behaves with depth:
diff --git a/Master/texmf-dist/tex/context/base/page-flt.tex b/Master/texmf-dist/tex/context/base/page-flt.tex
index 67c8013d3cc..a6c39efec22 100644
--- a/Master/texmf-dist/tex/context/base/page-flt.tex
+++ b/Master/texmf-dist/tex/context/base/page-flt.tex
@@ -13,9 +13,6 @@
\writestatus{loading}{Context OTR Macros / Floating Bodies}
-%D This module is currently a mess, due to splitting float
-%D handlers over specific otr's. Consider it work in progress.
-
%D Some of the sidefloat settings should move to page-sid; now it's quite
%D fuzzy the way the variables are set/reset.
@@ -62,6 +59,7 @@
10: -- begrensd
11: geen blok opgegeven
12: niet gedefinieerd
+ 13: er is niets te splitsen
\stopmessages
\startmessages english library: floatblocks
@@ -78,6 +76,7 @@
10: -- limited
11: no block given
12: undefined
+ 13: there is nothing to split
\stopmessages
\startmessages german library: floatblocks
@@ -94,6 +93,7 @@
10: -- begrenzt
11: kein Block gegeben
12: undefiniert
+ 13: there is nothing to split
\stopmessages
\startmessages czech library: floatblocks
@@ -110,6 +110,7 @@
10: -- omezeno
11: nedan zadny blok
12: nedefinovano
+ 13: there is nothing to split
\stopmessages
\startmessages italian library: floatblocks
@@ -126,6 +127,7 @@
10: -- limitato
11: nessun oggetto specificato
12: non definito
+ 13: there is nothing to split
\stopmessages
\startmessages norwegian library: floatblocks
@@ -134,14 +136,15 @@
2: -- lagret
3: -- flyttet
4: -- plassert
- 5: rekkeflge tilpasset
- 6: maksimalt -- flytblokker verst
+ 5: rekkefølge tilpasset
+ 6: maksimalt -- flytblokker øverst
7: maksimalt -- flytblokker nederst
8: mindre enn -- linjer
- 9: rekkeflge endret
+ 9: rekkefølge endret
10: -- begrenset
11: ingen blokk oppgitt
12: udefinert
+ 13: there is nothing to split
\stopmessages
\startmessages romanian library: floatblocks
@@ -158,6 +161,24 @@
10: -- limitat
11: nu este dat nici un bloc
12: nedefinit
+ 13: there is nothing to split
+\stopmessages
+
+\startmessages french library: floatblocks
+ title: blocs de flottants
+ 1: -- renuméroté / -- => --
+ 2: -- sauvegardé
+ 3: -- déplacé
+ 4: -- placé
+ 5: ordre adapté
+ 6: n flottants de haut de page limité à --
+ 7: n flottants de bas de page limité à --
+ 8: moins de -- lignes
+ 9: ordre perturbé
+ 10: -- limité
+ 11: pas de bloc donné
+ 12: indéfini
+ 13: there is nothing to split
\stopmessages
\def\setupfloats
@@ -183,7 +204,7 @@
\def\doemptyblock#1%
{\localframed
[\??fl#1][\c!frame=\v!on]%
- {\getmessage\m!floatblocks{12}}}
+ {\getmessage\m!floatblocks{12}\empty}}
% A complication is that we may have to handle a pagebreak
% first, which in turn may issue a (postponed) float.
@@ -191,6 +212,16 @@
% we're realy dealing with the float. Some day I'll root out
% the global settings.
+% \def\docomplexplacefloat[#1][#2]% [#3]#4%
+% {\edef\floattype{#1}%
+% \doifelsenothing\floattype
+% {\let\floattype\v!figure}
+% {\doifundefined{\??fl#1\c!default}{\let\floattype\v!figure}}%
+% \doifelsenothing{#2}
+% {\edef\floatlocation{\getvalue{\??fl\floattype\c!default}}}
+% {\edef\floatlocation{#2}}%
+% \expanded{\dodocomplexplacefloat[\floattype][\floatlocation]}}
+
\def\docomplexplacefloat[#1][#2]% [#3]#4%
{\edef\floattype{#1}%
\doifelsenothing\floattype
@@ -199,35 +230,76 @@
\doifelsenothing{#2}
{\edef\floatlocation{\getvalue{\??fl\floattype\c!default}}}
{\edef\floatlocation{#2}}%
- \expanded{\dodocomplexplacefloat[\floattype][\floatlocation]}}
+ \doifinsetelse\v!split{#2}
+ {\expanded{\dodocomplexsplitfloat[\floattype][\floatlocation]}}
+ {\expanded{\dodocomplexplacefloat[\floattype][\floatlocation]}}}
+
+\def\dodocomplexsplitfloat[#1][#2][#3]#4%
+ {\splitfloat{\dodocomplexplacefloat[#1][#2][#3]{#4}}}
+
+\def\flushfloatslist
+ {\v!left,\v!right,\v!inner,\v!outer,%
+ \v!backspace,\v!cutspace,%
+ \v!inleft,\v!inright,\v!inmargin,%
+ \v!leftmargin,\v!rightmargin,\v!leftedge,\v!rightedge,%
+ \v!innermargin,\v!outermargin,\v!inneredge,\v!outeredge,%
+ \v!text,\v!opposite}% \v!page
+
+% \def\dodocomplexplacefloat[#1][#2][#3]#4%
+% {\flushnotes
+% \flushsidefloats % here !
+% \ifsomefloatwaiting
+% % this was \checkwaitingfloats spread all over
+% \doifinsetelse\v!always{#2}
+% {\showmessage\m!floatblocks5\empty}
+% {\expanded{\doifcommonelse{#2}{\flushfloatslist}}\doflushfloats\donothing}%
+% % but which should be done before using box \floatbox
+% \fi
+% \ifmargeblokken % waarschijnlijk gebroken ! ! ! !
+% \doifinset\v!margin{#2}
+% {\endgraf
+% \bgroup\everypar{\egroup\the\everypar}%
+% \hsize\@@mbwidth}%
+% \fi
+% \global\insidefloattrue
+% \begingroup % **
+% \the\everyinsidefloat
+% \let\@@extrafloat\empty
+% \presetmorefloatvariables{#2}%
+% \dowithnextboxcontent % better a \the\everyfloattoks
+% {\setlocalfloathsize
+% \getvalue{\??fl#1\c!inner}%
+% \fuzzysnappingfalse
+% \postponenotes} % new
+% {\xdocompletefloat{#1}{#3}{#1}{#2}{#1}{#4}% ** not yet done
+% % we need to carry over the par because of side floats
+% \doifnotinset\v!text{#2}{\carryoverpar\endgroup}%
+% \global\sidefloatdownshift \zeropoint
+% \global\sidefloatextrashift\zeropoint
+% \ifparfloat
+% \doifinset\v!reset{#2}\forgetsidefloats
+% \doinhibitblank
+% \fi}% better move this to side floats
+% \vbox}
\def\dodocomplexplacefloat[#1][#2][#3]#4%
{\flushnotes
-\flushsidefloats % here !
+ \flushsidefloats % here !
\ifsomefloatwaiting
% this was \checkwaitingfloats spread all over
\doifinsetelse\v!always{#2}
{\showmessage\m!floatblocks5\empty}
- {\doifcommonelse
- {#2}
- {\v!left,\v!right,\v!inner,\v!outer,%
- \v!backspace,\v!cutspace,%
- \v!inleft,\v!inright,\v!inmargin,%
- \v!leftmargin,\v!rightmargin,\v!leftedge,\v!rightedge,%
- \v!innermargin,\v!outermargin,\v!inneredge,\v!outeredge,%
- \v!text,\v!opposite}% \v!page
- {\doflushfloats}
- {}}%
+ {\expanded{\doifcommonelse{#2}{\flushfloatslist}}\doflushfloats\donothing}%
% but which should be done before using box \floatbox
\fi
- \ifmargeblokken % waarschijnlijk gebroken ! ! ! !
- \doifinset\v!margin{#2}
- {\endgraf
- \bgroup\everypar{\egroup\the\everypar}%
- \hsize\@@mbwidth}%
+ \ifmargeblokken
+ \doifinset\v!margin{#2}\endgraf
\fi
\global\insidefloattrue
\begingroup % **
+ \ifmargeblokken
+ \doifinset\v!margin{#2}{\hsize\@@mbwidth}%
+ \fi
\the\everyinsidefloat
\let\@@extrafloat\empty
\presetmorefloatvariables{#2}%
@@ -236,7 +308,11 @@
\getvalue{\??fl#1\c!inner}%
\fuzzysnappingfalse
\postponenotes} % new
- {\xdocompletefloat{#1}{#3}{#1}{#2}{#1}{#4}% ** not yet done
+ {\doifvaluesomething{\??fl#1\c!criterium}
+ {\ifdim\wd\nextbox>\getvalue{\??fl#1\c!criterium}\relax
+ \edef\forcedfloatmethod{\executeifdefined{\??fl#1\c!fallback}\v!here}%
+ \fi}%
+ \xdocompletefloat{#1}{#3}{#1}{#2}{#1}{#4}% ** not yet done
% we need to carry over the par because of side floats
\doifnotinset\v!text{#2}{\carryoverpar\endgroup}%
\global\sidefloatdownshift \zeropoint
@@ -356,7 +432,7 @@
%\to \everyinsidefloat
%\def\doifrightpagefloatelse % watch out: other default ! ! !
-% {\ifdubbelzijdig
+% {\ifdoublesided
% \ifodd\purenumber\twopassfloatdata\space
% \@EAEAEA\firstoftwoarguments
% \else
@@ -367,8 +443,8 @@
% \fi}
\def\doifrightpagefloatelse
- {\ifdubbelzijdig
- \ifenkelzijdig
+ {\ifdoublesided
+ \ifsinglesided
\@EAEAEA\firstoftwoarguments
\else
\@EAEAEA\doifoddfloatpageelse
@@ -395,7 +471,7 @@
% new : \place...[leftmargin,-2*line]; we need to catch fxtb:2*3
% watch out: line alone aligns on the line ! ! !
-\def\movesidefloat[#1]% (-)line|x=,y=
+\def\movesidefloat[#1]% (-)n*line|x=,y=
{\global\sidefloatdownshift \zeropoint
\global\sidefloatextrashift\zeropoint
\doifassignmentelse{#1}%
@@ -416,17 +492,26 @@
\cleanupfeatures
\doifinstringelse{:}{#1}
\donothing
- {\donefalse
- \def\movedownsidefloat##1%
+ {\def\docommand##1%
{\processaction
[##1]%
- [ \v!line=>\docommando+,%
- +\v!line=>\docommando+,%
- -\v!line=>\docommando-]}%
- \def\docommando##1%
+ [ \v!line=>\dodocommand+,%
+ +\v!line=>\dodocommand+,%
+ -\v!line=>\dodocommand-]}%
+ \def\dodocommand##1%
{\ifdone\else\global\sidefloatdownshift\zeropoint\donetrue\fi
\global\advance\sidefloatdownshift##1\lineheight}%
- \expanded{\dorepeatwithcommand[#1]}\movedownsidefloat}%
+ \donefalse\expanded{\dorepeatwithcommand[#1]}\docommand
+ \def\docommand##1%
+ {\processaction
+ [##1]%
+ [ \v!hang=>\dodocommand+,%
+ +\v!hang=>\dodocommand+,%
+ -\v!hang=>\dodocommand-]}%
+ \def\dodocommand##1% inefficient but who cares
+ {\ifdone\else\global\sidefloatsidelines\zeropoint\donetrue\fi
+ \global\advance\sidefloatsidelines\plusone\relax}%
+ \donefalse\expanded{\dorepeatwithcommand[#1]}\docommand}%
\egroup}
\def\hangsidefloat[#1]%
@@ -442,17 +527,18 @@
% already be set at this point
\processallactionsinset
[#4] % ininner/inouter : for old times sake
- [ \v!inner=>\xxdocompletefloat\v!left \v!right,
- \v!outer=>\xxdocompletefloat\v!right \v!left,
+ [ \v!inner=>\xxdocompletefloat\v!left \v!right,
+ \v!outer=>\xxdocompletefloat\v!right \v!left,
\v!innermargin=>\xxdocompletefloat\v!leftmargin \v!rightmargin,
\v!outermargin=>\xxdocompletefloat\v!rightmargin\v!leftmargin,
- \v!inneredge=>\xxdocompletefloat\v!leftedge \v!rightedge,
- \v!outeredge=>\xxdocompletefloat\v!rightedge \v!leftedge,
- \v!backspace=>\xxdocompletefloat\v!backspace \v!cutspace,
- \v!cutspace=>\xxdocompletefloat\v!cutspace \v!backspace,
- \v!left=>\xxdocompletefloat\v!left \v!left,
- \v!right=>\xxdocompletefloat\v!right \v!right,
- \v!line=>, % only -n*line is handled (see ***)
+ \v!inneredge=>\xxdocompletefloat\v!leftedge \v!rightedge,
+ \v!outeredge=>\xxdocompletefloat\v!rightedge \v!leftedge,
+ \v!backspace=>\xxdocompletefloat\v!backspace \v!cutspace,
+ \v!cutspace=>\xxdocompletefloat\v!cutspace \v!backspace,
+% \v!margin=>\xxdocompletefloat\v!cutspace \v!backspace,
+ \v!left=>\xxdocompletefloat\v!left \v!left,
+ \v!right=>\xxdocompletefloat\v!right \v!right,
+ \v!line=>, % only -n*line is handled (see ***)
\s!unknown=>{\movedownsidefloat[\commalistelement]}]%
\ifx\@@extrafloat\empty
\docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox
@@ -528,12 +614,14 @@
\dododefinefloat[#1][#1]%
\fi\fi}
+% todo: \floatparameter + \currentfloat - saves many hash entries
+
\def\dododefinefloat[#1][#2]%
{\presetlocalframed[\??fl#1]%
\setupfloat
[#1]
- [\c!width=8\lineheight, % 15\korpsgrootte,
- \c!height=6\lineheight, % 10\korpsgrootte,
+ [\c!width=8\lineheight, % 15\bodyfontsize,
+ \c!height=6\lineheight, % 10\bodyfontsize,
\c!minwidth=,
\c!maxwidth=,
\c!maxheight=,
@@ -584,6 +672,8 @@
\c!sectionnumber=\@@kjsectionnumber,
\c!distance=\@@kjdistance,
\c!separator=\@@kjseparator,
+ \c!stopper=\@@kjstopper,
+ \c!suffix=\@@kjsuffix, % hook
\c!command=\@@kjcommand,
\c!conversion=\@@kjconversion]%
\definenumber % \definelabel
@@ -595,6 +685,7 @@
\c!sectionnumber=\getvalue{\??kj#1\c!sectionnumber},
\c!conversion=\getvalue{\??kj#1\c!conversion}]%
\presetlabeltext[#1=\Word{#1}~]%
+ \checkfloatracer{\v!float#1}%
\dodefinefloatcommands[#1][#2]}
\def\dodefinefloatcommands[#1][#2]%
@@ -631,7 +722,7 @@
\c!width,\c!headstyle,\c!headcolor,\c!style,\c!color,
\c!textstyle,\c!textcolor,\c!minwidth,
\c!align,\c!number,\c!way,\c!blockway,
- \c!sectionnumber,\c!separator,\c!distance,\c!conversion]%
+ \c!sectionnumber,\c!separator,\c!stopper,\c!suffix,\c!distance,\c!conversion]%
\definenumber[#1][#3]%
\presetlabeltext[#1=\labeltext{#3}]%
\dodefinefloatcommands[#1][#2]}
@@ -679,6 +770,7 @@
\def\dosavefloatdata % \expanded
{\bgroup
+ \doglobal\increment\noffloatdata
\edef\dosavefloatdata
{\writeutilitycommand
{\twopassentry
@@ -700,48 +792,108 @@
% Er wordt bij \v!altijd als dat nodig is hernummerd.
% Daarbij wordt gebruik gemaakt van de opgeslagen nummers en
% volgorde.
-
-\definetwopasslist\s!float
-
-% \def\dofloatreference
-% {\doglobal\increment\numberedfloat
-% \edef\dodofloatreference
-% {\writeutilitycommand
-% {\twopassentry
-% {\s!float}%
-% {\numberedfloat}%
-% {\hetnummer}}}%
-% \dodofloatreference}
-
+%
+% replaced code:
+%
+% \definetwopasslist\s!float
+%
+% \def\dofloatreference#1%
+% {\doifnot\@@bknumbering\v!nocheck
+% {\doglobal\increment\numberedfloat
+% \doifelse\@@bknumbering\v!text % alternative to yes|page
+% {\let\next\immediatewriteutilitycommand}
+% {\let\next\writeutilitycommand}%
+% \expanded{\next
+% {\noexpand\twopassentry
+% {\s!float}%
+% {\numberedfloat}%
+% {\composedsectionnumber}}}}}
+%
% \def\redofloatorder#1%
-% {\doglobal\increment\nofplacedfloats\relax
-% \gettwopassdata\s!float
-% \iftwopassdatafound
-% \doifnot\hetnummer\twopassdata
-% {\edef\oldhetnummer{\hetnummer}%
-% \xdef\hetnummer{\twopassdata}%
-% \showmessage\m!floatblocks1{\nofplacedfloats,#1 \oldhetnummer,\hetnummer}}%
-% \fi}
+% {\doifnot\@@bknumbering\v!nocheck
+% {\doglobal\increment\nofplacedfloats\relax
+% \gettwopassdata\s!float
+% \iftwopassdatafound
+% \doifnot\composedsectionnumber\twopassdata
+% {\edef\oldcomposedsectionnumber{\composedsectionnumber}%
+% \xdef\composedsectionnumber{\twopassdata}%
+% \showmessage\m!floatblocks1{\nofplacedfloats,#1 \oldcomposedsectionnumber,\composedsectionnumber}}%
+% \fi}}
+%
+% \def\preparefloatnumber#1%
+% {\incrementnumber[#1]%
+% \makesectionnumber[#1]}
+%
+% \def\tracefloatnumber#1%
+% {\dofloatreference{#1}%
+% \redofloatorder{#1}}
+%
+% \def\checkfloatracer#1%
+% {}
-\def\dofloatreference
- {\doifnot\@@bknumbering\v!nocheck
- {\doglobal\increment\numberedfloat
- \expanded{\writeutilitycommand
- {\noexpand\twopassentry
- {\s!float}%
- {\numberedfloat}%
- {\hetnummer}}}}}
-
-\def\redofloatorder#1%
+\def\checkfloatracer#1%
+ {\newnodelocation{#1}}
+
+\def\tracefloatnumber#1%
{\doifnot\@@bknumbering\v!nocheck
- {\doglobal\increment\nofplacedfloats\relax
- \gettwopassdata\s!float
- \iftwopassdatafound
- \doifnot\hetnummer\twopassdata
- {\edef\oldhetnummer{\hetnummer}%
- \xdef\hetnummer{\twopassdata}%
- \showmessage\m!floatblocks1{\nofplacedfloats,#1 \oldhetnummer,\hetnummer}}%
+ {\checkfloatracer{\v!float#1}% will go
+ \tagnodelocation{\v!float#1}}}
+
+\newconditional\retainfloatnumber
+
+\def\preparefloatnumber#1%
+ {\xdef\floatcaptionnumber{#1}%
+ \doifelse\@@bknumbering\v!nocheck
+ {\incrementnumber[#1]%
+ \makesectionnumber[#1]%
+ \ifconditional\retainfloatnumber\decrementnumber[#1]\fi}
+ {\ifinsidecolumns
+ \chardef\nodelocationmode\zerocount
+ % to be perfected:
+ % \chardef\nodelocationmode\plustwo
+ \fi
+ \ifcase\nodelocationmode
+ \incrementnumber[#1]%
+ \makesectionnumber[#1]%
+ \ifconditional\retainfloatnumber\decrementnumber[#1]\fi
+ \else
+ % force check, so that we get a proper way-sync and
+ % can use the accumulated number
+ % \checknumber[#1]% \incrementnumber does this
+ \incrementnumber[#1]%
+ \savenumber[#1]%
+ % the real work is done here
+ \checkfloatracer{\v!float#1}% will go
+ \nextnodelocation{\v!float#1}% better \nextfloatnumber
+ \analyzenodelocation{\v!float#1}%
+ \scratchcounter\getnodelocationo{\v!float#1}%
+ \advance\scratchcounter\minusone
+ % here we correct for 'per whatever handling'
+ \advance\scratchcounter-\accumulatednumber[#1]%
+ \setnumber[#1]\scratchcounter
+ \incrementnumber[#1]%
+ \makesectionnumber[#1]%
+ \restorenumber[#1]%
+ % now we're back to normal numbering
\fi}}
+
+%D test case:
+%D
+%D \starttyping
+%D \setupfloat[figure][criterium=\marginwidth,fallback=bottom]
+%D \dorecurse{3}{
+%D \chapter{test}
+%D \placefigure[bottom]{1}{\framed{bottom}}
+%D test
+%D \placetable[bottom]{1}{\framed{table}}
+%D test
+%D \placetable{2}{\framed{table}}
+%D test
+%D \placefigure[left]{2}{\framed{left but way too wide}}
+%D \input tufte
+%D \placefigure[left]{3}{\framed{left but ok}}
+%D \input tufte }
+%D \stoptyping
% In \dofloatinfomessage wordt {{ }} gebruikt omdat anders
% binnen \startpostponing...\stoppostponing geen goede
@@ -766,6 +918,29 @@
\def\doinsertfloatinfo
{\dofloatinfomessage<4{\the\totalnoffloats}}
+% \def\dogetfloat
+% {\ifsomefloatwaiting
+% \global\setbox\floatlist\vbox
+% {\unvbox\floatlist
+% \global\setbox\globalscratchbox\lastbox}%
+% \ifcenterfloatbox
+% \ifdim\wd\globalscratchbox<\hsize
+% \setbox\floatbox\hbox to \hsize{\hss\box\globalscratchbox\hss}%
+% \else
+% \setbox\floatbox\box\globalscratchbox % local !
+% \fi
+% \else
+% \setbox\floatbox\box\globalscratchbox % local !
+% \fi
+% \global\advance\savednoffloats \minusone
+% \ifcase\savednoffloats
+% \global\somefloatwaitingfalse
+% \fi
+% \else
+% \global\savednoffloats\zerocount
+% \global\setbox\floatbox\box\voidb@x
+% \fi}
+
\def\dogetfloat
{\ifsomefloatwaiting
\global\setbox\floatlist\vbox
@@ -776,6 +951,12 @@
\setbox\floatbox\hbox to \hsize{\hss\box\globalscratchbox\hss}%
\else
\setbox\floatbox\box\globalscratchbox % local !
+ % retain special alignments
+ \ifinsidecolumns
+ \ifdim\wd\floatbox>\makeupwidth
+ \wd\floatbox\makeupwidth
+ \fi
+ \fi
\fi
\else
\setbox\floatbox\box\globalscratchbox % local !
@@ -839,6 +1020,8 @@
\global\somefloatwaitingtrue
\dosavefloatinfo}
+% better (todo): \savednofsavedfloats
+
\def\dosavefloatstatus
{\global\setbox\savedfloatlist\copy\floatlist
\global\setbox\savedfloatbox \copy\floatbox
@@ -852,6 +1035,45 @@
\ifx\doflushfloats\undefined \let\doflushfloats\relax \fi
\ifx\flushfloatbox\undefined \let\flushfloatbox\relax \fi
+% needed in the splitter:
+
+\newcount\savedsavednoffloats
+
+\let\dopopsavedfloats\relax
+
+\def\dopushsavedfloats
+ {\global\setbox\savedfloatlist\box\floatlist
+ \global\savedsavednoffloats\savednoffloats
+ \global\savednoffloats\savednoffloats
+ \global\somefloatwaitingfalse
+ \gdef\dopopsavedfloats
+ {\global\advance\savednoffloats\savedsavednoffloats
+ \global\setbox\floatlist\vbox\bgroup
+ \ifvoid\floatlist \else\unvbox\floatlist \fi
+ \ifvoid\savedfloatlist\else\unvbox\savedfloatlist\fi
+ \egroup
+ \global\ifcase\savednoffloats
+ \somefloatwaitingfalse\else\somefloatwaitingtrue\fi
+ \globallet\dopopsavedfloats\relax}}
+
+\def\doflushsavedfloats % simplified \OTRONEdodoflushfloats
+ {\doloop
+ {\ifsomefloatwaiting
+ \dogetfloat
+ \dofloatflushedinfo
+ \docheckiffloatfits
+ \ifroomforfloat
+ \doplacefloatbox
+ \else
+ \doreversesavefloat
+ \exitloop
+ \fi
+ \else
+ \exitloop
+ \fi}}
+
+% top and bottom
+
\newif\iftopofinsert
\newif\iftestfloatbox
\newif\ifcenterfloatbox \centerfloatboxtrue
@@ -866,7 +1088,7 @@
\setbox0\vbox{\strut\blank[\@@bkspacebefore]\strut}%
\setbox2\vbox{\strut\blank[\@@bkspaceafter ]\strut}%
\ifdim\ht0>\ht2
- \blank[-\@@bkspaceafter,\@@bkspacebefore]
+ \blank[-\@@bkspaceafter,\@@bkspacebefore]%
\fi
\egroup}
@@ -889,16 +1111,35 @@
% brr, wordt deze niet overladen in page-one? weg er mee
-\def\somepagefloat[#1]% links, rechts, midden, hoog, midden, laag
- {%\checkwaitingfloats{#1}%
- \global\setbox\collectedpagefloats\vbox
- {\unvbox\collectedpagefloats
- \vbox to \textheight
- {\doifnotinset\v!high{#1}\vfill
- \box\floatbox
- \doifnotinset\v!low{#1}\vfill}%
- \goodbreak}%
- \doinsertfloatinfo}
+% \def\somepagefloat[#1]% links, rechts, midden, hoog, midden, laag
+% {%\checkwaitingfloats{#1}%
+% \global\setbox\collectedpagefloats\vbox
+% {\unvbox\collectedpagefloats
+% \vbox to \textheight
+% {\doifnotinset\v!high{#1}\vfill
+% \box\floatbox
+% \doifnotinset\v!low{#1}\vfill}%
+% \goodbreak}%
+% \doinsertfloatinfo}
+
+% \def\OTRONEsomepagefloat[#1]%
+% {%\checkwaitingfloats{#1}%
+% \global\setbox\collectedpagefloats\vbox
+% {\ifvoid\collectedpagefloats\else\unvbox\collectedpagefloats\fi
+% \vbox to \textheight % vss and unvbox catch too high and limited floats
+% {\vss
+% \doifnotinset\v!high{#1}\vfill
+% \unvbox\floatbox
+% \doifnotinset\v!low{#1}\vfill
+% \vss}%
+% \goodbreak}%
+% \doinsertfloatinfo}
+
+% test case:
+%
+% \placefigure[page,none]{}{\blackrule[width=\textwidth,height=0.9\textheight,color=green]}
+% \placefigure[page,none]{}{\blackrule[width=\textwidth,height=1.0\textheight,color=green]}
+% \placefigure[page,none]{}{\blackrule[width=\textwidth,height=1.1\textheight,color=green]}
\def\sometextfloat[#1]% lang, links, rechts, hoog, midden, laag, offset
{%\checkwaitingfloats{#1}%
@@ -957,7 +1198,7 @@
{\doifinset\v!offset{#1}{\whitespace\blank}%
\box\floattext
\vfill}}}%
- \doifinsetelse\v!right{#1}%
+ \doifinsetelse\v!right{#1}% \floatmethod
{\setbox\floatbox\hbox to \hsize
{\box\floattext
\hfill
@@ -1006,31 +1247,45 @@
{\doifinsetelse\v!always{#1}
{\docheckiffloatfits
\ifroomforfloat
- \doifinsetelse\v!top{#1}
- {\placesometopsfloat[#1]}
- {\doifinsetelse\v!bottom{#1}
- {\placesomebotsfloat[#1]}
- {\placesomeherefloat[#1]}}%
- % more compact and efficient, but quite ugly
- % \doifinsetelse\v!top{#1}
- % \placesometopsfloat
- % {\doifinsetelse\v!bottom{#1}
- % \placesomebotsfloat
- % \placesomeherefloat}[#1]%
+ \sometopbottomfloat[#1]
\else
\showmessage\m!floatblocks9\empty
\doreversesavefloat
\fi}
{\docheckiffloatfits
\ifroomforfloat
- \doifinsetelse\v!top{#1}
- {\placesometopsfloat[#1]}
- {\doifinsetelse\v!bottom{#1}
- {\placesomebotsfloat[#1]}
- {\placesomeherefloat[#1]}}%
+ \sometopbottomfloat[#1]
\else
\dosavefloat
\fi}}}
+
+\def\floatautofactor{.5}
+
+% \def\sometopbottomfloat[#1]%
+% {\doifinsetelse\v!auto{#1}
+% {\ifdim\pagetotal<\floatautofactor\pagegoal % when empty page, maxdimen
+% \placesometopsfloat[#1]%
+% \else
+% \placesomebotsfloat[#1]%
+% \fi}
+% {\doifinsetelse\v!top{#1}
+% {\placesometopsfloat[#1]}
+% {\doifinsetelse\v!bottom{#1}
+% {\placesomebotsfloat[#1]}
+% {\placesomeherefloat[#1]}}}}
+
+\def\sometopbottomfloat[#1]%
+ {\doifelse\floatmethod\v!auto
+ {\ifdim\pagetotal<\floatautofactor\pagegoal % when empty page, maxdimen
+ \placesometopsfloat[#1]%
+ \else
+ \placesomebotsfloat[#1]%
+ \fi}
+ {\doifelse\floatmethod\v!top
+ {\placesometopsfloat[#1]}
+ {\doifelse\floatmethod\v!bottom
+ {\placesomebotsfloat[#1]}
+ {\placesomeherefloat[#1]}}}}
% De onderstaande macro wordt gebruikt bij de macros
% voor het plaatsen van tabellen en figuren (klopt niet
@@ -1133,23 +1388,17 @@
\letgvalue{@fl@r@#1}\relax
\letgvalue{@fl@t@#1}\relax
\else
- \incrementnumber[#1]%
- \makesectionnumber[#1]%
- % \globallet\flhetnummer\hetnummer % beware, not unique should be done on a per class base
- \letgvalue{@fl@n@#1}\hetnummer
+ \preparefloatnumber{#1}%
+ \letgvalue{@fl@n@#1}\composedsectionnumber
% indirect macro can be more efficient
\setgvalue{@fl@r@#1}%
- {\dofloatreference
- \redofloatorder{#1}%
- % \dowritetolist{#1}{\flhetnummer}{#3}{#1}%
+ {\tracefloatnumber{#1}%
\dowritetolist{#1}{\getvalue{@fl@n@#1}}{#3}{#1}%
\doglobal\convertargument#3\to\flasciititle % \asciititle is global
- % \doifsomething{#2}{\rawreference\s!flt{#2}{{\flhetnummer}{\flasciititle}}}%
\doifsomething{#2}{\rawreference\s!flt{#2}{{\getvalue{@fl@n@#1}}{\flasciititle}}}%
\letgvalue{@fl@r@#1}\relax}% nils
\setgvalue{@fl@t@#1}%
- % {\preparethenumber{\??kj#1}\flhetnummer\preparednumber
- {\preparethenumber{\??kj#1}{\getvalue{@fl@n@#1}}\preparednumber
+ {\preparefullnumber{\??kj#1}{\getvalue{@fl@n@#1}}\preparednumber
\doattributes{\??kj#1}\c!style\c!color
{\doattributes{\??kj#1}\c!headstyle\c!headcolor
{\labeltexts{#1}{\preparednumber}}%
@@ -1158,6 +1407,7 @@
\fi}
\def\placefloatcaptiontext [#1]{\getvalue{@fl@t@#1}}
+\def\placefloatcaptionnumber [#1]{\getvalue{@fl@n@#1}}
\def\placefloatcaptionreference[#1]{\getvalue{@fl@r@#1}}
% still needed for uguide
@@ -1179,37 +1429,15 @@
% \floatparameter
-% \def\putcompletecaption#1#2#3#4%
-% {\noindent
-% \xdef\lastcaptiontag{\strut#2\floatcaptionsuffix}%
-% \xdef\floatcaptionnumber{#1}%
-% \dostartattributes{\??kj#1}\c!style\c!color\empty
-% \ifnofloatnumber
-% \else
-% \hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor{\strut#2\floatcaptionsuffix}}%
-% \ifnofloatcaption \else \ifemptyfloatcaption \else
-% \ifcase#4\relax
-% \scratchskip\@@kjkjdistance\relax
-% \dotfskip\scratchskip\emergencystretch.5\scratchskip
-% \else
-% \ifx\@@kjkjinbetween\empty\else\unskip\@@kjkjinbetween\fi
-% \fi
-% \fi \fi
-% \fi
-% \ifnofloatcaption \else
-% \doattributes{\??kj#1}\c!textstyle\c!textcolor
-% {\begstrut#3\endstrut\endgraf}%
-% \fi
-% \dostopattributes}
-
\def\putcompletecaption#1#2#3#4%
{\noindent
- \xdef\lastcaptiontag{\strut#2\floatcaptionsuffix}%
- \xdef\floatcaptionnumber{#1}%
+% \xdef\lastcaptiontag{\strut#2\floatcaptionsuffix}%
+ \xdef\lastcaptiontag{\strut#2}%
+% \xdef\floatcaptionnumber{#1}%
\dostartattributes{\??kj#1}\c!style\c!color\empty
\ifnofloatnumber
\else
- \hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor{\strut#2\floatcaptionsuffix}}%
+ \hbox{\doattributes{\??kj#1}\c!headstyle\c!headcolor{\strut#2}}%
\ifnofloatcaption \else \ifemptyfloatcaption \else
\ifcase#4\relax
\scratchskip\@@kjkjdistance\relax
@@ -1314,7 +1542,7 @@
\def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument}%
\fi
-\def\captionminwidth {15\korpsgrootte}
+\def\captionminwidth {15\bodyfontsize}
\def\captionovershoot {2em}
\def\dopreparenocaption#1#2#3#4%
@@ -1358,7 +1586,8 @@
% float is wider than \hsize
\dosetraggedvbox\@@kjkjalign
\setbox\scratchbox\raggedbox % trial run
- {\hsize\captionhsize
+ {\trialtypesettingtrue
+ \hsize\captionhsize
\notesenabledfalse
\putcompletecaption{#4}{#2}{#3}{0}}%
\ifdim\ht\scratchbox>\lineheight % more lines
@@ -1382,7 +1611,8 @@
\edef\captionhsize{\the\scratchdimen}%
\fi
\setbox\scratchbox\vbox % test with overshoot
- {\scratchdimen\captionhsize
+ {\trialtypesettingtrue
+ \scratchdimen\captionhsize
\advance\scratchdimen \captionovershoot
\advance\scratchdimen 3em % an average word length
\ifdim\scratchdimen<\hsize \hsize\scratchdimen \fi
@@ -1522,14 +1752,19 @@
% % {\hfill\box\floatbox\hfill}} % geen \hss, gaat mis in kolommen !
% {\hss \box\floatbox\hss }} % wel \hss, anders mis in colset
+\chardef\postcenterfloatmethod\plusone
+
\def\postcenterfloatbox#1%
- {\scratchdimen \ifinsidecolumns
- \ifpostponecolumnfloats\makeupwidth\else#1\fi
- \else\ifdim#1>\hsize
- \hsize
- \else
- \wd\floatbox
- \fi\fi
+ {\scratchdimen
+ \ifcase\postcenterfloatmethod
+ #1% \wd\floatbox
+ \or\ifinsidecolumns
+ \ifpostponecolumnfloats\makeupwidth\else#1\fi
+ \else\ifdim#1>\hsize
+ \hsize
+ \else
+ \wd\floatbox
+ \fi\fi\fi
\global\setbox\floatbox\hbox to \scratchdimen
% {\hfill\box\floatbox\hfill}} % geen \hss, gaat mis in kolommen !
% {\hss \box\floatbox\hss }} % wel \hss, anders mis in colset
@@ -1607,6 +1842,7 @@
\edef\@@kjkjminwidth {\getvalue{\??kj#4\c!minwidth}}% in geval van automatisch
\edef\@@kjkjdistance {\getvalue{\??kj#4\c!distance}}%
\edef\@@kjkjalign {\getvalue{\??kj#4\c!align}}%
+ \def\@@kjkjstopper {\getvalue{\??kj#4\c!stopper}}%
\edef\@@flfllocation {\getvalue{\??fl#4\c!location}}%
\ifparfloat
\@EA\dosetparfloat % {#1}{#2}{#3}{#4}%
@@ -1640,16 +1876,21 @@
\newcounter\noxfloatlocations
+% \long\def\dofloat#1#2#3#4%
+% {\dosetfloatbox{#1}{#2}{#3}{#4}%
+% \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
+% %dogetfloatbox{#1}\v!here % see details/pascal
+% \dogetfloatbox{#1}{\executeifdefined{\??fl#4\c!fallback}\v!here}%
+% \else
+% \dogetfloatbox{#1}\empty
+% \fi}}
+
\long\def\dofloat#1#2#3#4%
{\dosetfloatbox{#1}{#2}{#3}{#4}%
- \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
- \dogetfloatbox{#1}\v!here % see details/pascal
- \else
- \dogetfloatbox{#1}\empty
- \fi}}
+ \dogetfloatbox{#1}\empty}
\let\naturalfloatheight\!!zeropoint
\let\naturalfloatwidth \!!zeropoint
@@ -1660,6 +1901,51 @@
\xdef\naturalfloatwidth {\the\wd#1}%
\xdef\naturalfloatdepth {\the\dp#1}}
+% \long\def\docompletefloat#1#2#3#4#5#6#7% #7 = box number
+% {%\flushsidefloats % moved
+% \presetfloatvariables{#1}{#4}{#2}{#6}%
+% \bgroup
+% \setnaturalfloatdimensions#7%
+% \global\setbox\floatbox\vbox
+% {\executeifdefined{\??fl#1\c!command}\firstofoneargument{\box#7}}%
+% \setnaturalfloatdimensions\floatbox
+% \dimen0 \ht\floatbox
+% \advance\dimen0 \dp\floatbox
+% \ifdim\dimen0=\zeropoint
+% \showmessage\m!floatblocks{11}\empty
+% \global\setbox\floatbox\vbox{\doemptyblock{#3}}%
+% \fi
+% \ifnofloatcaption
+% \global\setbox\floatbox\vbox
+% {\unvbox\floatbox
+% \vss % gets rid of the depth (unless tabulate)
+% \rawpagereference\s!flt{#2}}%
+% \egroup
+% \dofloat{#4}{}{#6}{#1}%
+% \else
+% \doglobal\convertargument#6\to\asciititle % \asciititle is global
+% \ifnofloatnumber
+% \global\setbox\floatbox\vbox
+% {\unvbox\floatbox % no \vss, keep the depth
+% \rawreference\s!flt{#2}{{}{\asciititle}}}%
+% \egroup
+% \dofloat{#4}{}{#6}{#1}%
+% \else
+% \incrementnumber[#1]%
+% \makesectionnumber[#1]%
+% \global\setbox\floatbox\vbox
+% {\unvbox\floatbox % no \vss, keep the depth
+% \dofloatreference
+% \redofloatorder{#1}%
+% \rawreference\s!flt{#2}{{\composedsectionnumber}{\asciititle}}%
+% \dowritetolist{#3}{\composedsectionnumber}{#6}{#3}}%
+% \egroup
+% \preparefullnumber{\??kj#1}\composedsectionnumber\preparednumber
+% \dofloat{#4}{\labeltexts{#5}{\preparednumber}}{#6}{#1}%
+% \fi
+% \fi
+% \global\insidefloatfalse}
+
\long\def\docompletefloat#1#2#3#4#5#6#7% #7 = box number
{%\flushsidefloats % moved
\presetfloatvariables{#1}{#4}{#2}{#6}%
@@ -1690,16 +1976,14 @@
\egroup
\dofloat{#4}{}{#6}{#1}%
\else
- \incrementnumber[#1]%
- \makesectionnumber[#1]%
+ \preparefloatnumber{#1}%
\global\setbox\floatbox\vbox
{\unvbox\floatbox % no \vss, keep the depth
- \dofloatreference
- \redofloatorder{#1}%
- \rawreference\s!flt{#2}{{\hetnummer}{\asciititle}}%
- \dowritetolist{#3}{\hetnummer}{#6}{#3}}%
+ \tracefloatnumber{#1}%
+ \rawreference\s!flt{#2}{{\composedsectionnumber}{\asciititle}}%
+ \dowritetolist{#3}{\composedsectionnumber}{#6}{#3}}%
\egroup
- \preparethenumber{\??kj#1}\hetnummer\preparednumber
+ \preparefullnumber{\??kj#1}\composedsectionnumber\preparednumber
\dofloat{#4}{\labeltexts{#5}{\preparednumber}}{#6}{#1}%
\fi
\fi
@@ -1866,14 +2150,35 @@
% \ifinpostponing: handhaven, want gebruikt in stijlen ! ! ! ! !
+\def\flushpagefloats
+ {\doifoddpageelse
+ {\ifvoid\collectedleftpagefloats
+ \ifvoid\collectedrightpagefloats\else
+ \unvbox\collectedrightpagefloats
+ \page
+ %\the\everytopofpage
+ \fi
+ \fi}
+ {\ifvoid\collectedleftpagefloats\else
+ \unvbox\collectedleftpagefloats
+ \page
+ %\the\everytopofpage
+ \fi
+ \ifvoid\collectedrightpagefloats\else
+ \unvbox\collectedrightpagefloats
+ \page
+ %\the\everytopofpage
+ \fi}%
+ \ifvoid\collectedpagefloats\else
+ % message
+ \unvbox\collectedpagefloats
+ \fi}
+
\def\dopostponeblock
{\bgroup % new may 2004
\setsystemmode\v!postponing % new may 2004
\the\everytopofpage
- \ifvoid\collectedpagefloats\else
- % message
- \unvbox\collectedpagefloats
- \fi
+ \flushpagefloats
\donefalse
\ifinpostponing \else
\ifcase\nofpostponedblocks \else \donetrue \fi
@@ -1926,56 +2231,6 @@
\dostartbuffer[pbuf-\nofpostponedblocks]%
[\e!start\v!postponing][\e!stop\v!postponing]}
-\definenumber
- [\??si]
- [\c!way=\v!by\v!text,
- \c!conversion=\@@siconversion]
-
-\def\setupfloatsplitting
- {\dodoubleargument\getparameters[\??si]}
-
-% ook (continued)
-
-\def\dosplitfloat[#1]#2% nog dubbele refs
- {\ifinsidecolumns % tzt ook nog figuren splitten
- % not yet supported
- \else
- \bgroup
- \insidefloattrue
- \getparameters[\??si][#1]%
- \resetnumber[\??si]%
- \def\floatcaptionsuffix{\convertednumber[\??si]}%
- \TABLEcaptionheight\@@silines\lineheight % brrr
- \simplifypagebreak % \page becomes \goodbreak
- \dowithnextbox
- {\forgetall
- \dontcomplain
- \doloop
- {\setbox2\vsplit\nextbox to \lineheight
- \setbox2\vbox{\unvbox2}
- \ifdim\ht2>\lineheight
- \incrementnumber[\??si]%
- \ifcase\rawnumber[\??si]\or \ifdim\nextboxht=\zeropoint
- \let\floatcaptionsuffix\empty
- \fi \fi
- \bgroup
- #2{\unvbox2}
- \egroup
- \ifdim\nextboxht>\zeropoint
- \page
- \decrementnumber[\floatcaptionnumber]%
- \fi
- \fi
- \ifdim\nextboxht>\zeropoint\else
- \expandafter\exitloop
- \fi}%
- \egroup}
- \vbox
- \fi}
-
-\def\splitfloat
- {\dosingleempty\dosplitfloat}
-
\def\dooutput{\sidefloatoutput} % redefinition of \dooutput
\setupmarginblocks
@@ -2033,6 +2288,8 @@
\c!blockway=\@@nrblockway,
\c!sectionnumber=\@@nrsectionnumber,
\c!separator=\@@koseparator,
+ \c!stopper=\@@kostopper,
+ \c!suffix=\floatcaptionsuffix, % hook
\c!distance=1em,
\c!command=,
\c!conversion=\v!numbers]
@@ -2043,7 +2300,7 @@
\c!height=\v!fit,
\c!offset=\v!overlay,
\c!frame=\v!off,
- \c!radius=.5\korpsgrootte,
+ \c!radius=.5\bodyfontsize,
\c!corner=\v!rectangular,
\c!background=,
\c!backgroundscreen=\@@rsscreen,
@@ -2073,16 +2330,13 @@
\c!local=,
\c!default=\v!figure,
\c!numbering=\v!yes]
-
-\setupfloatsplitting
- [\c!conversion=\v!character, % \v!romannumerals
- \c!lines=3]
% float strategy, replaces some of the above macros
-\let\floatmethod\empty
-\let\floatcolumn\empty
-\let\floatrow \empty
+\let\floatmethod \empty
+\let\floatcolumn \empty
+\let\floatrow \empty
+\let\forcedfloatmethod\empty
\def\dogetfloatbox#1#2%
{\ifvisible
@@ -2100,8 +2354,11 @@
\let\floatrow\empty
\edef\floatmethod{#2}}%
\doifundefined{\string\floatmethod\floatmethod}
- {\let\floatmethod\v!here}%
- \getvalue{\string\floatmethod\floatmethod}[#1]%
+ {\let\floatmethod\v!here}%
+ \doifsomething\forcedfloatmethod
+ {\edef\floatmethod{\forcedfloatmethod}}%
+ %\getvalue{\string\floatmethod\floatmethod}[#1]%
+ \getvalue{\string\floatmethod\floatmethod}[\floatmethod,#1]%
\fi}
\def\installfloathandler#1#2% #1=keyword #2=handler
@@ -2114,9 +2371,12 @@
\installfloathandler \v!text \sometextfloat
\installfloathandler \v!top \sometopfloat
\installfloathandler \v!bottom \somebottomfloat
+\installfloathandler \v!auto \someautofloat
\installfloathandler \v!margin \somemarginfloat
\installfloathandler \v!opposite \somefacefloat
\installfloathandler \v!page \somepagefloat
+\installfloathandler \v!leftpage \someleftpagefloat
+\installfloathandler \v!rightpage \somerightpagefloat
\installfloathandler \v!inmargin \someinmarginfloat
\installfloathandler \v!inleft \someinleftmarginfloat
\installfloathandler \v!inright \someinrightmarginfloat
@@ -2139,19 +2399,22 @@
\installfloathandler {fxtb} \someslotfloat
\installfloathandler {fxbt} \someslotfloat
-\def\placesomeslotfloat {\OTRcommand\someslotfloat}
-\def\placesomeherefloat {\OTRcommand\someherefloat}
-\def\placesomefixdfloat {\OTRcommand\somefixdfloat}
-\def\placesomepagefloat {\OTRcommand\somepagefloat}
-\def\placesometopsfloat {\OTRcommand\sometopsfloat}
-\def\placesomebotsfloat {\OTRcommand\somebotsfloat}
-\def\placesomesidefloat {\OTRcommand\somesidefloat}
-\def\placesomefacefloat {\OTRcommand\somefacefloat}
+\def\placesomeslotfloat {\OTRcommand\someslotfloat}
+\def\placesomeherefloat {\OTRcommand\someherefloat}
+\def\placesomefixdfloat {\OTRcommand\somefixdfloat}
+\def\placesomepagefloat {\OTRcommand\somepagefloat}
+\def\placesomeleftpagefloat {\OTRcommand\someleftpagefloat}
+\def\placesomerightpagefloat{\OTRcommand\somerightpagefloat}
+\def\placesometopsfloat {\OTRcommand\sometopsfloat}
+\def\placesomebotsfloat {\OTRcommand\somebotsfloat}
+\def\placesomesidefloat {\OTRcommand\somesidefloat}
+\def\placesomefacefloat {\OTRcommand\somefacefloat}
\def\someleftsidefloat [#1]{\somesidefloat[#1]\presetindentation}
\def\somerightsidefloat [#1]{\somesidefloat[#1]}
\def\sometopfloat [#1]{\someelsefloat[#1]\nonoindentation}
\def\somebottomfloat [#1]{\someelsefloat[#1]}
+\def\someautofloat [#1]{\someelsefloat[#1]}
\def\somemarginfloat [#1]{\somenextfloat[#1]\nonoindentation}
\def\someinleftmarginfloat [#1]{\somesidefloat[#1]}
\def\someinrightmarginfloat[#1]{\somesidefloat[#1]}
@@ -2163,9 +2426,11 @@
\def\somebackspacefloat [#1]{\somesidefloat[#1]}
\def\somecutspacefloat [#1]{\somesidefloat[#1]}
-\def\somefixdfloat {\placesomefixdfloat}
-\def\somepagefloat {\placesomepagefloat}
-\def\somefacefloat {\placesomefacefloat}
-\def\someslotfloat {\placesomeslotfloat}
+\def\somefixdfloat {\placesomefixdfloat}
+\def\somepagefloat {\placesomepagefloat}
+\def\someleftpagefloat {\placesomeleftpagefloat}
+\def\somerightpagefloat{\placesomerightpagefloat}
+\def\somefacefloat {\placesomefacefloat}
+\def\someslotfloat {\placesomeslotfloat}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/page-imp.tex b/Master/texmf-dist/tex/context/base/page-imp.tex
index b54dcfa99c5..b64a543cff7 100644
--- a/Master/texmf-dist/tex/context/base/page-imp.tex
+++ b/Master/texmf-dist/tex/context/base/page-imp.tex
@@ -516,8 +516,7 @@
\global\wd\arrangedpageB\paperwidth
\global\setbox\arrangedpageA\hbox
{\box\arrangedpageA\box\arrangedpageB}%
- \global\ht\arrangedpageA\paperheight
- \global\setbox\arrangedpageB\box\scratchbox} % ?
+ \global\ht\arrangedpageA\paperheight}
\def\handlearrangedpageTOP
{\global\ht\arrangedpageA\paperheight
@@ -719,28 +718,34 @@
% \starttext \dorecurse{30}{test \recurselevel \page} \stoptext
\def\pusharrangedpageXY#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \doglobal\increment\arrangedpageM
- \global\setbox\arrangedpageB\hbox
- \ifdim\@@ppwidth>\zeropoint to \@@ppwidth \fi
- {\ifvoid\arrangedpageB\else
- \unhbox\arrangedpageB\hss\hskip\@@ppdx\hss
- \fi
- \box#1}%
- \ifnum\arrangedpageM<\arrangedpageX\else
- \global\setbox\arrangedpageA\vbox
- \ifdim\@@ppheight>\zeropoint to \@@ppheight \fi
- {\offinterlineskip
- \ifvoid\arrangedpageA\else
- \unvbox\arrangedpageA\vss\vskip\@@ppdy\vss
- \fi
- \box\arrangedpageB}%
- \doglobal\newcounter\arrangedpageM
- \fi
- \ifnum\arrangedpageN<\arrangedpageT\else
- \poparrangedpages
- \fi}
+ {\doglobal\increment\arrangedpageN
+ \reportarrangedpage\arrangedpageN
+ \doglobal\increment\arrangedpageM
+ \global\setbox\arrangedpageB\hbox
+ \ifdim\@@ppwidth>\zeropoint to \@@ppwidth \fi
+ {\ifvoid\arrangedpageB\else
+ \unhbox\arrangedpageB
+ \ifdim\@@ppdx>\zeropoint \else \hss\fi
+ \hskip\@@ppdx
+ \ifdim\@@ppdx>\zeropoint \else \hss\fi
+ \fi
+ \box#1}%
+ \ifnum\arrangedpageM<\arrangedpageX\else
+ \global\setbox\arrangedpageA\vbox
+ \ifdim\@@ppheight>\zeropoint to \@@ppheight \fi
+ {\offinterlineskip
+ \ifvoid\arrangedpageA\else
+ \unvbox\arrangedpageA
+ \ifdim\@@ppdy>\zeropoint \else \vss\fi
+ \vskip\@@ppdy
+ \ifdim\@@ppdy>\zeropoint \else \vss\fi
+ \fi
+ \box\arrangedpageB}%
+ \doglobal\newcounter\arrangedpageM
+ \fi
+ \ifnum\arrangedpageN<\arrangedpageT\else
+ \poparrangedpages
+ \fi}
\def\poparrangedpagesXY
{\ifnum\arrangedpageN>\zerocount
@@ -917,7 +922,7 @@
\def\dofilterpage#1#2%
{\hbox to \textwidth
- {\ifdubbelzijdig\ifdim\@@ipwidth>\zeropoint\relax\ifodd\realpageno\else
+ {\ifdoublesided\ifdim\@@ipwidth>\zeropoint\relax\ifodd\realpageno\else
\hfill
\def\dowithfigure{\hskip-\@@ipwidth}%
\fi\fi\fi
diff --git a/Master/texmf-dist/tex/context/base/page-ini.tex b/Master/texmf-dist/tex/context/base/page-ini.tex
index 7c1ff78d3e5..826ecd350e4 100644
--- a/Master/texmf-dist/tex/context/base/page-ini.tex
+++ b/Master/texmf-dist/tex/context/base/page-ini.tex
@@ -155,10 +155,10 @@
1: caricamento dei file supplementari posticipato (typemode)
2: -- caricato
% 3: provare LaTeX
- 4: comando -- gi definito
+ 4: comando -- già definito
5: macro del modulo -- caricate
6: nessuna macro trovata nel modulo --
- 7: macro del modulo -- gi caricate
+ 7: macro del modulo -- già caricate
8: nuova versione del file supplementare, seconda passata necessaria
9: -- non trovato/elaborato
10: non usare em in --
@@ -185,12 +185,12 @@
title: system
1: innlesning av hjelpefila utsatt (typemode)
2: -- er lest inn
-% 3: forsker LaTeX
+% 3: forsøker LaTeX
4: kommando -- er allerede definert
5: makroene i modul -- er lest inn
6: ingen makroer funnet i modul ---
7: makroene i modul -- er allerede lest inn
- 8: ny versjon av hjelpefil, andre gjennomkjring ndvendig
+ 8: ny versjon av hjelpefil, andre gjennomkjøring nødvendig
9: -- ikke funnet/behandlet
10: ikke bruk em i --
11: lager enkel hjelpefil
@@ -205,7 +205,7 @@
20: betydning (sorterer) av -- er lest inn
21: hjelpefila er ikke lest inn
22: bruk en gyldig hjelpefil
- 23: -- arrangert p --
+ 23: -- arrangert på --
24: Flytblokker
25: Referanser
26: Registere
@@ -243,6 +243,37 @@
27: Versiune
\stopmessages
+\startmessages french library: systems
+ title: système
+ 1: chargement de fichier utilitaire reporté (typemode)
+ 2: -- chargé
+% 3: try LaTeX
+ 4: la commande -- est déjà définie
+ 5: module -- chargé
+ 6: module -- non trouvé
+ 7: module -- déjà chargé
+ 8: nouvelle version de fichier utilitaire, seconde passe nécessaire
+ 9: -- non trouvé/traité
+ 10: n'utilisez pas em dans --
+ 11: construction util simple
+ 12: le fichier utilitaire n'est pas trié, utilise texutil
+ 13: marquage -- defini --
+ 14: nouvellepage forcée dans la liste à --
+ 15: sauvegarde du tampon (buffer) --
+ 16: composition du tampon (buffer) --
+ 17: composition textuelle du tampon (buffer) --
+ 18: le synonyme -- -- n'existe pas
+ 19: signification (synonymes) de -- chargée
+ 20: signification (tris) de -- chargée
+ 21: pas de données utilitaires chargées
+ 22: utilise un fichier utilitaire valide
+ 23: -- arrangé à --
+ 24: blocsflottants
+ 25: Réferences
+ 26: Registres
+ 27: Version
+\stopmessages
+
\startmessages dutch library: layouts
title: layout
1: teksthoogte aangepast met -- op pagina --
@@ -315,12 +346,12 @@
\startmessages norwegian library: layouts
title: layout
- 1: teksthyde tilpasset med -- p side --
- 2: -- ganger forskjvet tekst plassert
- 3: -- ganger tekst forskjvet
+ 1: teksthøyde tilpasset med -- på side --
+ 2: -- ganger forskjøvet tekst plassert
+ 3: -- ganger tekst forskjøvet
4: margblokker aktive
5: margblokker inaktive
- 6: delside sett -- behandlet (strrelse --)
+ 6: delside sett -- behandlet (størrelse --)
% 7: beregner plass for logo
% 8: beregner bakgrunn
10: -- og -- er ikke 1.0 til sammen
@@ -340,6 +371,20 @@
10: -- si -- nu se adauga pana la 1.0
11: spatierea -- nu este permisa in gridmode
\stopmessages
+
+\startmessages french library: layouts
+ title: calque
+ 1: hauteurtexte adaptée avec -- à la page --
+ 2: -- times postponed text placed
+ 3: -- times text postponed
+ 4: blocsmarge actifs
+ 5: blocsmarge inactifs
+ 6: jeu de souspage -- traité (taille --)
+% 7: calculating logospace
+% 8: calculating backgrounds
+ 10: -- et -- ne sont pas ajoutés à 1.0
+ 11: espacement -- non permis en modegrille
+\stopmessages
\def\m!otr{otr}
@@ -532,17 +577,17 @@
title: kolonner
1: maksimalt -- kolonner
2: bruk \string\filbreak\space som et alternativ
- 3: problemer, slr av balansering
- 4: flytblokker verst er ikke stttet enda
- 5: flytblokker nedert er ikke stttet enda
- 6: -- flytblokk forskjvet
+ 3: problemer, slår av balansering
+ 4: flytblokker øverst er ikke støttet enda
+ 5: flytblokker nedert er ikke støttet enda
+ 6: -- flytblokk forskjøvet
7: balansering avbrutt etter 100 iterasjoner
8: balansert etter -- iterasjoner
9: kontroller tekstlayout!
10: (mindre enn) 1 linje igjen
11: flytblokk for bredt for kolonna
- 12: flytblokk forskjvet til neste kolonne / --
- 13: bred flytblokk forksjvet til toppen av kolonnene
+ 12: flytblokk forskjøvet til neste kolonne / --
+ 13: bred flytblokk forksjøvet til toppen av kolonnene
\stopmessages
\startmessages romanian library: columns
@@ -561,6 +606,23 @@
12: blocul este mutat pe urmatoarea coloana / --
13: blocul lat este mutat in partea de sus a coloanelor
\stopmessages
+
+\startmessages french library: columns
+ title: colonnes
+ 1: seules -- colonnes possibles
+ 2: utilisez \string\filbreak\space en tant qu'alternative
+ 3: problèmes, désactive l'équilibrage
+ 4: flottant en partie supérieure pas encore supporté
+ 5: flottant en partie inférieure pas encore supporté
+ 6: -- flottant(s) reporté(s)
+ 7: équilibrage abandonné après 100 pas
+ 8: équilibré en -- pas
+ 9: vérification des irrégularités
+ 10: (moins de) 1 ligne restante
+ 11: flottant mis à la largeur de la colonne
+ 12: flottant déplacé à la colonne suivante / --
+ 13: flottant large déplacé dans la partie supérieure de la colonne
+\stopmessages
\ifx\dosetuplayout\undefined % overloaded in page-lay !
@@ -568,6 +630,9 @@
\fi
+\def\normalejectpenalty{-\@M} \let\ejectpenalty\normalejectpenalty
+\def\normalsuperpenalty{-\@MM} \let\superpenalty\normalsuperpenalty
+
%D In case we're not running \ETEX, we need to bypass a
%D couple of primitives.
@@ -857,6 +922,8 @@
\newif\ifpackcolumnfloats \packcolumnfloatstrue
\newbox\collectedpagefloats
+\newbox\collectedleftpagefloats
+\newbox\collectedrightpagefloats
%D The \type {\ifdim} test is needed, because otherwise the
%D last line of a text end up on top of the baseline instead of
@@ -868,10 +935,10 @@
% \def\eject {\par\penalty-\@M } % == {\par\break} % plain
% \def\supereject {\par\penalty-\@MM} % also plain
-\def\eject {\par\ifvmode\penalty-\@M \fi\resetpagebreak} % == {\par\break} % plain
-\def\supereject {\par\ifvmode\penalty-\@MM\fi\resetpagebreak} % also plain
+\def\eject {\par\ifvmode\penalty\ejectpenalty\fi\resetpagebreak} % == {\par\break} % plain
+\def\supereject {\par\ifvmode\penalty\superpenalty\fi\resetpagebreak} % also plain
-\def\doejectpage {\par\ifvmode\ifdim\pagetotal>\pagegoal\else\normalvfil\fi\fi}
+\def\doejectpage {\par\ifvmode\ifdim\pagetotal>\pagegoal\else\normalvfil\fi\fi} % pg set to \textheight
\def\ejectpage {\doejectpage\eject}
\def\superejectpage{\doejectpage\supereject}
@@ -918,7 +985,7 @@
\penalty\outputpenalty
\fi
% not really needed, replaced by \flushsavedfloats
- \ifnum\outputpenalty>-\@MM \else % better use a proper otr signal
+ \ifnum\outputpenalty>\superpenalty \else % better use a proper otr signal
\dosupereject
\fi
% but does not hurt either (we're still in the otr!)
@@ -989,7 +1056,7 @@
\resetselectiepagina
\verhoogpaginanummer
\checkpagedimensions
- \ifnum\outputpenalty>-\@MM \else
+ \ifnum\outputpenalty>\superpenalty \else
\dosupereject
\fi
\doflushspread
@@ -1495,8 +1562,7 @@
% was: \resetsectionmarks\firstsection, zie \handlepagebreak
-\def\page {\pagebreak} % the short form of \pagebreak (mult-com one)
-\def\page{\pagebreak} % for the moment, keep this one
+\def\page{\pagebreak} % the short form of \pagebreak (mult-com one)
\def\resetpagebreak
{\global\paginageblokkeerdfalse}
@@ -1504,6 +1570,9 @@
\def\simplifypagebreak
{\def\dopagebreak[##1]{\goodbreak}}
+\def\disablepagebreaks
+ {\def\dopagebreak[##1]{}}
+
\def\executepagebreakhandler#1%
{\edef\@@pagespecification{#1}%
\doifdefinedelse{\??pe:\@@pagespecification}
@@ -1524,7 +1593,7 @@
% {\flushnotes % see head's; watch how we group
% \doifsomething{#1}{\bgroup\executepagebreakhandlers{#1}\egroup}}
-\def\pagebreak
+\unexpanded\def\pagebreak
{\dosingleempty\dopagebreak}
\def\dopagebreak[#1]% so, page ornaments are reset after a pagebreak command, unless set
@@ -1635,7 +1704,7 @@
\gotonextpageX % will become \gotonextpage
\doifbothsidesoverruled
\orsideone
- \resetcurrentsectionmarks
+ \resetcurrentsectionmarks % sic
\ejectdummypage
\orsidetwo
\od}
@@ -1646,7 +1715,7 @@
\doifbothsidesoverruled
\orsideone
\orsidetwo
- \resetcurrentsectionmarks
+ \resetcurrentsectionmarks % sic
\ejectdummypage
\od}
@@ -1659,7 +1728,7 @@
\doifoddpageelse\donothing{\resetcurrentsectionmarks\ejectdummypage}}
\installpagebreakhandler \v!quadruple % not yet ok inside columnsets
- {\ifdubbelzijdig
+ {\ifdoublesided
\!!counta\realpageno
\!!countb\realpageno
\divide\!!counta 4
@@ -1687,7 +1756,7 @@
\installpagebreakhandler \v!lastpage % handy for backpage preceded by empty pages
{\executepagebreakhandler\v!yes
- \ifdubbelzijdig
+ \ifdoublesided
\executepagebreakhandler\v!left
\executepagebreakhandler\v!empty
\executepagebreakhandler\v!empty
diff --git a/Master/texmf-dist/tex/context/base/page-lay.tex b/Master/texmf-dist/tex/context/base/page-lay.tex
index 5a5bafe24be..20d9e66860b 100644
--- a/Master/texmf-dist/tex/context/base/page-lay.tex
+++ b/Master/texmf-dist/tex/context/base/page-lay.tex
@@ -314,7 +314,7 @@
% {\dodosetuppapersize[#1][#2]}}}
%
% The next version is more extensive; here we can
-% associate paper and page with key/value like settinsg,
+% associate paper and page with key/value like settings,
% which is handy in 'example' when we use setups
\def\setuppaper[#1]%
@@ -354,8 +354,7 @@
\fi\fi\fi}
\def\dododosetuppapersize[#1][#2]%
- {\xdef\restorepapersize
- {\noexpand\setuppapersize[#1][#2]}%
+ {\xdef\restorepapersize{\noexpand\setuppapersize[#1][#2]}%
\dosetuppaperorientation{#1}\paperlandscape\paperorientation\paperreverse\papermirror
\dosetuppaperorientation{#2}\printlandscape\printorientation\printreverse\printmirror
\def\docommando##1%
@@ -609,13 +608,21 @@
%
% \startstandardmakeup[page=blank] ... \stopstandardmakeup
+% \def\checkcurrentlayout % public and used in naw, so keep this name
+% {\ifundefined{\??ly\realfolio\c!state}%
+% \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout
+% \else
+% \doifvalue{\??ly\realfolio\c!state}\v!start
+% {\xdef\currentlayout{\realfolio}\recalculatelayout}% new, global
+% \fi}
+
\def\checkcurrentlayout % public and used in naw, so keep this name
- {\ifundefined{\??ly\realfolio\c!state}%
- \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout
- \else
- \doifvalue{\??ly\realfolio\c!state}\v!start
- {\xdef\currentlayout{\realfolio}\recalculatelayout}% new, global
- \fi}
+ {\doifundefinedelse{\??ly\realfolio\c!state}
+ {\doifundefinedelse{\??ly\v!current\c!state}
+ {\doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout}
+ {\globallet\currentlayout\v!current\recalculatelayout}}
+ {\doifvalue{\??ly\realfolio\c!state}\v!start
+ {\xdef\currentlayout{\realfolio}\recalculatelayout}}} % new, global
\def\checkcurrentoddlayout
{\ifundefined{\??ly\v!odd\c!state}\else
@@ -629,7 +636,15 @@
{\globallet\currentlayout\v!even\recalculatelayout}% new, global
\fi}
-\appendtoks \checkcurrentlayout \to \everyaftershipout
+% \appendtoks \checkcurrentlayout \to \everyaftershipout
+
+\appendtoks
+ \ifx\currentlayout\v!current
+ \globallet\currentlayout\empty
+ \global\letbeundefined{\??ly\v!current\c!state}%
+ \checkcurrentlayout
+ \fi
+\to \everyaftershipout
\newif\ifdoublesidedprint
@@ -848,7 +863,7 @@
\def\orientpagebodybox#1#2#3%
{\ifnum#2#3>\zerocount
\setbox#1\vbox
- {\edef\somerotation{\ifdubbelzijdig\ifodd\realpageno#2\else#3\fi\else#2\fi}%
+ {\edef\somerotation{\ifdoublesided\ifodd\realpageno#2\else#3\fi\else#2\fi}%
\dorotatebox\somerotation\hbox{\box#1}}%
\fi}
@@ -925,28 +940,22 @@
\ifnum\verticalcutmarks >2 \chardef\colormarkoffset4 \fi
#1{#2}}
-\newif\ifdubbelzijdig \dubbelzijdigfalse
-\newif\ifenkelzijdig \enkelzijdigtrue
-
-\def\doifsometextlineelse#1%
- {\edef\!!stringa{\csname\??tk#1\c!state\endcsname}%
- \ifx\!!stringa\v!none
- \@EA\secondoftwoarguments
- \else\ifx\!!stringa\v!high
- \@EAEAEA\secondoftwoarguments
- \else
- \@EAEAEA\firstoftwoarguments
- \fi\fi}
+\newif\ifdoublesided \doublesidedfalse
+\newif\ifsinglesided \singlesidedtrue
% NOG EENS NAGAAN WANNEER NU GLOBAL EN WANNEER NIET
+\ifx\doifelselayoutsomeline\undefined % defined in page-txt
+ \let\doifelselayoutsomeline\secondofthreearguments
+\fi
+
\def\calculatevsizes % global needed in \recalculatelayoutregel
{\redoglobal\textheight\makeupheight
- \doifsometextlineelse \v!header
+ \doifelselayoutsomeline \v!header
{\redoglobal\advance\textheight -\headerheight
\redoglobal\advance\textheight -\headerdistance}%
\donothing
- \doifsometextlineelse \v!footer
+ \doifelselayoutsomeline \v!footer
{\redoglobal\advance\textheight -\footerheight
\redoglobal\advance\textheight -\footerdistance}%
\donothing
@@ -965,12 +974,12 @@
\def\calculatereducedvsizes
{\textheight\makeupheight
- \doifsometextlineelse \v!header
+ \doifelselayoutsomeline \v!header
{\advance\textheight -\headerheight
\advance\textheight -\headerdistance}%
{\headerheight\zeropoint
\setlayoutdistances}%
- \doifsometextlineelse \v!footer
+ \doifelselayoutsomeline \v!footer
{\advance\textheight -\footerheight
\advance\textheight -\footerdistance}%
{\footerheight\zeropoint
@@ -1027,15 +1036,15 @@
% what are those \relax'es doing there?
\def\doifbothsidesoverruled#1\orsideone#2\orsidetwo#3\od
- {\ifdubbelzijdig
+ {\ifdoublesided
\doifoddpageelse{#2}{#3}\relax
\else
#1\relax
\fi}
\def\doifbothsides#1\orsideone#2\orsidetwo#3\od
- {\ifdubbelzijdig
- \ifenkelzijdig
+ {\ifdoublesided
+ \ifsinglesided
#1\relax
\else
\doifoddpageelse{#2}{#3}\relax
@@ -1075,8 +1084,8 @@
\the\everyswapmargins}
\def\rightorleftpageaction
- {\ifdubbelzijdig
- \ifenkelzijdig
+ {\ifdoublesided
+ \ifsinglesided
\@EAEAEA\firstoftwoarguments
\else
\@EAEAEA\doifoddpageelse
diff --git a/Master/texmf-dist/tex/context/base/page-lin.tex b/Master/texmf-dist/tex/context/base/page-lin.tex
index dfb99ca95c4..a0b4e84a94d 100644
--- a/Master/texmf-dist/tex/context/base/page-lin.tex
+++ b/Master/texmf-dist/tex/context/base/page-lin.tex
@@ -200,12 +200,39 @@
\newevery \everylinenumber \relax
+% \def\dodoplacelinenumber
+% {% beware of em's, the font is already switched !
+% \setbox\scratchbox\hbox
+% {\setbox0\hbox{\@@rncommand{\completelinenumber}}\vsmashbox0%
+% \ifcase\linenumberlocation
+% \rlap{\hbox to \@@rnwidth{\box0\hss}}% was \llap, nog testen !!
+% \or
+% \inleftmargin
+% {\forgetall
+% \doifelse\@@rnwidth\v!margin
+% {\hsize\leftmarginwidth}{\hsize\@@rnwidth}%
+% \alignedline\@@rnalign\v!right{\box0\hskip\@@rndistance}}%
+% \else
+% \inrightmargin
+% {\forgetall
+% \doifelse\@@rnwidth\v!margin
+% {\hsize\rightmarginwidth}{\hsize\@@rnwidth}%
+% \alignedline\@@rnalign\v!left{\hskip\@@rndistance\box0}}%
+% \fi}%
+% \vsmashbox\scratchbox
+% \box\scratchbox
+% \the\everylinenumber}
+
\def\dodoplacelinenumber
{% beware of em's, the font is already switched !
\setbox\scratchbox\hbox
{\setbox0\hbox{\@@rncommand{\completelinenumber}}\vsmashbox0%
\ifcase\linenumberlocation
- \rlap{\hbox to \@@rnwidth{\box0\hss}}% was \llap, nog testen !!
+ \iftypesettinglines % hack
+ \expandafter\llap
+ \else
+ \expandafter\rlap
+ \fi{\hbox to \@@rnwidth{\box0\hss}}% was \llap, nog testen !!
\or
\inleftmargin
{\forgetall
@@ -240,9 +267,12 @@
% \v!text=>\chardef\linenumberlocation\zerocount,
%\s!unknown=>\chardef\linenumberlocation\zerocount,
%\s!default=>\chardef\linenumberlocation\zerocount]%
- \ifcase\linenumberlocation % text
- \advance\leftskip \@@rnwidth\relax
- \fi
+ \doifnot\@@rnwidth\v!margin
+ {\freezedimenmacro\@@rnwidth
+ \ifcase\linenumberlocation % text
+ \advance\leftskip\@@rnwidth\relax
+ \fi}%
+ \freezedimenmacro\@@rndistance
\chardef\@@rn@@rnmethod
\ifprocessingverbatim\zerocount\else\iftypesettinglines\plusone\else\plustwo\fi\fi
\processaction
@@ -276,6 +306,7 @@
\let\stoplinenumbering\dostopnummerenVERB
\def\placelinenumber
{\global\linenumber\verbatimlinenumber
+ \global\advance\linenumber \minusone
\doplacelinenumber}%
\fi
\dostartnummeren}
@@ -431,7 +462,7 @@
\newcount\internalparagraphnumber
-\def\setupparagraphnumbering%
+\def\setupparagraphnumbering
{\dosingleempty\dosetupparagraphnumbering}
\def\dosetupparagraphnumbering[#1]%
diff --git a/Master/texmf-dist/tex/context/base/page-log.tex b/Master/texmf-dist/tex/context/base/page-log.tex
index 19411065e52..53984eefd4f 100644
--- a/Master/texmf-dist/tex/context/base/page-log.tex
+++ b/Master/texmf-dist/tex/context/base/page-log.tex
@@ -43,6 +43,10 @@
7: se calculeaza spatiul pentru logo
\stopmessages
+\startmessages french library: layouts
+ 7: calcul de l'espace pour le logo
+\stopmessages
+
%D Although logos can conveniently be implemented on top of
%D background and text areas, we provide a dedicated mechanism
%D here. One reason is that such a separate mechanism cannot
@@ -131,7 +135,7 @@
\def\setlogoboxes
{\showmessage\m!layouts7\empty
\dosetlogobox\leftlogos\relax
- \ifdubbelzijdig
+ \ifdoublesided
\dosetlogobox\rightlogos\doswapmargins
\fi}
diff --git a/Master/texmf-dist/tex/context/base/page-lyr.tex b/Master/texmf-dist/tex/context/base/page-lyr.tex
index c1a9499f09d..e92f120529e 100644
--- a/Master/texmf-dist/tex/context/base/page-lyr.tex
+++ b/Master/texmf-dist/tex/context/base/page-lyr.tex
@@ -130,6 +130,19 @@
\def\currentlayerdata{0}
+\let\currentlayerwidth \!!zeropoint
+\let\currentlayerheight\!!zeropoint
+
+\def\setcurrentlayerdimensions
+ {\dodoubleempty\dosetcurrentlayerdimensions}
+
+\def\dosetcurrentlayerdimensions[#1][#2]% name left|right
+ {\edef\currentlayerwidth {\thelayerwidth {#2#1}}%
+ \edef\currentlayerheight{\thelayerheight{#2#1}}}
+
+\def\thelayerwidth #1{\the\wd\executeifdefined{\@@layerbox#1}\voidbox}
+\def\thelayerheight#1{\the\ht\executeifdefined{\@@layerbox#1}\voidbox}
+
\def\setlayer
{\dotripleempty\dosetlayer}
@@ -198,8 +211,15 @@
\def\definelayerpreset
{\dodoubleargument\dodefinelayerpreset}
+% \def\dodefinelayerpreset[#1][#2]%
+% {\setvalue{\??ll\??ll#1}{\dopresetlayer{#2}}}
+%
+% more fun: \definelayerpreset[whatever][lefttop]
+
\def\dodefinelayerpreset[#1][#2]%
- {\setvalue{\??ll\??ll#1}{\dopresetlayer{#2}}}
+ {\doifassignmentelse{#2}
+ {\setvalue{\??ll\??ll#1}{\dopresetlayer{#2}}}
+ {\setvalue{\??ll\??ll#1}{\getvalue{\??ll\??ll#2}}}}
\def\dopresetlayer#1#2#3% #1=list #2=tag #3=list
{\getparameters[\??ll#2][#1,#3]}
@@ -300,7 +320,7 @@
\doifundefined{\@@layerbox#2\currentlayer\layerpage}
{\global\expandafter\newbox\csname\@@layerbox#2\currentlayer\layerpage\endcsname}}%
\dontcomplain % more comfortable
- \chardef\layerpagebox\csname\@@layerbox#2\currentlayer\layerpage\endcsname
+ \mathchardef\layerpagebox\csname\@@layerbox#2\currentlayer\layerpage\endcsname
\ifvoid\layerpagebox
\gsetboxllx\layerpagebox\zeropoint
\gsetboxlly\layerpagebox\zeropoint
@@ -415,6 +435,8 @@
%D efficient in \ETEX\ since there testing for an undefined
%D macro does not takes hash space.
+% todo: setups before flush, handy hook
+
\unexpanded\def\flushlayer[#1]%
{\doifelsevalue{\??ll#1\c!state}\v!next
{\global\letvalue{\??ll#1\c!state}\v!start} % dangerous, stack-built-up
@@ -470,7 +492,7 @@
{\doifvalue{\??ll#2\c!repeat}\v!yes\!!donecfalse
\doifvalue{\??ll#2\c!state}\v!repeat\!!donecfalse}%
\fi
- \chardef\layerbox\csname\@@layerbox#3\endcsname
+ \mathchardef\layerbox\csname\@@layerbox#3\endcsname
% we need to copy in order to retain the negative offsets for a next
% stage of additions, i.e. llx/lly accumulate in repeat mode and the
% compensation may differ each flush depending on added content
@@ -724,8 +746,8 @@
{\doifelselayerdata{OTRTEXT}
{\setbox#1\hbox to \makeupwidth
{\startoverlay
+ {\tightlayer[OTRTEXT]} % first, otherwise problems with toc
{\normalsettextpagecontent{#1}{#2}{#3}\box#1}
- {\tightlayer[OTRTEXT]}
\stopoverlay}%
\dp#1\zeropoint}%
{\normalsettextpagecontent{#1}{#2}{#3}}}
diff --git a/Master/texmf-dist/tex/context/base/page-mak.tex b/Master/texmf-dist/tex/context/base/page-mak.tex
index a6e5a66fd0a..807d77fc07f 100644
--- a/Master/texmf-dist/tex/context/base/page-mak.tex
+++ b/Master/texmf-dist/tex/context/base/page-mak.tex
@@ -127,9 +127,10 @@
\setupmakeuplayout
\makeupparameter\c!commands % hm, what is this one doing here ?
\startregistercolor[\makeupparameter\c!color]%
+ \forgetall % else indented flush
\global\setbox\makeupbox\vbox to \makeupparameter\c!height
\bgroup
- \forgetall
+% \forgetall
\setups[\makeupparameter\c!setups]%
\hsize\makeupparameter\c!width
\doifsomething{\makeupparameter\c!align}
@@ -141,7 +142,7 @@
\makeupparameter\c!bottom
\egroup
\flushmarks % new, here, else empty pages
-\stopregistercolor
+ \stopregistercolor
\doflushmakeup
\egroup
\calculatehsizes
@@ -166,13 +167,20 @@
\def\doshipoutmakeup
{\globalpushmacro\@@pnstate % new
\makeupparameter\c!before
- \vbox{\hbox{\color[\makeupparameter\c!color]{\box\makeupbox}}}%
+ \setbox\makeupbox\vbox{\hbox{\color[\makeupparameter\c!color]{\box\makeupbox}}}%
+ % \ifgridsnapping
+ % new per 22/6/2006
+ \ifdim\ht\makeupbox>\vsize
+ \ht\makeupbox\vsize
+ \fi
+ % \fi
+ \box\makeupbox
\setuppagenumber[\c!state=\makeupparameter\c!pagestate]%
\setupmakeuplayout
\page
\makeupparameter\c!after
\relax % voor fi
- \ifdubbelzijdig \ifodd\realpageno\else
+ \ifdoublesided \ifodd\realpageno\else
\processaction
[\makeupparameter\c!doublesided]
[ \v!yes=>\null
diff --git a/Master/texmf-dist/tex/context/base/page-mar.tex b/Master/texmf-dist/tex/context/base/page-mar.tex
index 6cec52d04ee..6a251f0d0e3 100644
--- a/Master/texmf-dist/tex/context/base/page-mar.tex
+++ b/Master/texmf-dist/tex/context/base/page-mar.tex
@@ -93,13 +93,13 @@
\setvalue{\s!do\??im\??im\v!inner}{\presignalrightpage\doifrightpageelse\doleftmarginline \dorightmarginline}
\setvalue{\s!do\??im\??im\v!outer}{\presignalrightpage\doifrightpageelse\dorightmarginline\doleftmarginline }
-\definemarginline[inleftmargin] [\c!location=\v!left, \c!width=\leftmarginwidth, \c!distance=\leftmargindistance]
-\definemarginline[inrightmargin][\c!location=\v!right,\c!width=\rightmarginwidth,\c!distance=\rightmargindistance]
+\definemarginline[inleftmargin] [\c!location=\v!left, \c!width=\leftmarginwidth, \c!distance=\leftmargindistance,\c!hoffset=\zeropoint]
+\definemarginline[inrightmargin][\c!location=\v!right,\c!width=\rightmarginwidth,\c!distance=\rightmargindistance,\c!hoffset=\zeropoint]
\definemarginline[inleftedge] [\c!location=\v!left, \c!width=\leftedgewidth, \c!distance=\leftedgedistance, \c!hoffset=\leftmargintotal]
\definemarginline[inrightedge] [\c!location=\v!right,\c!width=\rightedgewidth, \c!distance=\rightedgedistance,\c!hoffset=\rightmargintotal]
-\definemarginline[inoutermargin][\c!location=\v!outer,\c!width=\outermarginwidth,\c!distance=\outermargindistance]
-\definemarginline[ininnermargin][\c!location=\v!inner,\c!width=\innermarginwidth,\c!distance=\innermargindistance]
+\definemarginline[inoutermargin][\c!location=\v!outer,\c!width=\outermarginwidth,\c!distance=\outermargindistance,\c!hoffset=\zeropoint]
+\definemarginline[ininnermargin][\c!location=\v!inner,\c!width=\innermarginwidth,\c!distance=\innermargindistance,\c!hoffset=\zeropoint]
\definemarginline[inouteredge] [\c!location=\v!outer,\c!width=\outeredgewidth, \c!distance=\outeredgedistance,\c!hoffset=\outermargintotal]
\definemarginline[ininneredge] [\c!location=\v!inner,\c!width=\inneredgewidth, \c!distance=\inneredgedistance,\c!hoffset=\innermargintotal]
@@ -574,7 +574,7 @@
\v!right=>\let\next\dorightmarginblock, % no swapping
\v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock },
\v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock},
- \s!unknown=>\ifdubbelzijdig
+ \s!unknown=>\ifdoublesided
\doifcommonelse{+,-}{#4}
{\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }}
{\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}%
diff --git a/Master/texmf-dist/tex/context/base/page-mul.tex b/Master/texmf-dist/tex/context/base/page-mul.tex
index c68a4dcf280..991e7532d30 100644
--- a/Master/texmf-dist/tex/context/base/page-mul.tex
+++ b/Master/texmf-dist/tex/context/base/page-mul.tex
@@ -27,7 +27,7 @@
\let\OTRMULsetvsize \OTRONEsetvsize
\let\OTRMULsethsize \OTRONEsethsize
\let\OTRMULdopagecontents \OTRONEdopagecontents
-\let\OTRMULfinalsidefloatoutput\OTRONEfinalsidefloatoutput
+\let\OTRMULfinalsidefloatoutput\OTRONEfinalsidefloatoutput % ???
\let\OTRMULflushfloatbox \OTRONEflushfloatbox
\let\OTRMULdosettopinserts \relax
@@ -37,6 +37,9 @@
\let\OTRMULdosetbothinserts \relax
\let\OTRMULflushsavedfloats \relax
+\let\OTRMULflushsidefloats \forgetsidefloats % \relax
+\let\OTRMULsynchronizesidefloats\forgetsidefloats % \relax
+
\newtoks \OTRMULoutput
\def\OTRMULgotonextpage
@@ -476,7 +479,7 @@
\fi
\appendtoks\topskip1\topskip\to\everybodyfont
\the\everybodyfont % ugly here
-\saveinterlinespace % uglu here
+ \saveinterlinespace % ugly here
\initializecolumns\nofcolumns
\hangafter\zerocount
\hangindent\zeropoint
@@ -632,7 +635,9 @@
\edef\maxcolumndepth{\the\dp\currentcolumnbox}%
\fi}}
-\def\flushcolumnedpage
+\chardef\columnedtopflushmethod\plusone
+
+\def\flushcolumnedpage#1%
{\bgroup
\forgetall
\setmulticolumnsout
@@ -698,20 +703,48 @@
\global\precolumnboxheight\zeropoint
\setvsize
\dosomebreak\nobreak
- % wrong, but keep it as a reminder
- % \ifgridsnapping \else
- % \scratchdimen\topskip
- % \advance\scratchdimen -\openstrutheight
- % \nointerlineskip
- % \vskip-\scratchdimen
- % \fi
- % so that we don't add it again
+ \ifgridsnapping \else
+ \ifcase\columnedtopflushmethod
+ % sometimes method 1 goes wrong, so we need a way out; best sort this out
+ % when we run into it again
+ \or
+ % \input tufte \startcolumns \showbaselines \input tufte \stopcolumns \input tufte
+ \scratchdimen\topskip
+ \advance\scratchdimen -\openstrutheight
+ \nointerlineskip
+ \vskip-\scratchdimen
+ \or
+ % untested but maybe handy
+ \scratchdimen\topskip
+ \advance\scratchdimen -\openstrutheight
+ \nointerlineskip
+ \vskip-\scratchdimen
+ \vskip-\lineheight
+ \vbox{\strut}%
+ \fi
+ \fi
\prevdepth\openstrutdepth
\nointerlineskip
\dp\columnpagebox\zeropoint
\global\finalcolumnheights\ht\columnpagebox
\getnoflines\finalcolumnheights
\global\finalcolumnlines\noflines
+ \ifcase#1\else
+ % messy correction, we need to rewrite this module (newcolumns)
+ \setbox\columnpagebox\vbox
+ {\offinterlineskip
+ \scratchdimen\ht\columnpagebox
+ \advance\scratchdimen\dp\columnpagebox % we probably lost that one already
+ \box\columnpagebox
+ \vskip-\scratchdimen}%
+ \scratchdimen\noflines\openlineheight
+ \advance\scratchdimen-\openstrutdepth
+ \advance\scratchdimen-\openlineheight
+ \advance\scratchdimen\topskip
+ \ht\columnpagebox\scratchdimen
+ \dp\columnpagebox\openstrutdepth
+ % end of mess
+ \fi
\box\columnpagebox
\egroup}
@@ -984,7 +1017,7 @@
\getmulticolumnlines
\dimen0=\nofcolumnlines\openlineheight
\dohandleallcolumns
- {\splitcurrentcolumn from \box\normalpagebox to \dimen0}
+ {\splitcurrentcolumn from \box\normalpagebox to \dimen0}%
\setbox\restofpage\vbox{\unvbox\normalpagebox}%
\ifinheritcolumns
\ifr@ggedbottom % vreemd
@@ -1021,7 +1054,7 @@
\dohandleallcolumns
{\global\ht\currentcolumnbox\dimen0}%
\fi
- \setbox\precolumnbox\vbox{\flushcolumnedpage}%
+ \setbox\precolumnbox\vbox{\flushcolumnedpage\zerocount}%
\finaloutput\box\precolumnbox
\sethsize
\setvsize
@@ -1038,6 +1071,8 @@
%D \type{\box4} garantees a more robust check when skips are
%D used.
+\def\multicolumnsbalancemax{250} % 100 is too small when floats are involved
+
\def\balancedmulticolumnsout
{\bgroup
\setmulticolumnsout
@@ -1083,49 +1118,58 @@
\dimen2=\onepoint % RUBISH
\dimen2=\spacingfactor\dimen2
\fi
- \loop
- \advance\count255 \plusone
- \global\setbox\restofpage\copy0\relax
- \splitfirstcolumn from \box\restofpage to \dimen0
- \dohandlemidcolumns
- {\splitcurrentcolumn from \box\restofpage to \dimen0}%
- \splitlastcolumn from \box\restofpage to \dimen0
- \setbox2\vbox{\unvcopy\firstcolumnbox}%
- \dimen4\zeropoint
- \dohandleallcolumns
- {\setbox4\vbox
- {\unvcopy\currentcolumnbox
- %rather new, test this on pdftex-z.tex
- \unpenalty\unskip\unpenalty\unskip}% maybe better in main splitter
- %\writestatus{balance}{\the\currentcolumnbox: \the\ht4}%
- \dimen6\ht4
- \ifdim\dimen6>\dimen4 \dimen4=\dimen6 \fi}%
- \advance\dimen4 -.0005pt % get rid of accurracy problem, pretty new
- \ifnum\count255>100
- \donefalse
- \else\ifdim\dimen4>\ht2
- \donetrue
- \else
- \donefalse
- \fi\fi
- \ifdone
- \advance\dimen0 \dimen2\relax
- \repeat
+ \doloop
+ {\advance\count255 \plusone
+ \global\setbox\restofpage\copy0\relax
+ \splitfirstcolumn from \box\restofpage to \dimen0
+ \dohandlemidcolumns
+ {\splitcurrentcolumn from \box\restofpage to \dimen0}%
+ \splitlastcolumn from \box\restofpage to \dimen0
+ \setbox2\vbox{\unvcopy\firstcolumnbox}%
+ \dimen4\zeropoint
+ \dohandleallcolumns
+ {\setbox4\vbox
+ {\unvcopy\currentcolumnbox
+ %rather new, test this on pdftex-z.tex
+ \unpenalty\unskip\unpenalty\unskip}% maybe better in main splitter
+ %\writestatus{balance}{\the\currentcolumnbox: \the\ht4}%
+% \dimen6\ht4 \ifdim\dimen6>\dimen4 \dimen4=\dimen6 \fi}%
+ \ifdim\ht4>\dimen4 \dimen4=\ht4 \fi}%
+ \advance\dimen4 -.0005pt % get rid of accurracy problem, pretty new
+ \ifnum\count255>\multicolumnsbalancemax\relax
+ \exitloop
+ \else\ifdim\dimen4>\ht2
+ \advance\dimen0 \dimen2\relax
+ \else
+ \exitloop
+ \fi\fi}%
\dohandleallcolumns
{\global\setbox\currentcolumnbox\vbox{\unvcopy\currentcolumnbox}}% NIEUW
- \ifnum\count255>100\relax
+ \ifnum\count255>\multicolumnsbalancemax\relax
\showmessage\m!columns7\empty
\else
\showmessage\m!columns8{\the\count255\space}%
\fi
\egroup
\ifinheritcolumns
- \dimen0\ht\firstcolumnbox
- \dimen2\ht\firstcolumnbox
+ % We cannot assume that the first column is the tallest, if
+ % only because we may have an aborted balance (one line in the
+ % first column and a graphic in the second one).
+ %
+ % \dimen0\ht\firstcolumnbox
+ % \dimen2\ht\firstcolumnbox
+ %
+ \dimen0=\zeropoint
+ \dohandleallcolumns
+ {\ifdim\ht\currentcolumnbox>\dimen0
+ \dimen0=\ht\currentcolumnbox
+ \fi}%
+ \dimen2\dimen0
+ % so far
\advance\dimen2 -\openlineheight
\dohandleallcolumns
{\dimen4\ht\currentcolumnbox
- \dimen6=10\openlineheight
+ \dimen6=10\openlineheight % funny value
\global\setbox\currentcolumnbox\vbox to \dimen0
{\unvbox\currentcolumnbox
\ifdim\dimen4>\dimen6
@@ -1174,10 +1218,17 @@
\fi
\global\output{\balancingerror}%
\b@selinebottomtrue % forces depth in separation rule
- \flushcolumnedpage
- \allowbreak
+ \flushcolumnedpage\plusone
+ \multicolumnseject
\egroup}
+\def\multicolumnseject
+ {\ifdim\pagetotal>\textheight
+ \eject % new
+ \else
+ \allowbreak
+ \fi}
+
%D The multicolumn mechanism is incorporated in a \CONTEXT\
%D interface, which acts like:
%D
@@ -1238,8 +1289,7 @@
\let\flushcolumnfloats\noflushcolumnfloats}
\def\setlocalcolumnfloats
- {\everypar
- {\flushnotes\flushcolumnfloat\flushmargincontents\checkindentation}%
+ {\everypar{\flushnotes\flushcolumnfloat\flushmargincontents\checkindentation}%
\let\flushcolumnfloat\doflushcolumnfloat
%\let\doroomfloat\docolumnroomfloat
\let\docheckiffloatfits\docolumnroomfloat
@@ -1490,6 +1540,24 @@
\egroup
\fi}
+%D The next macro can be used to flush floats in the current
+%D stream. No width checking is (yet) done.
+
+\def\insertcolumnfloats
+ {\doloop
+ {\ifsomefloatwaiting
+ \bgroup
+ \forgetall
+ % no check for width
+ \dogetfloat
+ \blank[\@@bkspacebefore]
+ \snaptogrid\vbox{\copy\floatbox}
+ \blank[\@@bkspaceafter]
+ \egroup
+ \else
+ \exitloop
+ \fi}}
+
%D This were the multi||column routines. They can and need to
%D be improved but at the moment their behaviour is acceptable.
%D
@@ -1511,8 +1579,8 @@
% \stopcolumns
\newif\ifinsidecolumns
-\newif\if@@klbalanceren
-\newif\if@@kluitlijnen
+% \newif\if@@klbalanceren
+% \newif\if@@kluitlijnen
\insidecolumnsfalse
@@ -1632,11 +1700,11 @@
{\goodbreak}
\installcolumnbreakhandler {MUL} \v!yes
- {\par % todo: since
+ {\par % todo: since
{\testrulewidth\zeropoint\ruledvskip\textheight} % we misuse a
- \penalty-200 % side effect
+ \penalty-200 % side effect
\vskip-\textheight
- \prevdepth-\thousandpoint} % signals top of column to \blank
+ }% bugged : \prevdepth-\thousandpoint} % signals top of column to \blank
\setupcolumns
[\c!n=2,
@@ -1645,14 +1713,14 @@
\c!direction=\v!right,
\c!rule=\v!off,
\c!tolerance=\v!tolerant,
- \c!distance=1.5\korpsgrootte, % influenced by switching
+ \c!distance=1.5\bodyfontsize, % influenced by switching
\c!height=,
\c!balance=\v!yes,
\c!align=\v!text,
\c!blank={\v!line,\v!fixed},
\c!option=,
\c!rulethickness=\linewidth,
- \c!offset=.5\korpsgrootte]
+ \c!offset=.5\bodyfontsize]
%D Undocumented and still under development.
@@ -1663,7 +1731,7 @@
{\bgroup
\nopenalties
\getparameters[\??kl]
- [\c!width=\hsize,\c!distance=1.5\korpsgrootte,%
+ [\c!width=\hsize,\c!distance=1.5\bodyfontsize,%
\c!n=2,\c!lines=0,#1]%
\let\rigidcolumnlines\@@kllines
\setrigidcolumnhsize\@@klwidth\@@kldistance\@@kln
diff --git a/Master/texmf-dist/tex/context/base/page-num.tex b/Master/texmf-dist/tex/context/base/page-num.tex
index 358a30275fa..b5a90fe6be3 100644
--- a/Master/texmf-dist/tex/context/base/page-num.tex
+++ b/Master/texmf-dist/tex/context/base/page-num.tex
@@ -343,10 +343,10 @@
% so far
\def\checkpagecounter
- {\checknummer{\s!page}}
+ {\checknumber[\s!page]}
% \getpagestatus
-% \ifrightpage als odd/enkelzijdig
+% \ifrightpage als odd/singlesided
\newif\ifrightpage \rightpagetrue
@@ -365,7 +365,7 @@
\writepagref}
\def\getpagestatus % hierboven gebruiken
- {\ifdubbelzijdig
+ {\ifdoublesided
\gettwopassdata\s!page
\iftwopassdatafound \else
\let\twopassdata\realpageno
@@ -402,8 +402,8 @@
\v!right=>\dododosetpagenumberlocation{\v!text\c!righttext},
\v!inleft=>\dododosetpagenumberlocation{\v!margin\c!lefttext},
\v!inright=>\dododosetpagenumberlocation{\v!margin\c!righttext},
- \v!inmargin=>\dododosetpagenumberlocation{\v!margin\ifdubbelzijdig\c!margintext\else\c!righttext\fi},
- \v!margin=>\dododosetpagenumberlocation{\v!margin\ifdubbelzijdig\c!margintext\else\c!righttext\fi},
+ \v!inmargin=>\dododosetpagenumberlocation{\v!margin\ifdoublesided\c!margintext\else\c!righttext\fi},
+ \v!margin=>\dododosetpagenumberlocation{\v!margin\ifdoublesided\c!margintext\else\c!righttext\fi},
\v!atmargin=>\dododosetpagenumberlocation{\v!text\c!marginedgetext},
\v!marginedge=>\dododosetpagenumberlocation{\v!text\c!marginedgetext}]%
\ifdone \else
@@ -419,14 +419,14 @@
\def\dosetuppagenumbering[#1]%
{\getparameters[\??nm][#1]%
\preparepageprefix\??nm
- \enkelzijdigfalse
- \dubbelzijdigfalse
+ \singlesidedfalse
+ \doublesidedfalse
\ExpandFirstAfter\processallactionsinset
[\@@nmalternative]
- [ \v!singlesided=>\enkelzijdigtrue,
- \v!doublesided=>\dubbelzijdigtrue]%
+ [ \v!singlesided=>\singlesidedtrue,
+ \v!doublesided=>\doublesidedtrue]%
\ifx\trackingmarginnotestrue\undefined\else
- \ifdubbelzijdig
+ \ifdoublesided
\trackingmarginnotestrue
\else
\trackingmarginnotesfalse
@@ -489,13 +489,19 @@
{\dodopageprefix{#1}%
\donexttracklevel{#1}}
+\chardef\pageprefixmode\plusone
+
\def\pageprefix#1[#2]%
- {\bgroup
- \edef\pageprefixtype{#1}%
- \edef\postprefix{\@@filternumberpart[#2]}%
- \let\donexttrackcommando\dopageprefix
- \donexttrackcommando\firstsection
- \egroup}
+ {\ifcase\pageprefixmode
+ % skip
+ \or
+ \bgroup
+ \edef\pageprefixtype{#1}%
+ \edef\postprefix{\@@filternumberpart[#2]}%
+ \let\donexttrackcommando\dopageprefix
+ \donexttrackcommando\firstsection
+ \egroup
+ \fi}
%D It was Marco Kuhlmann who uncovered the missing strut. This
%D was a pretty old bug kind of covered up by the fact that non
diff --git a/Master/texmf-dist/tex/context/base/page-one.tex b/Master/texmf-dist/tex/context/base/page-one.tex
index 124232868cd..b1931dd1e98 100644
--- a/Master/texmf-dist/tex/context/base/page-one.tex
+++ b/Master/texmf-dist/tex/context/base/page-one.tex
@@ -125,16 +125,48 @@
#1%
\fi}
+% \chardef\kindofpagetextareas\plusone
+
+\def\doOTRONEregisteredtextareaA#1%
+ {\ifregistertextareas
+ \xypos{pbd:\realfolio:b}% we could save bytes by only saving the y
+ \endgraf
+ \begingroup
+ \scratchdimen\MPy{pbd:\realfolio:b}%
+ \advance\scratchdimen-\MPy{pbd:\realfolio:e}%
+ \setbox\scratchbox\null
+ \wd\scratchbox\makeupwidth
+ \ht\scratchbox\scratchdimen
+ \vsmash{\registeredtextarea00\scratchbox}%
+ \endgroup
+ #1%
+ \endgraf
+ \xypos{pbd:\realfolio:e}%
+ \else
+ #1%
+ \fi}
+
+\def\doOTRONEregisteredtextareaB#1%
+ {\ifregistertextareas
+ \setbox0\vbox{#1}%
+ \wd0\makeupwidth % somehow a space creeps in
+ \vbox{\registeredtextarea000}%
+ \else
+ #1%
+ \fi}
+
\let\OTRONEregisteredtextareaA\firstofoneargument
\let\OTRONEregisteredtextareaB\firstofoneargument
\def\OTRONEdopagecontents#1#2% \box<n> \unvbox<n>
{\bgroup % niet breedte zetten, kan fractie zijn!
\ifcase\kindofpagetextareas
- \or % partial page
- \let\OTRONEregisteredtextareaA\OTRONEregisteredtextarea
- \or % whole page
- \let\OTRONEregisteredtextareaB\OTRONEregisteredtextarea
+ \or % partial page (experimental)
+ \let\OTRONEregisteredtextareaA\doOTRONEregisteredtextareaA
+ \or % whole page (default)
+ \let\OTRONEregisteredtextareaB\doOTRONEregisteredtextareaB
+ \or % partial page (only works well with no stretch!)
+ \let\OTRONEregisteredtextareaA\doOTRONEregisteredtextareaB
\fi
\setbox0\vbox \ifbottomnotes to \textheight \fi
{\edef\currentpagedepth{\the\dp#2}% still to be derived from #1
@@ -309,16 +341,6 @@
\OTRONEdosetbotinserts
\fi}
-% \def\OTRONEdotopinsertions
-% {\ifvoid\topins\else
-% \ifgridsnapping
-% \box\topins % not \topsnaptogrid{\box\topins}%
-% \else
-% \unvbox\topins
-% \fi
-% \fi
-% \global\topinserted\zeropoint}
-
\def\OTRONEdotopinsertions
{\ifvoid\topins\else
\ifgridsnapping
@@ -359,16 +381,6 @@
\fi \fi
\snaptogrid\hbox{\iftestfloatbox\ruledhbox\fi{\copy\floatbox}}}
-% \def\OTRONEdodoflushfloats % moet nog beter: als precies passend, niet onder baseline
-% {\ifsomefloatwaiting
-% \bgroup % \box\floatbox can be in use!
-% \dogetfloat
-% \doplacefloatbox
-% \egroup
-% \dofloatflushedinfo
-% \expandafter\OTRONEdodoflushfloats
-% \fi}
-
\def\OTRONEdodoflushfloats % much in common with OTRSET
{\ifsomefloatwaiting
\ifpackflushedfloats
@@ -424,52 +436,6 @@
\expandafter\OTRONEdodoflushfloats
\fi}
-% \def\OTRONEdocheckiffloatfits % vervangen ivm downward comp
-% {\ifnofloatpermitted
-% \global\roomforfloatfalse
-% \else
-% \dimen0 \pagetotal
-% \advance\dimen0 \ht\floatbox
-% \advance\dimen0 \dp\floatbox
-% \advance\dimen0 \floattopskip
-% % \advance\dimen0 -\pageshrink % toegevoegd
-% %\message{c:\the\mofcolumns,t:\the\pagetotal,g:\the\pagegoal}%\wait
-% \ifdim\dimen0>\pagegoal
-% \global\roomforfloatfalse
-% \else
-% \global\roomforfloattrue
-% \fi
-% \fi}
-
-% \def\OTRONEdocheckiffloatfits % vervangen ivm downward comp
-% {\ifnofloatpermitted
-% \global\roomforfloatfalse
-% \else
-% \dimen0 \pagetotal
-% \advance\dimen0 \ht\floatbox
-% \advance\dimen0 \dp\floatbox
-% \advance\dimen0 \floattopskip
-% \advance\dimen0 -\pageshrink % toegevoegd
-% %\message{c:\the\mofcolumns,t:\the\pagetotal,g:\the\pagegoal}%\wait
-% \dimen2\pagegoal
-% \relax % needed
-% \ifcase\textfloatmethod
-% % method 0 : raw
-% \or
-% % method 1 : safe
-% \dimen2 .99\pagegoal
-% \or
-% % method 2 : tight
-% \advance\dimen0 -\onepoint
-% \fi
-% \relax % really needed ! ! ! !
-% \ifdim\dimen0>\dimen2
-% \global\roomforfloatfalse
-% \else
-% \global\roomforfloattrue
-% \fi
-% \fi}
-
\def\OTRONEdocheckiffloatfits % vervangen ivm downward comp
{\ifnofloatpermitted
\global\roomforfloatfalse
@@ -518,7 +484,8 @@
%\ifgridsnapping \else \baselinecorrection \fi % ! ! ! test test test ! ! ! !
\doplacefloatbox
\doinsertfloatinfo
- \dochecknextindentation\??bk}
+ \dochecknextindentation\??bk
+ \dorechecknextindentation}
% \def\OTRONEsomefixdfloat % [#1]
% {\docheckiffloatfits
@@ -573,30 +540,33 @@
[#1]
[ \v!left=>\leftfloat {\box\floatbox},
\v!right=>\rightfloat {\box\floatbox},
- \v!inleft=>\leftmarginfloat {\box\floatbox},
- \v!inright=>\rightmarginfloat{\box\floatbox},
+ \v!inleft=>\leftmarginfloat {\box\floatbox},
+ \v!inright=>\rightmarginfloat{\box\floatbox},
\v!leftmargin=>\leftmarginfloat {\box\floatbox},
\v!rightmargin=>\rightmarginfloat{\box\floatbox},
- \v!leftedge=>\leftedgefloat {\box\floatbox},
- \v!rightedge=>\rightedgefloat {\box\floatbox},
- \v!backspace=>\backspacefloat {\box\floatbox},
- \v!cutspace=>\cutspacefloat {\box\floatbox},
- \v!inmargin=>{\doinmargenormal\leftmarginfloat
- \rightmarginfloat{\box\floatbox}}]%
+ \v!leftedge=>\leftedgefloat {\box\floatbox},
+ \v!rightedge=>\rightedgefloat {\box\floatbox},
+ \v!backspace=>\backspacefloat {\box\floatbox},
+ \v!cutspace=>\cutspacefloat {\box\floatbox},
+ \v!inmargin=>\cutspacefloat {\box\floatbox}]%
\doifinset\v!tall{#1}\flushsidefloatsafterpar
\fi}
-\def\OTRONEsomepagefloat[#1]%
+\def\OTRONEdosomepagefloat#1[#2]%
{%\checkwaitingfloats{#1}%
- \global\setbox\collectedpagefloats\vbox
- {\unvbox\collectedpagefloats
+ \global\setbox#1\vbox
+ {\unvbox#1%
\vbox to \textheight
- {\doifnotinset\v!high{#1}\vfill
+ {\doifnotinset\v!high{#2}\vfill
\box\floatbox
- \doifnotinset\v!low{#1}\vfill}%
+ \doifnotinset\v!low{#2}\vfill}%
\goodbreak}%
\doinsertfloatinfo}
+\def\OTRONEsomepagefloat {\OTRONEdosomepagefloat\collectedpagefloats}
+\def\OTRONEsomeleftpagefloat {\OTRONEdosomepagefloat\collectedleftpagefloats}
+\def\OTRONEsomerightpagefloat{\OTRONEdosomepagefloat\collectedrightpagefloats}
+
\def\OTRONEsometopsfloat[#1]%
{\ifdim\topinserted=\zeropoint
\topofinserttrue
diff --git a/Master/texmf-dist/tex/context/base/page-plg.tex b/Master/texmf-dist/tex/context/base/page-plg.tex
new file mode 100644
index 00000000000..8478d6ef60b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/page-plg.tex
@@ -0,0 +1,209 @@
+%D \module
+%D [ file=page-pls,
+%D version=2003.03.16,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Page Setup,
+%D author=Hans Hagen,
+%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.
+
+\ifx\pageareabox\undefined \else \endinput \fi
+
+\writestatus{loading}{Context Core Macros / Extra Page Building}
+
+%D This feature has been present for a while but has never been
+%D exploited: pluggable pagebuilders. The next example code
+%D demonstrates the application of one such a plug-in. This variant
+%D support \type {page}, \type {leftpage} and \type {rightpage}
+%D definitions where specific areas are placed with the \type
+%D {\pagearea} command.
+%D
+%D \starttyping
+%D \setupheadertexts[the header text]
+%D \setupfootertexts[a pretty long left footer text][something right]
+%D \setupbottomtexts[a not so long bottom text][another right thing]
+%D \setuptexttexts [margin][something marginal][indeed]
+%D
+%D \startpagelayout[leftpage]
+%D \setupTABLE[offset=overlay]
+%D \setupTABLE[c][1][width=\leftmarginwidth]
+%D \bTABLE
+%D \bTR
+%D \bTD[nx=3,background=color,backgroundcolor=green]
+%D \pagearea[header][text][middle]
+%D \eTD
+%D \eTR
+%D \bTR
+%D \bTD \pagearea[text][margin][left] \eTD
+%D \bTD[nx=2] \pagearea[text] \eTD
+%D \eTR
+%D \bTR
+%D \bTD[nx=3,offset=overlay]
+%D {\bTABLE[width=.5\hsize]
+%D \bTR
+%D \bTD \pagearea[footer][text][left] \eTD
+%D \bTD \pagearea[bottom][text][left] \eTD
+%D \eTR
+%D \eTABLE}
+%D \eTD
+%D \eTR
+%D \eTABLE
+%D \stoppagelayout
+%D
+%D \startpagelayout[rightpage]
+%D \setupTABLE[offset=overlay]
+%D \setupTABLE[c][1][width=\rightmarginwidth]
+%D \bTABLE
+%D \bTR
+%D \bTD[nx=3] \pagearea[header][text][middle] \eTD
+%D \eTR
+%D \bTR
+%D \bTD \pagearea[text][margin][left] \eTD
+%D \bTD[nx=2] \pagearea[text] \eTD
+%D \eTR
+%D \bTR
+%D \bTD[nx=3,offset=overlay]
+%D {\bTABLE[width=.5\hsize]
+%D \bTR
+%D \bTD \pagearea[bottom][text][right] \eTD
+%D \bTD \pagearea[footer][text][right] \eTD
+%D \eTR
+%D \eTABLE}
+%D \eTD
+%D \eTR
+%D \eTABLE
+%D \stoppagelayout
+%D
+%D \setupcolors[state=start]
+%D
+%D \setupbackgrounds[text][background=color,backgroundcolor=blue]
+%D \setupbackgrounds[header][text][background=color,backgroundcolor=red]
+%D
+%D \setuppagenumbering[alternative=doublesided,location=]
+%D
+%D \setuplayout[method=makeup]
+%D
+%D \definetextbackground
+%D [test]
+%D [state=start,
+%D background=color,
+%D backgroundcolor=yellow]
+%D
+%D \starttext
+%D
+%D \dorecurse{10}{\input tufte \par}
+%D
+%D \input tufte \starttest \input tufte \stoptest \input tufte
+%D
+%D \starttabulate
+%D \NC test \NC \starttest \input tufte \stoptest \NC \NR
+%D \stoptabulate
+%D
+%D \dorecurse{10}{\input tufte \par}
+%D
+%D \stoptext
+%D \stoptyping
+
+\unprotect
+
+\setvalue{\??ly\c!method\v!makeup}#1#2%
+ {\setbox\pagebox\hbox
+ {\vbox to \textheight
+ {\offinterlineskip
+ % optie
+ \vskip-1\topskip
+ \vskip\strutheight
+ %
+ \textwidth\makeupwidth
+ \hsize\textwidth
+ \boxmaxdepth\maxdepth
+ \noindent
+ \dopagecontents#1#2}}%
+ \wd\pagebox\makeupwidth
+ \ht\pagebox\textheight
+ \dp\pagebox\zeropoint
+ \hsize\paperwidth
+ \vsize\paperheight
+ \setbox\pagebox\vbox
+ {\doifbothsidesoverruled
+ \let\!!stringa\v!page
+ \orsideone
+ \let\!!stringa\v!rightpage
+ \orsidetwo
+ \let\!!stringa\v!leftpage
+ \od
+ \getvalue{\??ly\c!method:\!!stringa}}%
+ \wd\pagebox\paperwidth
+ \ht\pagebox\paperheight
+ \dp\pagebox\zeropoint}
+
+\newbox\pageareabox
+
+\def\pagearea
+ {\dotripleempty\dopagearea}
+
+\def\dopagearea[#1][#2][#3]%
+ {\ifthirdargument
+ \doifelse{#3}\v!left
+ {\dodopagearea{#1}{#2}\c!lefttext}
+ {\doifelse{#3}\v!right
+ {\dodopagearea{#1}{#2}\c!righttext}
+ {\dodopagearea{#1}{#2}\c!middletext}}%
+ \else\ifsecondargument
+ \doifbothsidesoverruled
+ \dodopagearea{#1}{#2}\c!righttext
+ \orsideone
+ \dodopagearea{#1}{#2}\c!righttext
+ \orsidetwo
+ \dodopagearea{#1}{#2}\c!lefttext
+ \od
+ \else
+ \doif{#1}\v!text % copy due to trial runs in TABLE
+ {\iftrialtypesetting
+ \copy\pagebox
+ \else
+ \setbox\pagebox\vbox
+ {\localstarttextcolor
+ \box\pagebox
+ \localstoptextcolor}%
+ \localpositioningfalse
+ \addtextbackground\pagebox
+ \addtextgridlayer\pagebox
+ \box\pagebox
+ \fi}%
+ \fi\fi}
+
+\def\dodopagearea#1#2#3%
+ {\setbox\pageareabox\vbox{\getvalue{\??tk#1#2#3}}%
+ \ifsomebackgroundfound{#1#2}%
+ \iftrialtypesetting
+ \box\pageareabox
+ \else
+ \localframed
+ [\??ma#1#2]
+ [\c!width=\wd\pageareabox,
+ \c!height=\ht\pageareabox,
+ \c!offset=\v!overlay]
+ {\box\pageareabox}%
+ \fi
+ \else
+ \box\pageareabox
+ \fi}
+
+\setvalue{\??ly\c!method:\v!leftpage }{\getvalue{\??ly\c!method:\v!page}}
+\setvalue{\??ly\c!method:\v!rightpage}{\getvalue{\??ly\c!method:\v!page}}
+
+% \long\def\startpagelayout[#1]#2\stoppagelayout
+% {\long\setvalue{\??ly\c!method:#1}{#2}}
+
+\long\def\startpagelayout
+ {\bgroup\catcode`\^^M=\@@ignore\dostartpagelayout}
+
+\long\def\dostartpagelayout[#1]#2\stoppagelayout
+ {\egroup\long\setvalue{\??ly\c!method:#1}{#2}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/page-run.tex b/Master/texmf-dist/tex/context/base/page-run.tex
index b44662d3c95..302a1b5a07b 100644
--- a/Master/texmf-dist/tex/context/base/page-run.tex
+++ b/Master/texmf-dist/tex/context/base/page-run.tex
@@ -32,7 +32,7 @@
[\c!offset=\v!overlay,\c!strut=\v!no,
\c!width=\paperwidth,\c!height=\paperheight]
{\ss ABC\par DEF}}%
- \dubbelzijdigfalse
+ \doublesidedfalse
\def\cutmarklength{.5em}%
\addpagecutmarks0%
\replicatepagebox0%
diff --git a/Master/texmf-dist/tex/context/base/page-set.tex b/Master/texmf-dist/tex/context/base/page-set.tex
index 76866c563d5..be744b2a184 100644
--- a/Master/texmf-dist/tex/context/base/page-set.tex
+++ b/Master/texmf-dist/tex/context/base/page-set.tex
@@ -52,6 +52,9 @@
\def\@otr@{otr}
+\let\OTRSETflushsidefloats \forgetsidefloats % \relax
+\let\OTRSETsynchronizesidefloats\forgetsidefloats % \relax
+
\def\OTRSETgridcell #1#2{\csname \@otr@:\number#1:\number#2\endcsname}
\def\OTRSETgetgridcell#1#2{\box\csname \@otr@:\number#1:\number#2\endcsname}
\def\OTRSETsetgridcell#1#2{\global\setbox\csname\@otr@:\number#1:\number#2\endcsname}
@@ -84,6 +87,72 @@
% \startcolumnset [three] \dorecurse {1}{\input tufte \par} \stopcolumnset
% \stoptext
+%D Marks in columnsets:
+%D
+%D \starttyping
+%D \definemarking[M]
+%D \setupheadertexts[\setups{show-M-marks}]
+%D \definecolumnset[test][n=3]
+%D
+%D \startsetups show-M-marks
+%D \getmarking[M][1][previous]/\getmarking[M][1][first]/\getmarking[M][1][last]\quad
+%D \getmarking[M][2][previous]/\getmarking[M][2][first]/\getmarking[M][2][last]\quad
+%D \getmarking[M][3][previous]/\getmarking[M][3][first]/\getmarking[M][3][last]\quad
+%D \getmarking[M][1][previous]/\getmarking[M][1][first]/\getmarking[M][last]\quad
+%D \getsavedmarking[M][previous]/\getsavedmarking[M][first]/\getsavedmarking[M][last]
+%D \stopsetups
+%D
+%D \startbuffer
+%D \section{Knuth} [K1]\marking[M]{k1} [K2]\marking[M]{k2} \input knuth
+%D \section{Zapf} [Z]\marking[M]{z} \input zapf
+%D \stopbuffer
+%D
+%D \startbuffer
+%D \section{Ward} [W]\marking[M]{w} \input ward
+%D \placefigure[here]{none}{\externalfigure[a][height=2cm]}
+%D \section{Davis} [D]\marking[M]{d} \input davis
+%D \section{Zapf} [Z]\marking[M]{z} \input zapf
+%D \stopbuffer
+%D
+%D \startbuffer
+%D \section{Ward} [W]\marking[M]{w} \input ward
+%D \placefigure[here]{none}{\externalfigure[a][height=2cm]}
+%D \section{Davis} [D]\marking[M]{d} \input davis
+%D \section{Zapf} [Z]\marking[M]{z} \input zapf
+%D \section{Douglas} [O]\marking[M]{o} \input douglas
+%D \stopbuffer
+%D
+%D \starttext
+%D \startcolumnset[test]
+%D \dorecurse{5}{\getbuffer}
+%D \placefigure[here]{none}{\externalfigure[a][height=2cm]}
+%D % \column % sometimes needed
+%D \stopcolumnset
+%D \stoptext
+%D \stoptyping
+
+% not ok yet, for column sets we need a special case: within a column we
+% need to bubble-up the marks; the indirectness permits overloading here
+
+\let\saveOTRSETmark \refreshsavedmark
+\let\bubbleOTRSETmark\bubblesavedmark
+\let\resetOTRSETmark \resetsavedmark
+\let\presetOTRSETmark\presetsavedmark
+
+\def\doregisterOTRSETmarks#1{\saveOTRSETmark [#1][\number\mofcolumns]}
+\def\dobubbleOTRSETmarks #1{\bubbleOTRSETmark[#1][\number\mofcolumns]}
+\def\doresetOTRSETmarks #1{\resetOTRSETmark [#1][\recurselevel]}
+\def\dopresetOTRSETmarks #1{\presetOTRSETmark[#1][\recurselevel]}
+
+\def\registerOTRSETmarks
+ {\processcommacommand[\alldefinedmarks]\doregisterOTRSETmarks}
+\def\bubbleOTRSETmarks
+ {\processcommacommand[\alldefinedmarks]\dobubbleOTRSETmarks}
+\def\resetOTRSETmarks
+ {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\doresetOTRSETmarks}}
+\def\presetOTRSETmarks
+ {\dorecurse\nofcolumns{\processcommacommand[\alldefinedmarks]\dopresetOTRSETmarks}}
+
%D test case of Vit Zika (context list):
%D
%D \starttyping
@@ -529,17 +598,19 @@
\def\OTRSETdoflush
{\ifcollectingcontent
+ \registerOTRSETmarks
\global\mofcolumns\plusone
\else
\OTRSETdofinalflush
\OTRSETdofinaloutput
-\ifnum\columnsetpage>0
- \dorecurse\nofcolumns{\doresetcolumnsetlines\recurselevel}%
-\fi
-\doglobal\increment\columnsetpage
+ \ifnum\columnsetpage>0
+ \dorecurse\nofcolumns{\doresetcolumnsetlines\recurselevel}%
+ \fi
+ \doglobal\increment\columnsetpage
\OTRSETinitializecolumns
%\OTRSETdoflushfloats
\OTRSETstartnextpage
+\presetOTRSETmarks
\initializecolumntextareas
\fi}
@@ -893,7 +964,9 @@
{\OTRSETsetfreecells\mofcolumns\columnlastcell
\ifsomefreecolumncells
% okay
+ \bubbleOTRSETmarks % not robust because we reenter
\else
+ \registerOTRSETmarks % not robust because we reenter
\global\advance\mofcolumns \plusone
\ifnum\mofcolumns>\nofcolumns
\OTRSETdoflush
@@ -1708,6 +1781,7 @@
{\increment\columnsetlevel\relax
\globallet\localcolumnmaxcells\!!zerocount
\global\chardef\OTRSETfinish\zerocount
+ \resetOTRSETmarks
\ifnum\columnsetlevel=\plusone
\bgroup
\saveinterlinespace
@@ -1725,6 +1799,31 @@
\bgroup
\fi}
+% \setuplayout[grid=yes] \definecolumnset[example] \showgrid
+
+% \starttext
+% \startcolumnset[example]
+% \input knuth \endgraf \input knuth
+% \placetable{table}{\framed[width=\makeupwidth,height=4cm]{Hello}}
+% \input knuth \endgraf \input knuth
+% \stopcolumnset
+% \input knuth \endgraf \input knuth
+% \stoptext
+
+
+\def\OTRSETflushleftovers % new per 13/4/2006
+ {\OTRSETdoifcellelse{1}{1}
+ {\bgroup
+ \OTRSETcentergridcells
+ \chardef\OTRSETbalancemethod\plusone
+ \OTRSETreducegridbox
+ \global\setbox\OTRfinalpagebox\OTRSETmakegridbox
+ \global\ht\OTRfinalpagebox\textheight % signals output that there is content
+ \OTRSETdofinaloutput
+ \globallet\OTRSETbalht\zeropoint
+ \egroup}
+ {}}
+
\def\stopcolumnset
{\relax
\ifnum\columnsetlevel=\plusone
@@ -1746,6 +1845,7 @@
\fi
\global\chardef\OTRSETfinish\zerocount
\ifsomefloatwaiting \setvsize \pagebreak \setvsize \fi
+ \OTRSETflushleftovers
\else
\egroup
\fi
@@ -1875,7 +1975,7 @@
{\vskip-\struttotal\verticalstrut\vfill\eject}%
\else
\ifnum\mofcolumns>\plusone
- \donetrue
+ \donetrue
\else\ifdim\pagetotal>\zeropoint % too dangerous, we loose data
\donetrue
\else
@@ -1889,6 +1989,7 @@
\fi
\vfill
\eject
+\registerOTRSETmarks
% brr, may result in empty page after nicely fit text
% or if left, then lost of first column only text
\ifnum\mofcolumns>\plusone
@@ -1944,12 +2045,26 @@
\donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}%
\egroup}}
+% \OTRSEToutput
+% {\dontcomplain % new, get rid of overfull message (to be sorted out)
+% \OTRSETnaturalflush
+% %\OTRSETstartnextpage
+% \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong)
+% \OTRSETcheckfreelines
+% \OTRSETchecksidefloat}
+
\OTRSEToutput
{\dontcomplain % new, get rid of overfull message (to be sorted out)
- \OTRSETnaturalflush
- %\OTRSETstartnextpage
- \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong)
- \OTRSETcheckfreelines
+ \doloop
+ {\OTRSETnaturalflush
+ %\OTRSETstartnextpage % no
+ \OTRSETdoflushfloats % actually belongs in \flushsavedfloats (but goes wrong)
+ \OTRSETcheckfreelines
+ \ifsomefreecolumncells
+ \exitloop
+ \else
+ % flush page and get rid of more floats if present
+ \fi}%
\OTRSETchecksidefloat}
\def\OTRSETinitializefeatures
@@ -2596,7 +2711,7 @@
\advance\!!widthb -\!!countc\textwidth
\ifodd\realpageno \else % tricky, assumes that we keep there
\ifcase\!!countc\else
- % nog niet ok voor enkel/dubbelzijdig
+ % nog niet ok voor enkel/doublesided
\advance\!!widtha \namedlayoutparameter\v!even\c!backspace
\advance\!!widtha \namedlayoutparameter\v!odd \c!backspace
\advance\!!widthb \namedlayoutparameter\v!even\c!backspace
@@ -2627,6 +2742,7 @@
\c!depthcorrection=\v!off,
\c!n=2,
\c!nlines=0,
+ \c!indenting=,
\c!indentnext=\v!yes,
\c!default=HERE,
\c!alternative=\v!a,
@@ -2732,7 +2848,7 @@
% todo : \v!here -> here enzovoorts
\OTRSETstoreincolumnslot\floatmethod\scratchbox
% watch out: no \dochecknextindentation{tag}
- \checknextindentation[\framedtextparameter{cs:#1}\c!indentnext]
+ \checknextindentation[\framedtextparameter{cs:#1}\c!indentnext]%
\else
% of course we needed a one-column fall back for tm; brrr, the box has now too
% much height (try \ruledvbox); don't change this without testing techniek
diff --git a/Master/texmf-dist/tex/context/base/page-sid.tex b/Master/texmf-dist/tex/context/base/page-sid.tex
index 882464fc375..499f34f936f 100644
--- a/Master/texmf-dist/tex/context/base/page-sid.tex
+++ b/Master/texmf-dist/tex/context/base/page-sid.tex
@@ -77,6 +77,8 @@
\def\rightedgefloat {\global\chardef\sidefloattype7 \putsidefloat}
\def\cutspacefloat {\global\chardef\sidefloattype8 \putsidefloat}
+\let\marginfloat \cutspacefloat
+
\newif\ifroomforfloat
\newif\iffloatshort
\newif\iffloatflag
@@ -864,4 +866,22 @@
\kern-\!!counta\baselineskip
\penalty\zerocount }
+% We need to hook it into the other otr's. This code will move.
+
+\let\OTRONEflushsidefloats \flushsidefloats
+\let\OTRONEsynchronizesidefloats\synchronizesidefloats
+
+% page-set
+%
+% \let\OTRSETflushsidefloats \forgetsidefloats
+% \let\OTRSETsynchronizesidefloats\forgetsidefloats
+
+% page-mul
+%
+% \let\OTRMULflushsidefloats \forgetsidefloats
+% \let\OTRMULsynchronizesidefloats\forgetsidefloats
+
+\def\synchronizesidefloats{\OTRcommand\synchronizesidefloats}
+\def\flushsidefloats {\OTRcommand\flushsidefloats}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/page-spr.tex b/Master/texmf-dist/tex/context/base/page-spr.tex
index c90e9cf0f8b..53d50875240 100644
--- a/Master/texmf-dist/tex/context/base/page-spr.tex
+++ b/Master/texmf-dist/tex/context/base/page-spr.tex
@@ -60,7 +60,7 @@
\def\startspread
{\bgroup
- \ifdubbelzijdig
+ \ifdoublesided
\page[\v!left]%
%\setsystemmode{spread}%
\inspreadtrue
diff --git a/Master/texmf-dist/tex/context/base/page-str.tex b/Master/texmf-dist/tex/context/base/page-str.tex
new file mode 100644
index 00000000000..ca6504598ab
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/page-str.tex
@@ -0,0 +1,366 @@
+%D \module
+%D [ file=page-str,
+%D version=2006.03.21,
+%D title=\CONTEXT\ Core Macros,
+%D subtitle=Page Streams,
+%D author=Hans Hagen,
+%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.
+
+\writestatus{loading}{Context Page Macros / Page Streams}
+
+%D The first version of this component of \CONTEXT\ was written
+%D for Thomas Schmitz who asked for parallel page streams. While
+%D playing with the code, I decided to make it into a component
+%D that can be used to construct all kind of stream related
+%D mechanisms. Because I could apply this feature in a project,
+%D there is some additional code here (related to graphics).
+%D
+%D These macros were written while listening to and watching the DVD
+%D \quotation {Rush In Rio}.
+
+\unprotect
+
+% taco, what is the best way to append a otr chunk (insert pagediscards?)
+
+\let\currentoutputstream\s!default
+
+\newtoks\defaultstreamoutput \defaultstreamoutput=\OTRONEoutput
+
+\newtoks\normalstreamoutput \normalstreamoutput={\saveoutputstream[\currentoutputstream]}
+
+\newcount\streampenalty \streampenalty=-101010101
+
+\ifx\multicolumnseject\undefined \else
+ \let\normalmulticolumnseject\multicolumnseject
+ \def\multicolumnseject{\ifinoutputstream\else\normalmulticolumnseject\fi}
+\fi
+
+\newif\ifinoutputstream
+
+\newtoks \everyenableoutputstream
+
+\appendtoks
+ \flushsidefloats
+\to \everyenableoutputstream
+
+\def\enableoutputstream[#1]%
+ {\the\everyenableoutputstream
+ \finishoutputstream
+ \writestatus{otr}{switching to output stream #1}%
+ \inoutputstreamtrue
+ \xdef\currentoutputstream{#1}}
+
+\def\disableoutputstream
+ {\finishoutputstream
+ \writestatus{otr}{switching to default output stream}%
+ \inoutputstreamfalse
+ \global\let\currentoutputstream\s!default}
+
+\def\useoutputstream[#1]%
+ {\writestatus{otr}{using output stream #1}%
+ \xdef\currentoutputstream{#1}}
+
+\def\handlestreamoutput
+ {\doifelse\currentoutputstream\s!default
+ {\ifnum\outputpenalty=\streampenalty
+ \ifvoid\normalpagebox \else
+ \unvbox\normalpagebox
+ \fi
+ \else
+ \the\defaultstreamoutput
+ \fi}
+ {\the\normalstreamoutput}}
+
+\OTRONEoutput{\handlestreamoutput}
+
+\def\defineoutputstream[#1]%
+ {\doifundefined{otrs:#1}{\expandafter\newbox\csname otrs:#1\endcsname}}
+
+\def\outputstreamtag#1%
+ {\csname otrs:#1\endcsname}
+
+\def\finishoutputstream % todo: installoutput
+ {\endgraf
+ \penalty\streampenalty
+ \endgraf}
+
+\def\saveoutputstream[#1]%
+ {\writestatus{otr}{saving otr stream #1}%
+ \ifvoid\normalpagebox
+ \global\setbox\outputstreamtag{#1}\voidbox
+ \else
+ \global\setbox\outputstreamtag{#1}\vbox
+ {\presetoutputstream
+ \ifvoid\outputstreamtag{#1}\else\unvbox\outputstreamtag{#1}\fi
+ \scratchdimen\dp\normalpagebox
+ \unvbox\normalpagebox
+ \vskip-\scratchdimen
+ \kern\strutdepth}%
+ \fi}
+
+% \def\presetoutputstream
+% {\pdffirstlineheight\strutheight
+% \pdflastlinedepth \strutdepth
+% \pdfeachlineheight \strutheight
+% \pdfeachlinedepth \strutdepth}
+
+\let\presetoutputstream\relax
+
+\def\outputstreambox [#1]{\ifvoid\outputstreamtag{#1}\else\box \outputstreamtag{#1}\fi}
+\def\outputstreamcopy[#1]{\ifvoid\outputstreamtag{#1}\else\copy\outputstreamtag{#1}\fi}
+\def\outputstreamht [#1]{\ht\outputstreamtag{#1}}
+\def\outputstreamdp [#1]{\dp\outputstreamtag{#1}}
+\def\outputstreamwd [#1]{\wd\outputstreamtag{#1}}
+
+%D Footnotes don't go along with streams, simply because there is no
+%D way to re-split inserts. A dirty way out is to use marks and store
+%D notes that way.
+
+\def\definemarknote
+ {\dodoubleempty\dodefinemarknote}
+
+\def\dodefinemarknote[#1][#2]%
+ {\definemarking[mn:#1]%
+ \setvalue{mn:#1:n}{0}%
+ \getparameters
+ [mn:#1]
+ [\c!before=,
+ \c!after=,
+ \c!inbetween=\endgraf,
+ \c!command=\firstofoneargument,
+ #2]}
+
+\def\setmarknote[#1]#2%
+ {\doglobal\incrementvalue{mn:#1:n}%
+ \setgvalue{mn:#1:t:\getvalue{mn:#1:n}}{#1}%
+ \expanded{\marking[#1]{\getvalue{mn:#1:n}}}}
+
+\def\flushmarknotes[#1]% assumes split
+ {\begingroup
+ \edef\firstmarknote{0\fetchmark[mn:#1][column:first]}%
+ \edef\lastmarknote {0\fetchmark[mn:#1][column:last]}%
+ \ifnum\firstmarknote<\lastmarknote\relax
+ \getvalue{mn:#1\c!before}%
+ \dostepwiserecurse\firstmarknote\lastmarknote\plusone
+ {\ifnum\recurselevel>\firstmarknote\relax
+ \ifnum\recurselevel<\lastmarknote\relax
+ \getvalue{mn:#1\c!inbetween}%
+ \fi
+ \fi
+ \getvalue{mn:#1\c!command}{\getvalue{mn:#1:t:\recurselevel}}}%
+ \getvalue{mn:#1\c!after}%
+ \fi
+ \endgroup}
+
+\def\erasemarknotes[#1]%
+ {\begingroup
+ \edef\firstmarknote{0\fetchmark[mn:#1][column:first]}%
+ \edef\lastmarknote {0\fetchmark[mn:#1][column:last]}%
+ \dostepwiserecurse\firstmarknote\lastmarknote\plusone
+ {\global\letvalue{mn:#1:t:\recurselevel}\empty}%
+ \endgroup}
+
+%D The next section implements synchronization of (currently
+%D two) output streams. In due time we will implement both a
+%D vertical and horizontal system, as well as alternative
+%D splitters (firstpagevsize, succesivevsize etc).
+
+\def\synchronizeoutputstreams[#1]% [one,two] [left,right]
+ {\bgroup
+ \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement
+ \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement
+ \forgeteverypar
+ \def\roundingeps{50sp}%
+ \getboxheight\dimen0\of\box\outputstreamtag\firstoutputstream
+ \getboxheight\dimen2\of\box\outputstreamtag\secondoutputstream
+ \scratchdimen\dimexpr\dimen0-\dimen2\relax
+ \ifdim\scratchdimen<-\roundingeps\relax
+ \scratchdimen-\scratchdimen
+ \writestatus{sync}{compensating first stream: \the\scratchdimen/\number\scratchdimen}%
+ \getroundednoflines\scratchdimen
+ \global\setbox\outputstreamtag\firstoutputstream\vbox
+ {\presetoutputstream
+ \unvbox\outputstreamtag\firstoutputstream\dorecurse\noflines\crlf}%
+ \else\ifdim\scratchdimen>\roundingeps\relax
+ \writestatus{sync}{compensating second stream: \the\scratchdimen/\number\scratchdimen}%
+ \getroundednoflines\scratchdimen
+ \global\setbox\outputstreamtag\secondoutputstream\vbox
+ {\presetoutputstream
+ \unvbox\outputstreamtag\secondoutputstream\dorecurse\noflines\crlf}%
+ \else
+ \writestatus{sync}{no need to compensate streams: \the\scratchdimen/\number\scratchdimen}%
+ \fi\fi
+ \egroup}
+
+\def\nofoutputstreamsplitlines {\v!auto} % {40}
+\def\outputstreamsplittolerance {-5}
+
+\def\flushoutputstreampages[#1]%
+ {\bgroup
+ \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement
+ \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement
+ \doloop
+ {\flushoutputstreams[#1]%
+ \ifvoid\outputstreamtag\firstoutputstream
+ \ifvoid\outputstreamtag\secondoutputstream
+ \exitloop
+ \else
+ \global\setbox\outputstreamtag\firstoutputstream\vbox{\strut}%
+ \fi
+ \else
+ \ifvoid\outputstreamtag\secondoutputstream
+ \global\setbox\outputstreamtag\secondoutputstream\vbox{\strut}%
+ \else
+ % okay
+ \fi
+ \fi}%
+ \egroup}
+
+\def\flushoutputstreams[#1]%
+ {\bgroup
+ \getfromcommalist[#1][\plusone]\let\firstoutputstream \commalistelement
+ \getfromcommalist[#1][\plustwo]\let\secondoutputstream\commalistelement
+ \doif\nofoutputstreamsplitlines\v!auto
+ {\getrawnoflines\textheight
+ \edef\nofoutputstreamsplitlines{\the\noflines}}%
+ \splittopskip\strutheight
+ \scratchdimen\nofoutputstreamsplitlines\lineheight\relax
+ \unless\iffalse
+ \dimen0\scratchdimen
+ \doloop
+ {\setbox4\copy\outputstreamtag\firstoutputstream
+ \setbox0\vsplit4 to \dimen0
+ \setbox0\vbox
+ {\directsetup{stream:\firstoutputstream:top}%
+ \unvbox0
+ \directsetup{stream:\firstoutputstream:bottom}}%
+ \ifdim\ht0>\scratchdimen
+ \advance\dimen0-\lineheight
+ \else
+ \exitloop
+ \fi}%
+ \scratchdimen\dimen0
+ \dimen2\scratchdimen
+ \doloop
+ {\setbox6\copy\outputstreamtag\secondoutputstream
+ \setbox2\vsplit6 to \dimen2
+ \setbox2\vbox
+ {\directsetup{stream:\secondoutputstream:top}%
+ \unvbox0
+ \directsetup{stream:\secondoutputstream:bottom}}%
+ \ifdim\ht2>\scratchdimen
+ \advance\dimen2-\lineheight
+ \else
+ \exitloop
+ \fi}%
+ \scratchdimen\dimen2
+ \fi
+ \setbox4\copy\outputstreamtag\firstoutputstream
+ \setbox6\copy\outputstreamtag\secondoutputstream
+ \scratchcounter\zerocount
+ \doloop
+ {\setbox0\vsplit4 to \scratchdimen
+ \setbox0\vbox{\unvbox0}%
+ \setbox2\vsplit6 to \scratchdimen
+ \setbox2\vbox{\unvbox2}%
+ \ifvoid4
+ \exitloop
+ \else\ifvoid6
+ \exitloop
+ \else
+ \dimen8=\dimexpr\ht4-\ht6\relax
+ \ifdim\dimen8<\zeropoint\dimen8=-\dimen8\relax\fi
+ \advance\scratchcounter\plusone
+ \ifdim\dimen8<.5\lineheight
+ \exitloop
+ \else\ifnum\outputstreamsplittolerance>\zeropoint
+ \ifnum\scratchcounter>\outputstreamsplittolerance\relax
+ \exitloop
+ \else
+ \advance\scratchdimen\lineheight
+ \fi
+ \else\ifnum\outputstreamsplittolerance<\zeropoint
+ \ifnum-\scratchcounter<\outputstreamsplittolerance\relax
+ \exitloop
+ \else
+ \advance\scratchdimen-\lineheight
+ \fi
+ \else\ifnum\outputstreamsplittolerance=\zeropoint
+ \exitloop
+ \fi\fi\fi\fi
+ \fi\fi}%
+ \setbox0\vsplit\outputstreamtag\firstoutputstream to \scratchdimen
+ \setbox0\vbox to \textheight
+ {\presetoutputstream
+ \directsetup{stream:\firstoutputstream:top}%
+ \unvbox0
+ \vfill
+ \directsetup{stream:\firstoutputstream:bottom}}%
+ \setbox2\vsplit\outputstreamtag\secondoutputstream to \scratchdimen
+ \setbox2\vbox to \textheight
+ {\presetoutputstream
+ \directsetup{stream:\secondoutputstream:top}%
+ \unvbox2
+ \vfill
+ \directsetup{stream:\secondoutputstream:bottom}}%
+ \directsetup{stream:\firstoutputstream:reset}%
+ \directsetup{stream:\secondoutputstream:reset}%
+ \page[even]
+ \box0\vfill\page
+ \box2\vfill\page
+ \egroup}
+
+%D Although one can put floats in a stream, it sometimes makes sense
+%D to keep them apart and this is what local floats do.
+
+\def\setuplocalfloats
+ {\getparameters[\??lf]}
+
+\setuplocalfloats
+ [%before=\blank,
+ %after=\blank,
+ inbetween=\blank]
+
+\installfloathandler \v!local \somelocalfloat
+
+\initializeboxstack{localfloats}
+
+\newcounter\noflocalfloats
+
+\def\resetlocalfloats
+ {\doglobal\newcounter\noflocalfloats
+ \initializeboxstack{localfloats}}
+
+\def\somelocalfloat[#1]%
+ {\doglobal\increment\noflocalfloats
+ \savebox{localfloats}{\noflocalfloats}{\box\floatbox}}
+
+\def\getlocalfloats
+ {\dorecurse\noflocalfloats
+ {\ifnum\recurselevel=\plusone % 1\relax
+ \getvalue{\??lf\c!before}%
+ \else
+ \getvalue{\??lf\c!inbetween}%
+ \fi
+ \dontleavehmode\hbox{\foundbox{localfloats}\recurselevel}%
+ \ifnum\recurselevel=\noflocalfloats\relax
+ \getvalue{\??lf\c!after}%
+ \fi}}
+
+\def\flushlocalfloats
+ {\getlocalfloats
+ \resetlocalfloats}
+
+\def\getlocalfloat#1{\expanded{\foundbox{localfloats}{\number#1}}}
+
+\def\forcelocalfloats{\let\forcedfloatmethod\v!local}
+
+%D Because many arrangements are possible, we will implement
+%D some examples in a runtime loadable module \type {m-streams}.
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/page-txt.tex b/Master/texmf-dist/tex/context/base/page-txt.tex
index a36bf92568e..14707a5eb5e 100644
--- a/Master/texmf-dist/tex/context/base/page-txt.tex
+++ b/Master/texmf-dist/tex/context/base/page-txt.tex
@@ -67,15 +67,36 @@
\def\setuplayouttext
{\dotripleempty\dosetuplayouttext}
+% \def\dosetuplayouttext[#1][#2][#3]%
+% {\ifthirdargument
+% \getparameters[\??tk#1#2][#3]%
+% \else
+% %\getparameters[\??tk#1\v!text][#2]%
+% \edef\previoustextstate{\getvalue{\??tk#1\c!state}}%
+% \getparameters[\??tk#1][#2]%
+% \doifnotvalue{\??tk#1\c!state}\previoustextstate
+% {%\checkcurrentlayout % no
+% \calculatevsizes
+% \recalculatebackgrounds
+% \recalculatelogos}%
+% \fi}
+
\def\dosetuplayouttext[#1][#2][#3]%
{\ifthirdargument
\getparameters[\??tk#1#2][#3]%
\else
%\getparameters[\??tk#1\v!text][#2]%
+ \edef\previoustextstate{\getvalue{\??tk#1\c!state}}%
\getparameters[\??tk#1][#2]%
- \fi
- %\checkcurrentlayout % no
- \calculatevsizes}
+ \doifnotvalue{\??tk#1\c!state}\previoustextstate
+ {%\checkcurrentlayout % no
+ \edef\currenttextstate{\getvalue{\??tk#1\c!state}}%
+ % speed optimization (calculating backgrounds takes time)
+ \doifcommon{\previoustextstate,\currenttextstate}{\v!high,\v!none}{%
+ \calculatevsizes
+ \recalculatebackgrounds
+ \recalculatelogos}}%
+ \fi}
\def\setuptop {\dotripleempty\dosetuplayouttext[\v!top]}
\def\setupheader {\dotripleempty\dosetuplayouttext[\v!header]}
@@ -220,12 +241,15 @@
\appendtoks \placelayouttextline\v!footer\footerheight \to \footertextcontent
\appendtoks \placelayouttextline\v!bottom\bottomheight \to \bottomtextcontent
-%D Texts can be disables, moved up and ignored, depending in
+%D Texts can be disabled, moved up and ignored, depending in
%D the \type {status} variable. This is handled by the next
%D couple of macros.
\def\settextlinestatus #1{\edef\textlinestatus{\csname\??tk#1\c!state\endcsname}}
-\def\resettextlinestatus#1{\letgvalue{\??tk#1\c!state}\v!normal}
+%def\resettextlinestatus#1{\letgvalue{\??tk#1\c!state}\v!normal}
+
+\def\resettextlinestatus#1% postpone
+ {\setgvalue{\??tk#1\s!reset}{\letgvalue{\??tk#1\c!state}\v!normal}}
\def\placelayouttextline#1% #2
{\settextlinestatus{#1}%
@@ -237,10 +261,35 @@
\fi
\endcsname{#1}} % {#2}
-\setvalue{\string\placelayouttextline\v!normal}{\doplacelayouttextline}
+\def\doifelselayouttextline#1% shown or not
+ {\doifinsetelse{\getvalue{\??tk#1\c!state}}{\v!normal,\v!start}}
+
+\def\doifelselayoutsomeline#1% present or not
+ {\edef\!!stringa{\csname\??tk#1\c!state\endcsname}%
+ \ifx\!!stringa\v!none
+ \@EA\secondoftwoarguments
+ \else\ifx\!!stringa\v!high
+ \@EAEAEA\secondoftwoarguments
+ \else
+ \@EAEAEA\firstoftwoarguments
+ \fi\fi}
+
+% \doplacelayouttextline does the actual placement (when a non-zero height)
+
+\newconditional\resyncaftertextline
+
+\setvalue{\string\placelayouttextline\v!normal }{\doplacelayouttextline}
\setvalue{\string\placelayouttextline }{\doplacelayouttextline}
-\letvalue{\string\placelayouttextline\v!none }\gobbletwoarguments
-\letvalue{\string\placelayouttextline\v!high }\gobbletwoarguments
+
+\setvalue{\string\placelayouttextline\v!none}#1#2%
+ {}
+
+% \setvalue{\string\placelayouttextline\v!high}#1#2%
+% {\global\settrue\resyncaftertextline}
+
+\setvalue{\string\placelayouttextline\v!high}#1#2%
+ {\global\settrue\resyncaftertextline
+ \resettextlinestatus{#1}}
\setvalue{\string\placelayouttextline\v!empty}#1#2%
{\resettextlinestatus{#1}}
@@ -260,40 +309,62 @@
\egroup}
\setvalue{\string\placelayouttextline\s!unknown}#1#2%
- {\bgroup % new
+ {\global\settrue\resyncaftertextline
+ \bgroup % new
\resettextlinestatus{#1}%
\getvalue{\??tk#1\textlinestatus}%
- \getvalue{\??tk#1\v!text\textlinestatus}%
+ \getvalue{\??tk#1\v!text \textlinestatus}%
\getvalue{\??tk#1\v!margin\textlinestatus}%
- \getvalue{\??tk#1\v!edge\textlinestatus}%
+ \getvalue{\??tk#1\v!edge \textlinestatus}%
\doplacelayouttextline{#1}{#2}%
\egroup}
%D The following macro has to be called after a page
%D is flushed.
-\def\resetlayouttextline#1% beware: global assignment
- {\doifvalue{\??tk#1\c!state}\v!high
- {\resettextlinestatus{#1}%
- \donetrue}}
+% \def\resetlayouttextline#1%
+% {\doifvalue{\??tk#1\c!state}\v!high
+% {\global\settrue\resyncaftertextline
+% \resettextlinestatus{#1}}}
+
+\def\resetlayouttextline#1%
+ {\getvalue {\??tk#1\s!reset}%
+ \letgvalue{\??tk#1\s!reset}\relax}
+
+% \def\resetlayouttextlines
+% {\resetlayouttextline\v!top
+% \resetlayouttextline\v!header
+% \resetlayouttextline\v!text
+% \resetlayouttextline\v!footer
+% \resetlayouttextline\v!bottom
+% \ifconditional\resyncaftertextline
+% \doglobal\calculatevsizes
+% \recalculatebackgrounds
+% \recalculatelogos
+% \global\setfalse\resyncaftertextline
+% \fi}
\def\resetlayouttextlines
- {\donefalse
- \resetlayouttextline\v!top
+ {\resetlayouttextline\v!top
\resetlayouttextline\v!header
\resetlayouttextline\v!text
\resetlayouttextline\v!footer
\resetlayouttextline\v!bottom
- \ifdone
+ \ifconditional\resyncaftertextline
\doglobal\calculatevsizes
\recalculatebackgrounds
\recalculatelogos
+ \global\setfalse\resyncaftertextline
\fi}
%D The next series of macros is not that easy to read,
%D because they hook into the main page building macros. By
%D using token list registers for the text content, we can
%D easily hook in other code, like menu generators.
+%D
+%D Beware: the token lists are always expanded, also when the
+%D height of an area is zero. This is because reset actions can
+%D be part of them.
\newbox\scratchpagebox
@@ -305,15 +376,11 @@
\offinterlineskip
\vskip-\topheight
\vskip-\topdistance
- \ifdim\topheight>\zeropoint
- \the\toptextcontent
- \vskip\topheight
- \fi
+ \the\toptextcontent
+ \vskip\topheight
\vskip\topdistance
- \ifdim\headerheight>\zeropoint
- \the\headertextcontent
- \vskip\headerheight
- \fi
+ \the\headertextcontent
+ \vskip\headerheight
\vskip\headerdistance
\placepositionanchors
\vskip-\textheight
@@ -321,15 +388,11 @@
\vskip\textheight
\the\everyendoftextbody
\vskip\footerdistance
- \ifdim\footerheight>\zeropoint
- \the\footertextcontent
- \vskip\footerheight
- \fi
+ \the\footertextcontent
+ \vskip\footerheight
\vskip\bottomdistance
- \ifdim\bottomheight>\zeropoint
- \the\bottomtextcontent
- \vskip\bottomheight
- \fi
+ \the\bottomtextcontent
+ \vskip\bottomheight
\vfilll}%
\smashbox\scratchpagebox
\box\scratchpagebox}
diff --git a/Master/texmf-dist/tex/context/base/prop-lay.tex b/Master/texmf-dist/tex/context/base/prop-lay.tex
index 749848fa812..0e5038d1999 100644
--- a/Master/texmf-dist/tex/context/base/prop-lay.tex
+++ b/Master/texmf-dist/tex/context/base/prop-lay.tex
@@ -27,8 +27,8 @@
\def\checklayerproperty
{\doifelse{\checkedpropertyparameter\v!printable\currentproperty}\v!no
- {\def\printviewerlayer{0}}%
- {\def\printviewerlayer{1}}
+ {\def\printviewerlayer{0}}
+ {\def\printviewerlayer{1}}%
\dodefineviewerlayer
\currentproperty % tag
{\checkedpropertyparameter\c!title\currentproperty}%
@@ -36,11 +36,15 @@
{0}% type (1=frozen)
{\printviewerlayer}}% 1=printable
+\let\currentlayerproperty\empty
+
\def\startlayerproperty
- {\dostartviewerlayer\currentproperty}
+ {\let\currentlayerproperty\currentproperty
+ \dostartviewerlayer\currentproperty}
\def\stoplayerproperty
- {\dostopviewerlayer}
+ {\dostopviewerlayer
+ \let\currentlayerproperty\previousproperty}
\setglobalsystemreference \rt!exec \v!HideLayer {hidelayer}
\setglobalsystemreference \rt!exec \v!VideLayer {videlayer}
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1250.tex b/Master/texmf-dist/tex/context/base/regi-cp1250.tex
new file mode 100644
index 00000000000..b92eb5e31a2
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-cp1250.tex
@@ -0,0 +1,153 @@
+%D \module
+%D [ file=regi-cp1250,
+%D version=2005.12.26,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=cp1250 (East European),
+%D author=script-generated,
+%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.
+
+%D Support for cp1250 input encoding (regime) for Central European languages,
+%D see also iso-8859-2.
+%D
+%D Usage:
+%D \type{\enableregime[cp1250]} or \type{\enablereregime[windows-1250]}
+
+
+\startregime[cp1250]
+
+\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN
+\defineactivetoken 129 {\unknownchar} % <undefined>
+\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK
+\defineactivetoken 131 {\unknownchar} % <undefined>
+\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK
+\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS
+\defineactivetoken 134 {\textdag} % 2020 DAGGER
+\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER
+\defineactivetoken 136 {\unknownchar} % <undefined>
+\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN
+\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON
+\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 140 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE
+\defineactivetoken 141 {\Tcaron} % 0164 LATIN CAPITAL LETTER T WITH CARON
+\defineactivetoken 142 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON
+\defineactivetoken 143 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE
+\defineactivetoken 144 {\unknownchar} % <undefined>
+\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK
+\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK
+\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK
+\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK
+\defineactivetoken 149 {\textbullet} % 2022 BULLET
+\defineactivetoken 150 {\endash} % 2013 EN DASH
+\defineactivetoken 151 {\emdash} % 2014 EM DASH
+\defineactivetoken 152 {\unknownchar} % <undefined>
+\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN
+\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON
+\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 156 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE
+\defineactivetoken 157 {\tcaron} % 0165 LATIN SMALL LETTER T WITH CARON
+\defineactivetoken 158 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON
+\defineactivetoken 159 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\textcaron} % 02C7 CARON
+\defineactivetoken 162 {\textbreve} % 02D8 BREVE
+\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE
+\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
+\defineactivetoken 165 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK
+\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN
+\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\textogonek} % 02DB OGONEK
+\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE
+\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT
+\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN
+\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA
+\defineactivetoken 185 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK
+\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\Lcaron} % 013D LATIN CAPITAL LETTER L WITH CARON
+\defineactivetoken 189 {\texthungarumlaut} % 02DD DOUBLE ACUTE ACCENT
+\defineactivetoken 190 {\lcaron} % 013E LATIN SMALL LETTER L WITH CARON
+\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE
+\defineactivetoken 192 {\Racute} % 0154 LATIN CAPITAL LETTER R WITH ACUTE
+\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE
+\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 195 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE
+\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+\defineactivetoken 197 {\Lacute} % 0139 LATIN CAPITAL LETTER L WITH ACUTE
+\defineactivetoken 198 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE
+\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA
+\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON
+\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK
+\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS
+\defineactivetoken 204 {\Ecaron} % 011A LATIN CAPITAL LETTER E WITH CARON
+\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE
+\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 207 {\Dcaron} % 010E LATIN CAPITAL LETTER D WITH CARON
+\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE
+\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE
+\defineactivetoken 210 {\Ncaron} % 0147 LATIN CAPITAL LETTER N WITH CARON
+\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 213 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN
+\defineactivetoken 216 {\Rcaron} % 0158 LATIN CAPITAL LETTER R WITH CARON
+\defineactivetoken 217 {\Uring} % 016E LATIN CAPITAL LETTER U WITH RING ABOVE
+\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE
+\defineactivetoken 219 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE
+\defineactivetoken 222 {\Tcedilla} % 0162 LATIN CAPITAL LETTER T WITH CEDILLA
+\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S
+\defineactivetoken 224 {\racute} % 0155 LATIN SMALL LETTER R WITH ACUTE
+\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE
+\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 227 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE
+\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
+\defineactivetoken 229 {\lacute} % 013A LATIN SMALL LETTER L WITH ACUTE
+\defineactivetoken 230 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE
+\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA
+\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON
+\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE
+\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK
+\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS
+\defineactivetoken 236 {\ecaron} % 011B LATIN SMALL LETTER E WITH CARON
+\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE
+\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 239 {\dcaron} % 010F LATIN SMALL LETTER D WITH CARON
+\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE
+\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE
+\defineactivetoken 242 {\ncaron} % 0148 LATIN SMALL LETTER N WITH CARON
+\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE
+\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 245 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
+\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN
+\defineactivetoken 248 {\rcaron} % 0159 LATIN SMALL LETTER R WITH CARON
+\defineactivetoken 249 {\uring} % 016F LATIN SMALL LETTER U WITH RING ABOVE
+\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE
+\defineactivetoken 251 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS
+\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE
+\defineactivetoken 254 {\tcedilla} % 0163 LATIN SMALL LETTER T WITH CEDILLA
+\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1251.tex b/Master/texmf-dist/tex/context/base/regi-cp1251.tex
new file mode 100644
index 00000000000..60f04170b31
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-cp1251.tex
@@ -0,0 +1,152 @@
+%D \module
+%D [ file=regi-cp1251,
+%D version=2005.12.26,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=cp1251 (Cyrillic),
+%D author=script-generated,
+%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.
+
+%D Support for cp1251 input encoding (regime) for Cyrillic.
+%D
+%D Usage:
+%D \type{\enableregime[cp1251]} or \type{\enablereregime[windows-1251]}
+
+
+\startregime[cp1251]
+
+\defineactivetoken 128 {\cyrillicDJE} % 0402 CYRILLIC CAPITAL LETTER DJE
+\defineactivetoken 129 {\cyrillicGJE} % 0403 CYRILLIC CAPITAL LETTER GJE
+\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK
+\defineactivetoken 131 {\cyrillicgje} % 0453 CYRILLIC SMALL LETTER GJE
+\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK
+\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS
+\defineactivetoken 134 {\textdag} % 2020 DAGGER
+\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER
+\defineactivetoken 136 {\texteuro} % 20AC EURO SIGN
+\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN
+\defineactivetoken 138 {\cyrillicLJE} % 0409 CYRILLIC CAPITAL LETTER LJE
+\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 140 {\cyrillicNJE} % 040A CYRILLIC CAPITAL LETTER NJE
+\defineactivetoken 141 {\cyrillicKJE} % 040C CYRILLIC CAPITAL LETTER KJE
+\defineactivetoken 142 {\cyrillicTSHE} % 040B CYRILLIC CAPITAL LETTER TSHE
+\defineactivetoken 143 {\cyrillicDZHE} % 040F CYRILLIC CAPITAL LETTER DZHE
+\defineactivetoken 144 {\cyrillicdje} % 0452 CYRILLIC SMALL LETTER DJE
+\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK
+\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK
+\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK
+\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK
+\defineactivetoken 149 {\textbullet} % 2022 BULLET
+\defineactivetoken 150 {\endash} % 2013 EN DASH
+\defineactivetoken 151 {\emdash} % 2014 EM DASH
+\defineactivetoken 152 {\unknownchar} % <undefined>
+\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN
+\defineactivetoken 154 {\cyrilliclje} % 0459 CYRILLIC SMALL LETTER LJE
+\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 156 {\cyrillicnje} % 045A CYRILLIC SMALL LETTER NJE
+\defineactivetoken 157 {\cyrillickje} % 045C CYRILLIC SMALL LETTER KJE
+\defineactivetoken 158 {\cyrillictshe} % 045B CYRILLIC SMALL LETTER TSHE
+\defineactivetoken 159 {\cyrillicdzhe} % 045F CYRILLIC SMALL LETTER DZHE
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\cyrillicUSHRT} % 040E CYRILLIC CAPITAL LETTER SHORT U
+\defineactivetoken 162 {\cyrillicushrt} % 045E CYRILLIC SMALL LETTER SHORT U
+\defineactivetoken 163 {\cyrillicJE} % 0408 CYRILLIC CAPITAL LETTER JE
+\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
+\defineactivetoken 165 {\cyrillicGHEupturn} % 0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN
+\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\cyrillicYO} % 0401 CYRILLIC CAPITAL LETTER IO
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\cyrillicIE} % 0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN
+\defineactivetoken 175 {\cyrillicYI} % 0407 CYRILLIC CAPITAL LETTER YI
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\cyrillicII} % 0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
+\defineactivetoken 179 {\cyrillicii} % 0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
+\defineactivetoken 180 {\cyrillicgheupturn} % 0491 CYRILLIC SMALL LETTER GHE WITH UPTURN
+\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN
+\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\cyrillicyo} % 0451 CYRILLIC SMALL LETTER IO
+\defineactivetoken 185 {\textnumero} % 2116 NUMERO SIGN
+\defineactivetoken 186 {\cyrillicie} % 0454 CYRILLIC SMALL LETTER UKRAINIAN IE
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\cyrillicje} % 0458 CYRILLIC SMALL LETTER JE
+\defineactivetoken 189 {\cyrillicDZE} % 0405 CYRILLIC CAPITAL LETTER DZE
+\defineactivetoken 190 {\cyrillicdze} % 0455 CYRILLIC SMALL LETTER DZE
+\defineactivetoken 191 {\cyrillicyi} % 0457 CYRILLIC SMALL LETTER YI
+\defineactivetoken 192 {\cyrillicA} % 0410 CYRILLIC CAPITAL LETTER A
+\defineactivetoken 193 {\cyrillicB} % 0411 CYRILLIC CAPITAL LETTER BE
+\defineactivetoken 194 {\cyrillicV} % 0412 CYRILLIC CAPITAL LETTER VE
+\defineactivetoken 195 {\cyrillicG} % 0413 CYRILLIC CAPITAL LETTER GHE
+\defineactivetoken 196 {\cyrillicD} % 0414 CYRILLIC CAPITAL LETTER DE
+\defineactivetoken 197 {\cyrillicE} % 0415 CYRILLIC CAPITAL LETTER IE
+\defineactivetoken 198 {\cyrillicZH} % 0416 CYRILLIC CAPITAL LETTER ZHE
+\defineactivetoken 199 {\cyrillicZ} % 0417 CYRILLIC CAPITAL LETTER ZE
+\defineactivetoken 200 {\cyrillicI} % 0418 CYRILLIC CAPITAL LETTER I
+\defineactivetoken 201 {\cyrillicISHRT} % 0419 CYRILLIC CAPITAL LETTER SHORT I
+\defineactivetoken 202 {\cyrillicK} % 041A CYRILLIC CAPITAL LETTER KA
+\defineactivetoken 203 {\cyrillicL} % 041B CYRILLIC CAPITAL LETTER EL
+\defineactivetoken 204 {\cyrillicM} % 041C CYRILLIC CAPITAL LETTER EM
+\defineactivetoken 205 {\cyrillicN} % 041D CYRILLIC CAPITAL LETTER EN
+\defineactivetoken 206 {\cyrillicO} % 041E CYRILLIC CAPITAL LETTER O
+\defineactivetoken 207 {\cyrillicP} % 041F CYRILLIC CAPITAL LETTER PE
+\defineactivetoken 208 {\cyrillicR} % 0420 CYRILLIC CAPITAL LETTER ER
+\defineactivetoken 209 {\cyrillicS} % 0421 CYRILLIC CAPITAL LETTER ES
+\defineactivetoken 210 {\cyrillicT} % 0422 CYRILLIC CAPITAL LETTER TE
+\defineactivetoken 211 {\cyrillicU} % 0423 CYRILLIC CAPITAL LETTER U
+\defineactivetoken 212 {\cyrillicF} % 0424 CYRILLIC CAPITAL LETTER EF
+\defineactivetoken 213 {\cyrillicH} % 0425 CYRILLIC CAPITAL LETTER HA
+\defineactivetoken 214 {\cyrillicC} % 0426 CYRILLIC CAPITAL LETTER TSE
+\defineactivetoken 215 {\cyrillicCH} % 0427 CYRILLIC CAPITAL LETTER CHE
+\defineactivetoken 216 {\cyrillicSH} % 0428 CYRILLIC CAPITAL LETTER SHA
+\defineactivetoken 217 {\cyrillicSHCH} % 0429 CYRILLIC CAPITAL LETTER SHCHA
+\defineactivetoken 218 {\cyrillicHRDSN} % 042A CYRILLIC CAPITAL LETTER HARD SIGN
+\defineactivetoken 219 {\cyrillicERY} % 042B CYRILLIC CAPITAL LETTER YERU
+\defineactivetoken 220 {\cyrillicSFTSN} % 042C CYRILLIC CAPITAL LETTER SOFT SIGN
+\defineactivetoken 221 {\cyrillicEREV} % 042D CYRILLIC CAPITAL LETTER E
+\defineactivetoken 222 {\cyrillicYU} % 042E CYRILLIC CAPITAL LETTER YU
+\defineactivetoken 223 {\cyrillicYA} % 042F CYRILLIC CAPITAL LETTER YA
+\defineactivetoken 224 {\cyrillica} % 0430 CYRILLIC SMALL LETTER A
+\defineactivetoken 225 {\cyrillicb} % 0431 CYRILLIC SMALL LETTER BE
+\defineactivetoken 226 {\cyrillicv} % 0432 CYRILLIC SMALL LETTER VE
+\defineactivetoken 227 {\cyrillicg} % 0433 CYRILLIC SMALL LETTER GHE
+\defineactivetoken 228 {\cyrillicd} % 0434 CYRILLIC SMALL LETTER DE
+\defineactivetoken 229 {\cyrillice} % 0435 CYRILLIC SMALL LETTER IE
+\defineactivetoken 230 {\cyrilliczh} % 0436 CYRILLIC SMALL LETTER ZHE
+\defineactivetoken 231 {\cyrillicz} % 0437 CYRILLIC SMALL LETTER ZE
+\defineactivetoken 232 {\cyrillici} % 0438 CYRILLIC SMALL LETTER I
+\defineactivetoken 233 {\cyrillicishrt} % 0439 CYRILLIC SMALL LETTER SHORT I
+\defineactivetoken 234 {\cyrillick} % 043A CYRILLIC SMALL LETTER KA
+\defineactivetoken 235 {\cyrillicl} % 043B CYRILLIC SMALL LETTER EL
+\defineactivetoken 236 {\cyrillicm} % 043C CYRILLIC SMALL LETTER EM
+\defineactivetoken 237 {\cyrillicn} % 043D CYRILLIC SMALL LETTER EN
+\defineactivetoken 238 {\cyrillico} % 043E CYRILLIC SMALL LETTER O
+\defineactivetoken 239 {\cyrillicp} % 043F CYRILLIC SMALL LETTER PE
+\defineactivetoken 240 {\cyrillicr} % 0440 CYRILLIC SMALL LETTER ER
+\defineactivetoken 241 {\cyrillics} % 0441 CYRILLIC SMALL LETTER ES
+\defineactivetoken 242 {\cyrillict} % 0442 CYRILLIC SMALL LETTER TE
+\defineactivetoken 243 {\cyrillicu} % 0443 CYRILLIC SMALL LETTER U
+\defineactivetoken 244 {\cyrillicf} % 0444 CYRILLIC SMALL LETTER EF
+\defineactivetoken 245 {\cyrillich} % 0445 CYRILLIC SMALL LETTER HA
+\defineactivetoken 246 {\cyrillicc} % 0446 CYRILLIC SMALL LETTER TSE
+\defineactivetoken 247 {\cyrillicch} % 0447 CYRILLIC SMALL LETTER CHE
+\defineactivetoken 248 {\cyrillicsh} % 0448 CYRILLIC SMALL LETTER SHA
+\defineactivetoken 249 {\cyrillicshch} % 0449 CYRILLIC SMALL LETTER SHCHA
+\defineactivetoken 250 {\cyrillichrdsn} % 044A CYRILLIC SMALL LETTER HARD SIGN
+\defineactivetoken 251 {\cyrillicery} % 044B CYRILLIC SMALL LETTER YERU
+\defineactivetoken 252 {\cyrillicsftsn} % 044C CYRILLIC SMALL LETTER SOFT SIGN
+\defineactivetoken 253 {\cyrillicerev} % 044D CYRILLIC SMALL LETTER E
+\defineactivetoken 254 {\cyrillicyu} % 044E CYRILLIC SMALL LETTER YU
+\defineactivetoken 255 {\cyrillicya} % 044F CYRILLIC SMALL LETTER YA
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1252.tex b/Master/texmf-dist/tex/context/base/regi-cp1252.tex
new file mode 100644
index 00000000000..3911644ce6d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-cp1252.tex
@@ -0,0 +1,156 @@
+%D \module
+%D [ file=regi-cp1252,
+%D version=2005.12.26,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=cp1252 (West European),
+%D author=script-generated,
+%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.
+
+%D Support for cp1252 input encoding (regime) for West European languages,
+%D see also iso-8859-1 and iso-8859-15.
+%D
+%D (Contributors to the original file: Tobias Burnus, Hans Hagen & Victor Figurnov.)
+%D
+%D Usage:
+%D \type{\enableregime[cp1252]} or \type{\enablereregime[windows-1252]}
+%D % and \enableregime[win] for backward-compatibility
+
+
+\startregime[cp1252]
+
+\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN
+\defineactivetoken 129 {\unknownchar} % <undefined>
+\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK
+\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK
+\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK
+\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS
+\defineactivetoken 134 {\textdag} % 2020 DAGGER
+\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER
+\defineactivetoken 136 {\textcircumflex} % 02C6 MODIFIER LETTER CIRCUMFLEX ACCENT
+\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN
+\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON
+\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 140 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE
+\defineactivetoken 141 {\unknownchar} % <undefined>
+\defineactivetoken 142 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON
+\defineactivetoken 143 {\unknownchar} % <undefined>
+\defineactivetoken 144 {\unknownchar} % <undefined>
+\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK
+\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK
+\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK
+\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK
+\defineactivetoken 149 {\textbullet} % 2022 BULLET
+\defineactivetoken 150 {\endash} % 2013 EN DASH
+\defineactivetoken 151 {\emdash} % 2014 EM DASH
+\defineactivetoken 152 {\texttilde} % 02DC SMALL TILDE
+\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN
+\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON
+\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 156 {\oeligature} % 0153 LATIN SMALL LIGATURE OE
+\defineactivetoken 157 {\unknownchar} % <undefined>
+\defineactivetoken 158 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON
+\defineactivetoken 159 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK
+\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN
+\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
+\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
+\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN
+\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN
+\defineactivetoken 175 {\textmacron} % 00AF MACRON
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO
+\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE
+\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT
+\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN
+\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA
+\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE
+\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER
+\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF
+\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS
+\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK
+\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE
+\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE
+\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE
+\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE
+\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE
+\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA
+\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE
+\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS
+\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE
+\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE
+\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS
+\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH
+\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE
+\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE
+\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE
+\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN
+\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE
+\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE
+\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE
+\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE
+\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN
+\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S
+\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE
+\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE
+\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE
+\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
+\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE
+\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE
+\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA
+\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE
+\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE
+\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS
+\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE
+\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE
+\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS
+\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH
+\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE
+\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE
+\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE
+\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE
+\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
+\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN
+\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE
+\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE
+\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE
+\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX
+\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS
+\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE
+\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN
+\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1253.tex b/Master/texmf-dist/tex/context/base/regi-cp1253.tex
new file mode 100644
index 00000000000..24ec45eac5e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-cp1253.tex
@@ -0,0 +1,153 @@
+%D \module
+%D [ file=regi-cp1253,
+%D version=2005.12.26,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=cp1253 (Greek),
+%D author=script-generated,
+%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.
+
+%D Support for cp1253 input encoding (regime) for Greek,
+%D see also iso-8859-7.
+%D
+%D Usage:
+%D \type{\enableregime[cp1253]} or \type{\enablereregime[windows-1253]}
+
+
+\startregime[cp1253]
+
+\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN
+\defineactivetoken 129 {\unknownchar} % <undefined>
+\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK
+\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK
+\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK
+\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS
+\defineactivetoken 134 {\textdag} % 2020 DAGGER
+\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER
+\defineactivetoken 136 {\unknownchar} % <undefined>
+\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN
+\defineactivetoken 138 {\unknownchar} % <undefined>
+\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 140 {\unknownchar} % <undefined>
+\defineactivetoken 141 {\unknownchar} % <undefined>
+\defineactivetoken 142 {\unknownchar} % <undefined>
+\defineactivetoken 143 {\unknownchar} % <undefined>
+\defineactivetoken 144 {\unknownchar} % <undefined>
+\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK
+\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK
+\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK
+\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK
+\defineactivetoken 149 {\textbullet} % 2022 BULLET
+\defineactivetoken 150 {\endash} % 2013 EN DASH
+\defineactivetoken 151 {\emdash} % 2014 EM DASH
+\defineactivetoken 152 {\unknownchar} % <undefined>
+\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN
+\defineactivetoken 154 {\unknownchar} % <undefined>
+\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 156 {\unknownchar} % <undefined>
+\defineactivetoken 157 {\unknownchar} % <undefined>
+\defineactivetoken 158 {\unknownchar} % <undefined>
+\defineactivetoken 159 {\unknownchar} % <undefined>
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\greekdialytikatonos} % 0385 GREEK DIALYTIKA TONOS
+\defineactivetoken 162 {\greekAlphatonos} % 0386 GREEK CAPITAL LETTER ALPHA WITH TONOS
+\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
+\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
+\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN
+\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\unknownchar} % <undefined>
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN
+\defineactivetoken 175 {\texthorizontalbar} % 2015 HORIZONTAL BAR
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO
+\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE
+\defineactivetoken 180 {\greektonos} % 0384 GREEK TONOS
+\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN
+\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\greekEpsilontonos} % 0388 GREEK CAPITAL LETTER EPSILON WITH TONOS
+\defineactivetoken 185 {\greekEtatonos} % 0389 GREEK CAPITAL LETTER ETA WITH TONOS
+\defineactivetoken 186 {\greekIotatonos} % 038A GREEK CAPITAL LETTER IOTA WITH TONOS
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\greekOmicrontonos} % 038C GREEK CAPITAL LETTER OMICRON WITH TONOS
+\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF
+\defineactivetoken 190 {\greekUpsilontonos} % 038E GREEK CAPITAL LETTER UPSILON WITH TONOS
+\defineactivetoken 191 {\greekOmegatonos} % 038F GREEK CAPITAL LETTER OMEGA WITH TONOS
+\defineactivetoken 192 {\greekiotadialytikatonos} % 0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+\defineactivetoken 193 {\greekAlpha} % 0391 GREEK CAPITAL LETTER ALPHA
+\defineactivetoken 194 {\greekBeta} % 0392 GREEK CAPITAL LETTER BETA
+\defineactivetoken 195 {\greekGamma} % 0393 GREEK CAPITAL LETTER GAMMA
+\defineactivetoken 196 {\greekDelta} % 0394 GREEK CAPITAL LETTER DELTA
+\defineactivetoken 197 {\greekEpsilon} % 0395 GREEK CAPITAL LETTER EPSILON
+\defineactivetoken 198 {\greekZeta} % 0396 GREEK CAPITAL LETTER ZETA
+\defineactivetoken 199 {\greekEta} % 0397 GREEK CAPITAL LETTER ETA
+\defineactivetoken 200 {\greekTheta} % 0398 GREEK CAPITAL LETTER THETA
+\defineactivetoken 201 {\greekIota} % 0399 GREEK CAPITAL LETTER IOTA
+\defineactivetoken 202 {\greekKappa} % 039A GREEK CAPITAL LETTER KAPPA
+\defineactivetoken 203 {\greekLambda} % 039B GREEK CAPITAL LETTER LAMDA
+\defineactivetoken 204 {\greekMu} % 039C GREEK CAPITAL LETTER MU
+\defineactivetoken 205 {\greekNu} % 039D GREEK CAPITAL LETTER NU
+\defineactivetoken 206 {\greekXi} % 039E GREEK CAPITAL LETTER XI
+\defineactivetoken 207 {\greekOmicron} % 039F GREEK CAPITAL LETTER OMICRON
+\defineactivetoken 208 {\greekPi} % 03A0 GREEK CAPITAL LETTER PI
+\defineactivetoken 209 {\greekRho} % 03A1 GREEK CAPITAL LETTER RHO
+\defineactivetoken 210 {\unknownchar} % <undefined>
+\defineactivetoken 211 {\greekSigma} % 03A3 GREEK CAPITAL LETTER SIGMA
+\defineactivetoken 212 {\greekTau} % 03A4 GREEK CAPITAL LETTER TAU
+\defineactivetoken 213 {\greekUpsilon} % 03A5 GREEK CAPITAL LETTER UPSILON
+\defineactivetoken 214 {\greekPhi} % 03A6 GREEK CAPITAL LETTER PHI
+\defineactivetoken 215 {\greekChi} % 03A7 GREEK CAPITAL LETTER CHI
+\defineactivetoken 216 {\greekPsi} % 03A8 GREEK CAPITAL LETTER PSI
+\defineactivetoken 217 {\greekOmega} % 03A9 GREEK CAPITAL LETTER OMEGA
+\defineactivetoken 218 {\greekIotadialytika} % 03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+\defineactivetoken 219 {\greekUpsilondialytika} % 03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+\defineactivetoken 220 {\greekalphatonos} % 03AC GREEK SMALL LETTER ALPHA WITH TONOS
+\defineactivetoken 221 {\greekepsilontonos} % 03AD GREEK SMALL LETTER EPSILON WITH TONOS
+\defineactivetoken 222 {\greeketatonos} % 03AE GREEK SMALL LETTER ETA WITH TONOS
+\defineactivetoken 223 {\greekiotatonos} % 03AF GREEK SMALL LETTER IOTA WITH TONOS
+\defineactivetoken 224 {\greekupsilondialytikatonos} % 03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+\defineactivetoken 225 {\greekalpha} % 03B1 GREEK SMALL LETTER ALPHA
+\defineactivetoken 226 {\greekbeta} % 03B2 GREEK SMALL LETTER BETA
+\defineactivetoken 227 {\greekgamma} % 03B3 GREEK SMALL LETTER GAMMA
+\defineactivetoken 228 {\greekdelta} % 03B4 GREEK SMALL LETTER DELTA
+\defineactivetoken 229 {\greekepsilon} % 03B5 GREEK SMALL LETTER EPSILON
+\defineactivetoken 230 {\greekzeta} % 03B6 GREEK SMALL LETTER ZETA
+\defineactivetoken 231 {\greeketa} % 03B7 GREEK SMALL LETTER ETA
+\defineactivetoken 232 {\greektheta} % 03B8 GREEK SMALL LETTER THETA
+\defineactivetoken 233 {\greekiota} % 03B9 GREEK SMALL LETTER IOTA
+\defineactivetoken 234 {\greekkappa} % 03BA GREEK SMALL LETTER KAPPA
+\defineactivetoken 235 {\greeklambda} % 03BB GREEK SMALL LETTER LAMDA
+\defineactivetoken 236 {\greekmu} % 03BC GREEK SMALL LETTER MU
+\defineactivetoken 237 {\greeknu} % 03BD GREEK SMALL LETTER NU
+\defineactivetoken 238 {\greekxi} % 03BE GREEK SMALL LETTER XI
+\defineactivetoken 239 {\greekomicron} % 03BF GREEK SMALL LETTER OMICRON
+\defineactivetoken 240 {\greekpi} % 03C0 GREEK SMALL LETTER PI
+\defineactivetoken 241 {\greekrho} % 03C1 GREEK SMALL LETTER RHO
+\defineactivetoken 242 {\greekfinalsigma} % 03C2 GREEK SMALL LETTER FINAL SIGMA
+\defineactivetoken 243 {\greeksigma} % 03C3 GREEK SMALL LETTER SIGMA
+\defineactivetoken 244 {\greektau} % 03C4 GREEK SMALL LETTER TAU
+\defineactivetoken 245 {\greekupsilon} % 03C5 GREEK SMALL LETTER UPSILON
+\defineactivetoken 246 {\greekphi} % 03C6 GREEK SMALL LETTER PHI
+\defineactivetoken 247 {\greekchi} % 03C7 GREEK SMALL LETTER CHI
+\defineactivetoken 248 {\greekpsi} % 03C8 GREEK SMALL LETTER PSI
+\defineactivetoken 249 {\greekomega} % 03C9 GREEK SMALL LETTER OMEGA
+\defineactivetoken 250 {\greekiotadialytika} % 03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA
+\defineactivetoken 251 {\greekupsilondiaeresis} % 03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+\defineactivetoken 252 {\greekomicrontonos} % 03CC GREEK SMALL LETTER OMICRON WITH TONOS
+\defineactivetoken 253 {\greekupsilontonos} % 03CD GREEK SMALL LETTER UPSILON WITH TONOS
+\defineactivetoken 254 {\greekomegatonos} % 03CE GREEK SMALL LETTER OMEGA WITH TONOS
+\defineactivetoken 255 {\unknownchar} % <undefined>
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1254.tex b/Master/texmf-dist/tex/context/base/regi-cp1254.tex
new file mode 100644
index 00000000000..4dd509b9d69
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-cp1254.tex
@@ -0,0 +1,153 @@
+%D \module
+%D [ file=regi-cp1254,
+%D version=2005.12.26,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=cp1254 (Turkish),
+%D author=script-generated,
+%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.
+
+%D Support for cp1254 input encoding (regime) for Turkish,
+%D see also iso-8859-9.
+%D
+%D Usage:
+%D \type{\enableregime[cp1254]} or \type{\enablereregime[windows-1254]}
+
+
+\startregime[cp1254]
+
+\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN
+\defineactivetoken 129 {\unknownchar} % <undefined>
+\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK
+\defineactivetoken 131 {\fhook} % 0192 LATIN SMALL LETTER F WITH HOOK
+\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK
+\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS
+\defineactivetoken 134 {\textdag} % 2020 DAGGER
+\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER
+\defineactivetoken 136 {\textcircumflex} % 02C6 MODIFIER LETTER CIRCUMFLEX ACCENT
+\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN
+\defineactivetoken 138 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON
+\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 140 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE
+\defineactivetoken 141 {\unknownchar} % <undefined>
+\defineactivetoken 142 {\unknownchar} % <undefined>
+\defineactivetoken 143 {\unknownchar} % <undefined>
+\defineactivetoken 144 {\unknownchar} % <undefined>
+\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK
+\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK
+\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK
+\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK
+\defineactivetoken 149 {\textbullet} % 2022 BULLET
+\defineactivetoken 150 {\endash} % 2013 EN DASH
+\defineactivetoken 151 {\emdash} % 2014 EM DASH
+\defineactivetoken 152 {\texttilde} % 02DC SMALL TILDE
+\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN
+\defineactivetoken 154 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON
+\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 156 {\oeligature} % 0153 LATIN SMALL LIGATURE OE
+\defineactivetoken 157 {\unknownchar} % <undefined>
+\defineactivetoken 158 {\unknownchar} % <undefined>
+\defineactivetoken 159 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK
+\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN
+\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
+\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
+\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN
+\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN
+\defineactivetoken 175 {\textmacron} % 00AF MACRON
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO
+\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE
+\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT
+\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN
+\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA
+\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE
+\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER
+\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF
+\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS
+\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK
+\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE
+\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE
+\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE
+\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE
+\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE
+\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA
+\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE
+\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS
+\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE
+\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE
+\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS
+\defineactivetoken 208 {\Gbreve} % 011E LATIN CAPITAL LETTER G WITH BREVE
+\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE
+\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE
+\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE
+\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN
+\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE
+\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE
+\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE
+\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+\defineactivetoken 221 {\Idotaccent} % 0130 LATIN CAPITAL LETTER I WITH DOT ABOVE
+\defineactivetoken 222 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA
+\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S
+\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE
+\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE
+\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE
+\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
+\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE
+\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE
+\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA
+\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE
+\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE
+\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS
+\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE
+\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE
+\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS
+\defineactivetoken 240 {\gbreve} % 011F LATIN SMALL LETTER G WITH BREVE
+\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE
+\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE
+\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE
+\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE
+\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
+\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN
+\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE
+\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE
+\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE
+\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX
+\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS
+\defineactivetoken 253 {\dotlessi} % 0131 LATIN SMALL LETTER DOTLESS I
+\defineactivetoken 254 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA
+\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-cp1257.tex b/Master/texmf-dist/tex/context/base/regi-cp1257.tex
new file mode 100644
index 00000000000..0790ef7344d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-cp1257.tex
@@ -0,0 +1,153 @@
+%D \module
+%D [ file=regi-cp1257,
+%D version=2005.12.26,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=cp1257 (Windows Baltic),
+%D author=script-generated,
+%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.
+
+%D Support for cp1257 input encoding (regime) for Baltic languages,
+%D see also iso-8859-4 and iso-8859-13.
+%D
+%D Usage:
+%D \type{\enableregime[cp1257]} or \type{\enablereregime[windows-1257]}
+
+
+\startregime[cp1257]
+
+\defineactivetoken 128 {\texteuro} % 20AC EURO SIGN
+\defineactivetoken 129 {\unknownchar} % <undefined>
+\defineactivetoken 130 {\quotesinglebase} % 201A SINGLE LOW-9 QUOTATION MARK
+\defineactivetoken 131 {\unknownchar} % <undefined>
+\defineactivetoken 132 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK
+\defineactivetoken 133 {\textellipsis} % 2026 HORIZONTAL ELLIPSIS
+\defineactivetoken 134 {\textdag} % 2020 DAGGER
+\defineactivetoken 135 {\textddag} % 2021 DOUBLE DAGGER
+\defineactivetoken 136 {\unknownchar} % <undefined>
+\defineactivetoken 137 {\perthousand} % 2030 PER MILLE SIGN
+\defineactivetoken 138 {\unknownchar} % <undefined>
+\defineactivetoken 139 {\guilsingleleft} % 2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 140 {\unknownchar} % <undefined>
+\defineactivetoken 141 {\textdiaeresis} % 00A8 DIAERESIS
+\defineactivetoken 142 {\textcaron} % 02C7 CARON
+\defineactivetoken 143 {\textcedilla} % 00B8 CEDILLA
+\defineactivetoken 144 {\unknownchar} % <undefined>
+\defineactivetoken 145 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK
+\defineactivetoken 146 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK
+\defineactivetoken 147 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK
+\defineactivetoken 148 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK
+\defineactivetoken 149 {\textbullet} % 2022 BULLET
+\defineactivetoken 150 {\endash} % 2013 EN DASH
+\defineactivetoken 151 {\emdash} % 2014 EM DASH
+\defineactivetoken 152 {\unknownchar} % <undefined>
+\defineactivetoken 153 {\trademark} % 2122 TRADE MARK SIGN
+\defineactivetoken 154 {\unknownchar} % <undefined>
+\defineactivetoken 155 {\guilsingleright} % 203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+\defineactivetoken 156 {\unknownchar} % <undefined>
+\defineactivetoken 157 {\textmacron} % 00AF MACRON
+\defineactivetoken 158 {\textogonek} % 02DB OGONEK
+\defineactivetoken 159 {\unknownchar} % <undefined>
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\unknownchar} % <undefined>
+\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN
+\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
+\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
+\defineactivetoken 165 {\unknownchar} % <undefined>
+\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\Rcommaaccent} % 0156 LATIN CAPITAL LETTER R WITH CEDILLA
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN
+\defineactivetoken 175 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO
+\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE
+\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT
+\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN
+\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE
+\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE
+\defineactivetoken 186 {\rcommaaccent} % 0157 LATIN SMALL LETTER R WITH CEDILLA
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER
+\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF
+\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS
+\defineactivetoken 191 {\aeligature} % 00E6 LATIN SMALL LETTER AE
+\defineactivetoken 192 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK
+\defineactivetoken 193 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK
+\defineactivetoken 194 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON
+\defineactivetoken 195 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE
+\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE
+\defineactivetoken 198 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK
+\defineactivetoken 199 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON
+\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON
+\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\defineactivetoken 202 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE
+\defineactivetoken 203 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE
+\defineactivetoken 204 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA
+\defineactivetoken 205 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA
+\defineactivetoken 206 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON
+\defineactivetoken 207 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA
+\defineactivetoken 208 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON
+\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE
+\defineactivetoken 210 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA
+\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\defineactivetoken 212 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON
+\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE
+\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN
+\defineactivetoken 216 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK
+\defineactivetoken 217 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE
+\defineactivetoken 218 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE
+\defineactivetoken 219 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON
+\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+\defineactivetoken 221 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\defineactivetoken 222 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON
+\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S
+\defineactivetoken 224 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK
+\defineactivetoken 225 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK
+\defineactivetoken 226 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON
+\defineactivetoken 227 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE
+\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
+\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE
+\defineactivetoken 230 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK
+\defineactivetoken 231 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON
+\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON
+\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE
+\defineactivetoken 234 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE
+\defineactivetoken 235 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE
+\defineactivetoken 236 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA
+\defineactivetoken 237 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA
+\defineactivetoken 238 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON
+\defineactivetoken 239 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA
+\defineactivetoken 240 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON
+\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE
+\defineactivetoken 242 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA
+\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE
+\defineactivetoken 244 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON
+\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE
+\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
+\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN
+\defineactivetoken 248 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK
+\defineactivetoken 249 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE
+\defineactivetoken 250 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE
+\defineactivetoken 251 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON
+\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS
+\defineactivetoken 253 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE
+\defineactivetoken 254 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON
+\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-cyr.tex b/Master/texmf-dist/tex/context/base/regi-cyr.tex
index 134cc572858..1e84b9cba87 100644
--- a/Master/texmf-dist/tex/context/base/regi-cyr.tex
+++ b/Master/texmf-dist/tex/context/base/regi-cyr.tex
@@ -11,10 +11,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D Here are input regimes for cyrillic encodings:
+%D Here are additional input regimes for cyrillic encodings others than cp1251
+%D and iso-8859-5:
%D
%D \startitemize
-%D \item windows
%D \item two variants of dos
%D \item three variants of koi-8 for *nix: russian,
%D ukrainian and mixed
@@ -24,139 +24,6 @@
%D Other, not so popular regimes, can be found in \type
%D {regi-cy2}.
-\startregime[cp1251]
-
-\defineactivetoken 192 {\cyrillicA}
-\defineactivetoken 193 {\cyrillicB}
-\defineactivetoken 194 {\cyrillicV}
-\defineactivetoken 195 {\cyrillicG}
-\defineactivetoken 196 {\cyrillicD}
-\defineactivetoken 197 {\cyrillicE}
-\defineactivetoken 198 {\cyrillicZH}
-\defineactivetoken 199 {\cyrillicZ}
-\defineactivetoken 200 {\cyrillicI}
-\defineactivetoken 201 {\cyrillicISHRT}
-\defineactivetoken 202 {\cyrillicK}
-\defineactivetoken 203 {\cyrillicL}
-\defineactivetoken 204 {\cyrillicM}
-\defineactivetoken 205 {\cyrillicN}
-\defineactivetoken 206 {\cyrillicO}
-\defineactivetoken 207 {\cyrillicP}
-\defineactivetoken 208 {\cyrillicR}
-\defineactivetoken 209 {\cyrillicS}
-\defineactivetoken 210 {\cyrillicT}
-\defineactivetoken 211 {\cyrillicU}
-\defineactivetoken 212 {\cyrillicF}
-\defineactivetoken 213 {\cyrillicH}
-\defineactivetoken 214 {\cyrillicC}
-\defineactivetoken 215 {\cyrillicCH}
-\defineactivetoken 216 {\cyrillicSH}
-\defineactivetoken 217 {\cyrillicSHCH}
-\defineactivetoken 218 {\cyrillicHRDSN}
-\defineactivetoken 219 {\cyrillicERY}
-\defineactivetoken 220 {\cyrillicSFTSN}
-\defineactivetoken 221 {\cyrillicEREV}
-\defineactivetoken 222 {\cyrillicYU}
-\defineactivetoken 223 {\cyrillicYA}
-\defineactivetoken 224 {\cyrillica}
-\defineactivetoken 225 {\cyrillicb}
-\defineactivetoken 226 {\cyrillicv}
-\defineactivetoken 227 {\cyrillicg}
-\defineactivetoken 228 {\cyrillicd}
-\defineactivetoken 229 {\cyrillice}
-\defineactivetoken 230 {\cyrilliczh}
-\defineactivetoken 231 {\cyrillicz}
-\defineactivetoken 232 {\cyrillici}
-\defineactivetoken 233 {\cyrillicishrt}
-\defineactivetoken 234 {\cyrillick}
-\defineactivetoken 235 {\cyrillicl}
-\defineactivetoken 236 {\cyrillicm}
-\defineactivetoken 237 {\cyrillicn}
-\defineactivetoken 238 {\cyrillico}
-\defineactivetoken 239 {\cyrillicp}
-\defineactivetoken 240 {\cyrillicr}
-\defineactivetoken 241 {\cyrillics}
-\defineactivetoken 242 {\cyrillict}
-\defineactivetoken 243 {\cyrillicu}
-\defineactivetoken 244 {\cyrillicf}
-\defineactivetoken 245 {\cyrillich}
-\defineactivetoken 246 {\cyrillicc}
-\defineactivetoken 247 {\cyrillicch}
-\defineactivetoken 248 {\cyrillicsh}
-\defineactivetoken 249 {\cyrillicshch}
-\defineactivetoken 250 {\cyrillichrdsn}
-\defineactivetoken 251 {\cyrillicery}
-\defineactivetoken 252 {\cyrillicsftsn}
-\defineactivetoken 253 {\cyrillicerev}
-\defineactivetoken 254 {\cyrillicyu}
-\defineactivetoken 255 {\cyrillicya}
-\defineactivetoken 128 {\cyrillicDJE}
-\defineactivetoken 129 {\'\cyrillicG}
-\defineactivetoken 130 {\lowerleftsingleninequote}
-\defineactivetoken 131 {\'\cyrillicg}
-\defineactivetoken 132 {\lowerleftdoubleninequote}
-\defineactivetoken 133 {\textellipsis}
-\defineactivetoken 134 {\textdag}
-\defineactivetoken 135 {\textddag}
-\defineactivetoken 136 {\texteuro}
-\defineactivetoken 137 {\perthousand}
-\defineactivetoken 138 {\cyrillicLJE}
-\defineactivetoken 139 {\leftsubguillemot}
-\defineactivetoken 140 {\cyrillicNJE}
-\defineactivetoken 141 {\'\cyrillicK}
-\defineactivetoken 142 {\cyrillicTSHE}
-\defineactivetoken 143 {\cyrillicDZHE}
-\defineactivetoken 144 {\cyrillicdje}
-\defineactivetoken 145 {\upperleftsinglesixquote}
-\defineactivetoken 146 {\upperrightsingleninequote}
-\defineactivetoken 147 {\upperleftdoublesixquote}
-\defineactivetoken 148 {\upperrightdoubleninequote}
-\defineactivetoken 149 {\textbullet}
-\defineactivetoken 150 {\endash}
-\defineactivetoken 151 {\emdash}
-\defineactivetoken 152 {\unknownchar}
-\defineactivetoken 153 {\trademark}
-\defineactivetoken 154 {\cyrilliclje}
-\defineactivetoken 155 {\rightsubguillemot}
-\defineactivetoken 156 {\cyrillicnje}
-\defineactivetoken 157 {\'\cyrillick}
-\defineactivetoken 158 {\cyrillictshe}
-\defineactivetoken 159 {\cyrillicdzhe}
-\defineactivetoken 160 {\nonbreakablespace}
-\defineactivetoken 161 {\cyrillicUSHRT}
-\defineactivetoken 162 {\cyrillicushrt}
-\defineactivetoken 163 {\cyrillicJE}
-\defineactivetoken 164 {\textcurrency}
-\defineactivetoken 165 {\cyrillicGUP}
-\defineactivetoken 166 {\textbrokenbar}
-\defineactivetoken 167 {\sectionmark}
-\defineactivetoken 168 {\cyrillicYO}
-\defineactivetoken 169 {\copyright}
-\defineactivetoken 170 {\cyrillicIE}
-\defineactivetoken 171 {\leftguillemot}
-\defineactivetoken 173 {\hyphen}
-\defineactivetoken 174 {\registered}
-\defineactivetoken 175 {\cyrillicYI}
-\defineactivetoken 176 {\textdegree}
-\defineactivetoken 178 {\cyrillicII}
-\defineactivetoken 179 {\cyrillicii}
-\defineactivetoken 180 {\cyrillicgup}
-\defineactivetoken 182 {\paragraphmark}
-\defineactivetoken 183 {\periodcentered}
-\defineactivetoken 184 {\cyrillicyo}
-\defineactivetoken 185 {\textnumero}
-\defineactivetoken 186 {\cyrillicie}
-\defineactivetoken 187 {\rightguillemot}
-\defineactivetoken 188 {\cyrillicje}
-\defineactivetoken 189 {\cyrillicDZE}
-\defineactivetoken 190 {\cyrillicdze}
-\defineactivetoken 191 {\cyrillicyi}
-\defineactivetoken 172 {\textlognot}
-\defineactivetoken 177 {\textpm}
-\defineactivetoken 181 {\textmu}
-
-\stopregime
-
\startregime[cp866]
\defineactivetoken 128 {\cyrillicA}
diff --git a/Master/texmf-dist/tex/context/base/regi-ini.tex b/Master/texmf-dist/tex/context/base/regi-ini.tex
index 1c3fceb55f7..679730d4059 100644
--- a/Master/texmf-dist/tex/context/base/regi-ini.tex
+++ b/Master/texmf-dist/tex/context/base/regi-ini.tex
@@ -22,11 +22,11 @@
\def\douseregime#1% nearly identical to encoding
{\doifundefined{\c!file\f!regimeprefix#1}%
{\setvalue{\c!file\f!regimeprefix#1}{}%
- \makeshortfilename[\f!regimeprefix#1]%
+ \makeshortfilename[\truefilename{\f!regimeprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename
- {\showmessage\m!encodings2{#1}}
- {\showmessage\m!encodings3{#1}}%
+ \readsysfile\shortfilename
+ {\showmessage\m!encodings2{#1}}
+ {\showmessage\m!encodings3{#1}}%
\stopreadingfile}}
\def\useregime[#1]%
@@ -37,6 +37,8 @@
\protect
% \useregime[def,uni,ibm,win,il1,mac]
-\useregime[def,uni,lat,win,il1,mac]
+% \useregime[def,uni,iso-8858-1,iso-8858-2,cp1252,mac]
+
+\useregime[def,uni,utf] % we load the rest runtime
\endinput
diff --git a/Master/texmf-dist/tex/context/base/regi-iso-8859-1.tex b/Master/texmf-dist/tex/context/base/regi-iso-8859-1.tex
new file mode 100644
index 00000000000..27481686bf4
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-iso-8859-1.tex
@@ -0,0 +1,157 @@
+%D \module
+%D [ file=regi-iso-8859-1,
+%D version=2006.04.10,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=iso-8859-1 (West European),
+%D author=script-generated,
+%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.
+
+%D Support for iso-8859-1/Latin1 input encoding (regime) for West European languages,
+%D see also cp1252 and iso-8859-15 (includes Euro).
+%D
+%D (Contributors to the original file: Daniel Flipo, Hans Hagen & Denis Roegel.)
+%D
+%D Usage:
+%D \type{\enableregime[iso-8859-1]} or
+%D \type{\enableregime[latin1]} or
+%D \type{\enableregime[il1]}
+
+
+\startregime[iso-8859-1]
+
+\defineactivetoken 128 {\unknownchar} % 0080 <control>
+\defineactivetoken 129 {\unknownchar} % 0081 <control>
+\defineactivetoken 130 {\unknownchar} % 0082 <control>
+\defineactivetoken 131 {\unknownchar} % 0083 <control>
+\defineactivetoken 132 {\unknownchar} % 0084 <control>
+\defineactivetoken 133 {\unknownchar} % 0085 <control>
+\defineactivetoken 134 {\unknownchar} % 0086 <control>
+\defineactivetoken 135 {\unknownchar} % 0087 <control>
+\defineactivetoken 136 {\unknownchar} % 0088 <control>
+\defineactivetoken 137 {\unknownchar} % 0089 <control>
+\defineactivetoken 138 {\unknownchar} % 008A <control>
+\defineactivetoken 139 {\unknownchar} % 008B <control>
+\defineactivetoken 140 {\unknownchar} % 008C <control>
+\defineactivetoken 141 {\unknownchar} % 008D <control>
+\defineactivetoken 142 {\unknownchar} % 008E <control>
+\defineactivetoken 143 {\unknownchar} % 008F <control>
+\defineactivetoken 144 {\unknownchar} % 0090 <control>
+\defineactivetoken 145 {\unknownchar} % 0091 <control>
+\defineactivetoken 146 {\unknownchar} % 0092 <control>
+\defineactivetoken 147 {\unknownchar} % 0093 <control>
+\defineactivetoken 148 {\unknownchar} % 0094 <control>
+\defineactivetoken 149 {\unknownchar} % 0095 <control>
+\defineactivetoken 150 {\unknownchar} % 0096 <control>
+\defineactivetoken 151 {\unknownchar} % 0097 <control>
+\defineactivetoken 152 {\unknownchar} % 0098 <control>
+\defineactivetoken 153 {\unknownchar} % 0099 <control>
+\defineactivetoken 154 {\unknownchar} % 009A <control>
+\defineactivetoken 155 {\unknownchar} % 009B <control>
+\defineactivetoken 156 {\unknownchar} % 009C <control>
+\defineactivetoken 157 {\unknownchar} % 009D <control>
+\defineactivetoken 158 {\unknownchar} % 009E <control>
+\defineactivetoken 159 {\unknownchar} % 009F <control>
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK
+\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN
+\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
+\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
+\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN
+\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN
+\defineactivetoken 175 {\textmacron} % 00AF MACRON
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO
+\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE
+\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT
+\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN
+\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA
+\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE
+\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\onequarter} % 00BC VULGAR FRACTION ONE QUARTER
+\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF
+\defineactivetoken 190 {\threequarter} % 00BE VULGAR FRACTION THREE QUARTERS
+\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK
+\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE
+\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE
+\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE
+\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE
+\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE
+\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA
+\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE
+\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS
+\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE
+\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE
+\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS
+\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH
+\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE
+\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE
+\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE
+\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN
+\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE
+\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE
+\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE
+\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE
+\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN
+\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S
+\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE
+\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE
+\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE
+\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
+\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE
+\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE
+\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA
+\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE
+\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE
+\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS
+\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE
+\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE
+\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS
+\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH
+\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE
+\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE
+\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE
+\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE
+\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
+\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN
+\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE
+\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE
+\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE
+\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX
+\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS
+\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE
+\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN
+\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-iso-8859-15.tex b/Master/texmf-dist/tex/context/base/regi-iso-8859-15.tex
new file mode 100644
index 00000000000..ad0c320da88
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-iso-8859-15.tex
@@ -0,0 +1,157 @@
+%D \module
+%D [ file=regi-iso-8859-15,
+%D version=2006.04.10,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=iso-8859-15 (West European),
+%D author=script-generated,
+%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.
+
+%D Support for iso-8859-15/Latin9 input encoding (regime) for West European languages,
+%D almost the same as iso-8859-1 with rarely used symbols (currency symbol,
+%D fractions, accents) replaced by Euro and some additional letters,
+%D see also cp1252.
+%D
+%D Usage:
+%D \type{\enableregime[iso-8859-15]} or
+%D \type{\enableregime[latin9]} or
+%D \type{\enableregime[il9]}
+
+
+\startregime[iso-8859-15]
+
+\defineactivetoken 128 {\unknownchar} % 0080 <control>
+\defineactivetoken 129 {\unknownchar} % 0081 <control>
+\defineactivetoken 130 {\unknownchar} % 0082 <control>
+\defineactivetoken 131 {\unknownchar} % 0083 <control>
+\defineactivetoken 132 {\unknownchar} % 0084 <control>
+\defineactivetoken 133 {\unknownchar} % 0085 <control>
+\defineactivetoken 134 {\unknownchar} % 0086 <control>
+\defineactivetoken 135 {\unknownchar} % 0087 <control>
+\defineactivetoken 136 {\unknownchar} % 0088 <control>
+\defineactivetoken 137 {\unknownchar} % 0089 <control>
+\defineactivetoken 138 {\unknownchar} % 008A <control>
+\defineactivetoken 139 {\unknownchar} % 008B <control>
+\defineactivetoken 140 {\unknownchar} % 008C <control>
+\defineactivetoken 141 {\unknownchar} % 008D <control>
+\defineactivetoken 142 {\unknownchar} % 008E <control>
+\defineactivetoken 143 {\unknownchar} % 008F <control>
+\defineactivetoken 144 {\unknownchar} % 0090 <control>
+\defineactivetoken 145 {\unknownchar} % 0091 <control>
+\defineactivetoken 146 {\unknownchar} % 0092 <control>
+\defineactivetoken 147 {\unknownchar} % 0093 <control>
+\defineactivetoken 148 {\unknownchar} % 0094 <control>
+\defineactivetoken 149 {\unknownchar} % 0095 <control>
+\defineactivetoken 150 {\unknownchar} % 0096 <control>
+\defineactivetoken 151 {\unknownchar} % 0097 <control>
+\defineactivetoken 152 {\unknownchar} % 0098 <control>
+\defineactivetoken 153 {\unknownchar} % 0099 <control>
+\defineactivetoken 154 {\unknownchar} % 009A <control>
+\defineactivetoken 155 {\unknownchar} % 009B <control>
+\defineactivetoken 156 {\unknownchar} % 009C <control>
+\defineactivetoken 157 {\unknownchar} % 009D <control>
+\defineactivetoken 158 {\unknownchar} % 009E <control>
+\defineactivetoken 159 {\unknownchar} % 009F <control>
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\exclamdown} % 00A1 INVERTED EXCLAMATION MARK
+\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN
+\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
+\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN
+\defineactivetoken 165 {\textyen} % 00A5 YEN SIGN
+\defineactivetoken 166 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\ordfeminine} % 00AA FEMININE ORDINAL INDICATOR
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\registered} % 00AE REGISTERED SIGN
+\defineactivetoken 175 {\textmacron} % 00AF MACRON
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO
+\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE
+\defineactivetoken 180 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON
+\defineactivetoken 181 {\textmu} % 00B5 MICRO SIGN
+\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON
+\defineactivetoken 185 {\onesuperior} % 00B9 SUPERSCRIPT ONE
+\defineactivetoken 186 {\ordmasculine} % 00BA MASCULINE ORDINAL INDICATOR
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\OEligature} % 0152 LATIN CAPITAL LIGATURE OE
+\defineactivetoken 189 {\oeligature} % 0153 LATIN SMALL LIGATURE OE
+\defineactivetoken 190 {\Ydiaeresis} % 0178 LATIN CAPITAL LETTER Y WITH DIAERESIS
+\defineactivetoken 191 {\questiondown} % 00BF INVERTED QUESTION MARK
+\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE
+\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE
+\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE
+\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+\defineactivetoken 197 {\Aring} % 00C5 LATIN CAPITAL LETTER A WITH RING ABOVE
+\defineactivetoken 198 {\AEligature} % 00C6 LATIN CAPITAL LETTER AE
+\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA
+\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE
+\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS
+\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE
+\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE
+\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 207 {\Idiaeresis} % 00CF LATIN CAPITAL LETTER I WITH DIAERESIS
+\defineactivetoken 208 {\Eth} % 00D0 LATIN CAPITAL LETTER ETH
+\defineactivetoken 209 {\Ntilde} % 00D1 LATIN CAPITAL LETTER N WITH TILDE
+\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE
+\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 213 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE
+\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN
+\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE
+\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE
+\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE
+\defineactivetoken 219 {\Ucircumflex} % 00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE
+\defineactivetoken 222 {\Thorn} % 00DE LATIN CAPITAL LETTER THORN
+\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S
+\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE
+\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE
+\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE
+\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
+\defineactivetoken 229 {\aring} % 00E5 LATIN SMALL LETTER A WITH RING ABOVE
+\defineactivetoken 230 {\aeligature} % 00E6 LATIN SMALL LETTER AE
+\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA
+\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE
+\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE
+\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS
+\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE
+\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE
+\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 239 {\idiaeresis} % 00EF LATIN SMALL LETTER I WITH DIAERESIS
+\defineactivetoken 240 {\eth} % 00F0 LATIN SMALL LETTER ETH
+\defineactivetoken 241 {\ntilde} % 00F1 LATIN SMALL LETTER N WITH TILDE
+\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE
+\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE
+\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE
+\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
+\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN
+\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE
+\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE
+\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE
+\defineactivetoken 251 {\ucircumflex} % 00FB LATIN SMALL LETTER U WITH CIRCUMFLEX
+\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS
+\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE
+\defineactivetoken 254 {\thorn} % 00FE LATIN SMALL LETTER THORN
+\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-iso-8859-2.tex b/Master/texmf-dist/tex/context/base/regi-iso-8859-2.tex
new file mode 100644
index 00000000000..cc14c4ec338
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-iso-8859-2.tex
@@ -0,0 +1,155 @@
+%D \module
+%D [ file=regi-iso-8859-2,
+%D version=2006.04.10,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=iso-8859-2 (East European),
+%D author=script-generated,
+%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.
+
+%D Support for iso-8859-2/Latin2 input encoding (regime) for Central European languages,
+%D see also cp1250.
+%D
+%D Usage:
+%D \type{\enableregime[iso-8859-2]} or
+%D \type{\enableregime[latin2]} or
+%D \type{\enableregime[il2]}
+
+
+\startregime[iso-8859-2]
+
+\defineactivetoken 128 {\unknownchar} % 0080 <control>
+\defineactivetoken 129 {\unknownchar} % 0081 <control>
+\defineactivetoken 130 {\unknownchar} % 0082 <control>
+\defineactivetoken 131 {\unknownchar} % 0083 <control>
+\defineactivetoken 132 {\unknownchar} % 0084 <control>
+\defineactivetoken 133 {\unknownchar} % 0085 <control>
+\defineactivetoken 134 {\unknownchar} % 0086 <control>
+\defineactivetoken 135 {\unknownchar} % 0087 <control>
+\defineactivetoken 136 {\unknownchar} % 0088 <control>
+\defineactivetoken 137 {\unknownchar} % 0089 <control>
+\defineactivetoken 138 {\unknownchar} % 008A <control>
+\defineactivetoken 139 {\unknownchar} % 008B <control>
+\defineactivetoken 140 {\unknownchar} % 008C <control>
+\defineactivetoken 141 {\unknownchar} % 008D <control>
+\defineactivetoken 142 {\unknownchar} % 008E <control>
+\defineactivetoken 143 {\unknownchar} % 008F <control>
+\defineactivetoken 144 {\unknownchar} % 0090 <control>
+\defineactivetoken 145 {\unknownchar} % 0091 <control>
+\defineactivetoken 146 {\unknownchar} % 0092 <control>
+\defineactivetoken 147 {\unknownchar} % 0093 <control>
+\defineactivetoken 148 {\unknownchar} % 0094 <control>
+\defineactivetoken 149 {\unknownchar} % 0095 <control>
+\defineactivetoken 150 {\unknownchar} % 0096 <control>
+\defineactivetoken 151 {\unknownchar} % 0097 <control>
+\defineactivetoken 152 {\unknownchar} % 0098 <control>
+\defineactivetoken 153 {\unknownchar} % 0099 <control>
+\defineactivetoken 154 {\unknownchar} % 009A <control>
+\defineactivetoken 155 {\unknownchar} % 009B <control>
+\defineactivetoken 156 {\unknownchar} % 009C <control>
+\defineactivetoken 157 {\unknownchar} % 009D <control>
+\defineactivetoken 158 {\unknownchar} % 009E <control>
+\defineactivetoken 159 {\unknownchar} % 009F <control>
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\Aogonek} % 0104 LATIN CAPITAL LETTER A WITH OGONEK
+\defineactivetoken 162 {\textbreve} % 02D8 BREVE
+\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE
+\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
+\defineactivetoken 165 {\Lcaron} % 013D LATIN CAPITAL LETTER L WITH CARON
+\defineactivetoken 166 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
+\defineactivetoken 169 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON
+\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA
+\defineactivetoken 171 {\Tcaron} % 0164 LATIN CAPITAL LETTER T WITH CARON
+\defineactivetoken 172 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 174 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON
+\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK
+\defineactivetoken 178 {\textogonek} % 02DB OGONEK
+\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE
+\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT
+\defineactivetoken 181 {\lcaron} % 013E LATIN SMALL LETTER L WITH CARON
+\defineactivetoken 182 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE
+\defineactivetoken 183 {\textcaron} % 02C7 CARON
+\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA
+\defineactivetoken 185 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON
+\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA
+\defineactivetoken 187 {\tcaron} % 0165 LATIN SMALL LETTER T WITH CARON
+\defineactivetoken 188 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE
+\defineactivetoken 189 {\texthungarumlaut} % 02DD DOUBLE ACUTE ACCENT
+\defineactivetoken 190 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON
+\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE
+\defineactivetoken 192 {\Racute} % 0154 LATIN CAPITAL LETTER R WITH ACUTE
+\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE
+\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 195 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE
+\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
+\defineactivetoken 197 {\Lacute} % 0139 LATIN CAPITAL LETTER L WITH ACUTE
+\defineactivetoken 198 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE
+\defineactivetoken 199 {\Ccedilla} % 00C7 LATIN CAPITAL LETTER C WITH CEDILLA
+\defineactivetoken 200 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON
+\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\defineactivetoken 202 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK
+\defineactivetoken 203 {\Ediaeresis} % 00CB LATIN CAPITAL LETTER E WITH DIAERESIS
+\defineactivetoken 204 {\Ecaron} % 011A LATIN CAPITAL LETTER E WITH CARON
+\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE
+\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 207 {\Dcaron} % 010E LATIN CAPITAL LETTER D WITH CARON
+\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE
+\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH ACUTE
+\defineactivetoken 210 {\Ncaron} % 0147 LATIN CAPITAL LETTER N WITH CARON
+\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 213 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
+\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN
+\defineactivetoken 216 {\Rcaron} % 0158 LATIN CAPITAL LETTER R WITH CARON
+\defineactivetoken 217 {\Uring} % 016E LATIN CAPITAL LETTER U WITH RING ABOVE
+\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE
+\defineactivetoken 219 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+\defineactivetoken 220 {\Udiaeresis} % 00DC LATIN CAPITAL LETTER U WITH DIAERESIS
+\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE
+\defineactivetoken 222 {\Tcedilla} % 0162 LATIN CAPITAL LETTER T WITH CEDILLA
+\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S
+\defineactivetoken 224 {\racute} % 0155 LATIN SMALL LETTER R WITH ACUTE
+\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE
+\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 227 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE
+\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
+\defineactivetoken 229 {\lacute} % 013A LATIN SMALL LETTER L WITH ACUTE
+\defineactivetoken 230 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE
+\defineactivetoken 231 {\ccedilla} % 00E7 LATIN SMALL LETTER C WITH CEDILLA
+\defineactivetoken 232 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON
+\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE
+\defineactivetoken 234 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK
+\defineactivetoken 235 {\ediaeresis} % 00EB LATIN SMALL LETTER E WITH DIAERESIS
+\defineactivetoken 236 {\ecaron} % 011B LATIN SMALL LETTER E WITH CARON
+\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE
+\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
+\defineactivetoken 239 {\dcaron} % 010F LATIN SMALL LETTER D WITH CARON
+\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE
+\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE
+\defineactivetoken 242 {\ncaron} % 0148 LATIN SMALL LETTER N WITH CARON
+\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE
+\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 245 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE
+\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
+\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN
+\defineactivetoken 248 {\rcaron} % 0159 LATIN SMALL LETTER R WITH CARON
+\defineactivetoken 249 {\uring} % 016F LATIN SMALL LETTER U WITH RING ABOVE
+\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE
+\defineactivetoken 251 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE
+\defineactivetoken 252 {\udiaeresis} % 00FC LATIN SMALL LETTER U WITH DIAERESIS
+\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE
+\defineactivetoken 254 {\tcedilla} % 0163 LATIN SMALL LETTER T WITH CEDILLA
+\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-iso-8859-7.tex b/Master/texmf-dist/tex/context/base/regi-iso-8859-7.tex
new file mode 100644
index 00000000000..aa1e2e321bc
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-iso-8859-7.tex
@@ -0,0 +1,155 @@
+%D \module
+%D [ file=regi-iso-8859-7,
+%D version=2006.04.10,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=iso-8859-7 (Greek),
+%D author=script-generated,
+%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.
+
+%D Support for iso-8859-7 input encoding (regime) for Greek,
+%D see also cp1253.
+%D
+%D (Contributor to the original file: Apostolos Syropoulos.)
+%D
+%D Usage:
+%D \type{\enableregime[iso-8859-7]} or
+%D \type{\enableregime[grk]}
+
+
+\startregime[iso-8859-7]
+
+\defineactivetoken 128 {\unknownchar} % 0080 <control>
+\defineactivetoken 129 {\unknownchar} % 0081 <control>
+\defineactivetoken 130 {\unknownchar} % 0082 <control>
+\defineactivetoken 131 {\unknownchar} % 0083 <control>
+\defineactivetoken 132 {\unknownchar} % 0084 <control>
+\defineactivetoken 133 {\unknownchar} % 0085 <control>
+\defineactivetoken 134 {\unknownchar} % 0086 <control>
+\defineactivetoken 135 {\unknownchar} % 0087 <control>
+\defineactivetoken 136 {\unknownchar} % 0088 <control>
+\defineactivetoken 137 {\unknownchar} % 0089 <control>
+\defineactivetoken 138 {\unknownchar} % 008A <control>
+\defineactivetoken 139 {\unknownchar} % 008B <control>
+\defineactivetoken 140 {\unknownchar} % 008C <control>
+\defineactivetoken 141 {\unknownchar} % 008D <control>
+\defineactivetoken 142 {\unknownchar} % 008E <control>
+\defineactivetoken 143 {\unknownchar} % 008F <control>
+\defineactivetoken 144 {\unknownchar} % 0090 <control>
+\defineactivetoken 145 {\unknownchar} % 0091 <control>
+\defineactivetoken 146 {\unknownchar} % 0092 <control>
+\defineactivetoken 147 {\unknownchar} % 0093 <control>
+\defineactivetoken 148 {\unknownchar} % 0094 <control>
+\defineactivetoken 149 {\unknownchar} % 0095 <control>
+\defineactivetoken 150 {\unknownchar} % 0096 <control>
+\defineactivetoken 151 {\unknownchar} % 0097 <control>
+\defineactivetoken 152 {\unknownchar} % 0098 <control>
+\defineactivetoken 153 {\unknownchar} % 0099 <control>
+\defineactivetoken 154 {\unknownchar} % 009A <control>
+\defineactivetoken 155 {\unknownchar} % 009B <control>
+\defineactivetoken 156 {\unknownchar} % 009C <control>
+\defineactivetoken 157 {\unknownchar} % 009D <control>
+\defineactivetoken 158 {\unknownchar} % 009E <control>
+\defineactivetoken 159 {\unknownchar} % 009F <control>
+\defineactivetoken 160 {\nonbreakablespace} % 00A0 NO-BREAK SPACE
+\defineactivetoken 161 {\quoteleft} % 2018 LEFT SINGLE QUOTATION MARK
+\defineactivetoken 162 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK
+\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
+\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN
+\defineactivetoken 165 {\?} % 20AF DRACHMA SIGN
+\defineactivetoken 166 {\textbrokenbar} % 00A6 BROKEN BAR
+\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
+\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
+\defineactivetoken 169 {\copyright} % 00A9 COPYRIGHT SIGN
+\defineactivetoken 170 {\?} % 037A GREEK YPOGEGRAMMENI
+\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 172 {\textlognot} % 00AC NOT SIGN
+\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
+\defineactivetoken 175 {\texthorizontalbar} % 2015 HORIZONTAL BAR
+\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
+\defineactivetoken 177 {\textpm} % 00B1 PLUS-MINUS SIGN
+\defineactivetoken 178 {\twosuperior} % 00B2 SUPERSCRIPT TWO
+\defineactivetoken 179 {\threesuperior} % 00B3 SUPERSCRIPT THREE
+\defineactivetoken 180 {\greektonos} % 0384 GREEK TONOS
+\defineactivetoken 181 {\greekdialytikatonos} % 0385 GREEK DIALYTIKA TONOS
+\defineactivetoken 182 {\greekAlphatonos} % 0386 GREEK CAPITAL LETTER ALPHA WITH TONOS
+\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
+\defineactivetoken 184 {\greekEpsilontonos} % 0388 GREEK CAPITAL LETTER EPSILON WITH TONOS
+\defineactivetoken 185 {\greekEtatonos} % 0389 GREEK CAPITAL LETTER ETA WITH TONOS
+\defineactivetoken 186 {\greekIotatonos} % 038A GREEK CAPITAL LETTER IOTA WITH TONOS
+\defineactivetoken 187 {\rightguillemot} % 00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+\defineactivetoken 188 {\greekOmicrontonos} % 038C GREEK CAPITAL LETTER OMICRON WITH TONOS
+\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF
+\defineactivetoken 190 {\greekUpsilontonos} % 038E GREEK CAPITAL LETTER UPSILON WITH TONOS
+\defineactivetoken 191 {\greekOmegatonos} % 038F GREEK CAPITAL LETTER OMEGA WITH TONOS
+\defineactivetoken 192 {\greekiotadialytikatonos} % 0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+\defineactivetoken 193 {\greekAlpha} % 0391 GREEK CAPITAL LETTER ALPHA
+\defineactivetoken 194 {\greekBeta} % 0392 GREEK CAPITAL LETTER BETA
+\defineactivetoken 195 {\greekGamma} % 0393 GREEK CAPITAL LETTER GAMMA
+\defineactivetoken 196 {\greekDelta} % 0394 GREEK CAPITAL LETTER DELTA
+\defineactivetoken 197 {\greekEpsilon} % 0395 GREEK CAPITAL LETTER EPSILON
+\defineactivetoken 198 {\greekZeta} % 0396 GREEK CAPITAL LETTER ZETA
+\defineactivetoken 199 {\greekEta} % 0397 GREEK CAPITAL LETTER ETA
+\defineactivetoken 200 {\greekTheta} % 0398 GREEK CAPITAL LETTER THETA
+\defineactivetoken 201 {\greekIota} % 0399 GREEK CAPITAL LETTER IOTA
+\defineactivetoken 202 {\greekKappa} % 039A GREEK CAPITAL LETTER KAPPA
+\defineactivetoken 203 {\greekLambda} % 039B GREEK CAPITAL LETTER LAMDA
+\defineactivetoken 204 {\greekMu} % 039C GREEK CAPITAL LETTER MU
+\defineactivetoken 205 {\greekNu} % 039D GREEK CAPITAL LETTER NU
+\defineactivetoken 206 {\greekXi} % 039E GREEK CAPITAL LETTER XI
+\defineactivetoken 207 {\greekOmicron} % 039F GREEK CAPITAL LETTER OMICRON
+\defineactivetoken 208 {\greekPi} % 03A0 GREEK CAPITAL LETTER PI
+\defineactivetoken 209 {\greekRho} % 03A1 GREEK CAPITAL LETTER RHO
+\defineactivetoken 210 {\unknownchar} % <undefined>
+\defineactivetoken 211 {\greekSigma} % 03A3 GREEK CAPITAL LETTER SIGMA
+\defineactivetoken 212 {\greekTau} % 03A4 GREEK CAPITAL LETTER TAU
+\defineactivetoken 213 {\greekUpsilon} % 03A5 GREEK CAPITAL LETTER UPSILON
+\defineactivetoken 214 {\greekPhi} % 03A6 GREEK CAPITAL LETTER PHI
+\defineactivetoken 215 {\greekChi} % 03A7 GREEK CAPITAL LETTER CHI
+\defineactivetoken 216 {\greekPsi} % 03A8 GREEK CAPITAL LETTER PSI
+\defineactivetoken 217 {\greekOmega} % 03A9 GREEK CAPITAL LETTER OMEGA
+\defineactivetoken 218 {\greekIotadialytika} % 03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+\defineactivetoken 219 {\greekUpsilondialytika} % 03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+\defineactivetoken 220 {\greekalphatonos} % 03AC GREEK SMALL LETTER ALPHA WITH TONOS
+\defineactivetoken 221 {\greekepsilontonos} % 03AD GREEK SMALL LETTER EPSILON WITH TONOS
+\defineactivetoken 222 {\greeketatonos} % 03AE GREEK SMALL LETTER ETA WITH TONOS
+\defineactivetoken 223 {\greekiotatonos} % 03AF GREEK SMALL LETTER IOTA WITH TONOS
+\defineactivetoken 224 {\greekupsilondialytikatonos} % 03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+\defineactivetoken 225 {\greekalpha} % 03B1 GREEK SMALL LETTER ALPHA
+\defineactivetoken 226 {\greekbeta} % 03B2 GREEK SMALL LETTER BETA
+\defineactivetoken 227 {\greekgamma} % 03B3 GREEK SMALL LETTER GAMMA
+\defineactivetoken 228 {\greekdelta} % 03B4 GREEK SMALL LETTER DELTA
+\defineactivetoken 229 {\greekepsilon} % 03B5 GREEK SMALL LETTER EPSILON
+\defineactivetoken 230 {\greekzeta} % 03B6 GREEK SMALL LETTER ZETA
+\defineactivetoken 231 {\greeketa} % 03B7 GREEK SMALL LETTER ETA
+\defineactivetoken 232 {\greektheta} % 03B8 GREEK SMALL LETTER THETA
+\defineactivetoken 233 {\greekiota} % 03B9 GREEK SMALL LETTER IOTA
+\defineactivetoken 234 {\greekkappa} % 03BA GREEK SMALL LETTER KAPPA
+\defineactivetoken 235 {\greeklambda} % 03BB GREEK SMALL LETTER LAMDA
+\defineactivetoken 236 {\greekmu} % 03BC GREEK SMALL LETTER MU
+\defineactivetoken 237 {\greeknu} % 03BD GREEK SMALL LETTER NU
+\defineactivetoken 238 {\greekxi} % 03BE GREEK SMALL LETTER XI
+\defineactivetoken 239 {\greekomicron} % 03BF GREEK SMALL LETTER OMICRON
+\defineactivetoken 240 {\greekpi} % 03C0 GREEK SMALL LETTER PI
+\defineactivetoken 241 {\greekrho} % 03C1 GREEK SMALL LETTER RHO
+\defineactivetoken 242 {\greekfinalsigma} % 03C2 GREEK SMALL LETTER FINAL SIGMA
+\defineactivetoken 243 {\greeksigma} % 03C3 GREEK SMALL LETTER SIGMA
+\defineactivetoken 244 {\greektau} % 03C4 GREEK SMALL LETTER TAU
+\defineactivetoken 245 {\greekupsilon} % 03C5 GREEK SMALL LETTER UPSILON
+\defineactivetoken 246 {\greekphi} % 03C6 GREEK SMALL LETTER PHI
+\defineactivetoken 247 {\greekchi} % 03C7 GREEK SMALL LETTER CHI
+\defineactivetoken 248 {\greekpsi} % 03C8 GREEK SMALL LETTER PSI
+\defineactivetoken 249 {\greekomega} % 03C9 GREEK SMALL LETTER OMEGA
+\defineactivetoken 250 {\greekiotadialytika} % 03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA
+\defineactivetoken 251 {\greekupsilondiaeresis} % 03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+\defineactivetoken 252 {\greekomicrontonos} % 03CC GREEK SMALL LETTER OMICRON WITH TONOS
+\defineactivetoken 253 {\greekupsilontonos} % 03CD GREEK SMALL LETTER UPSILON WITH TONOS
+\defineactivetoken 254 {\greekomegatonos} % 03CE GREEK SMALL LETTER OMEGA WITH TONOS
+\defineactivetoken 255 {\unknownchar} % <undefined>
+
+\stopregime
+
diff --git a/Master/texmf-dist/tex/context/base/regi-syn.tex b/Master/texmf-dist/tex/context/base/regi-syn.tex
new file mode 100644
index 00000000000..324ccf62b25
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/regi-syn.tex
@@ -0,0 +1,62 @@
+%D \module
+%D [ file=regi-syn,
+%D version=2006.04.04,
+%D title=\CONTEXT\ Regime Macros,
+%D subtitle=Synonyms,
+%D author=Mojca Miklavec \& Hans Hagen,
+%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.
+
+\writestatus{loading}{Context Regime Macros (synonyms)}
+
+\unprotect
+
+\defineregimesynonym [windows-1250] [cp1250]
+\defineregimesynonym [windows-1251] [cp1251]
+\defineregimesynonym [windows-1252] [cp1252]
+\defineregimesynonym [windows-1253] [cp1253]
+\defineregimesynonym [windows-1254] [cp1254]
+%defineregimesynonym [windows-1255] [cp1255] % not supported yet (Hebrew)
+%defineregimesynonym [windows-1256] [cp1256] % not supported yet (Arabic)
+\defineregimesynonym [windows-1257] [cp1257]
+%defineregimesynonym [windows-1258] [cp1258] % not supported yet (Vietnamese)
+
+\defineregimesynonym [il1] [iso-8859-1]
+\defineregimesynonym [il2] [iso-8859-2]
+\defineregimesynonym [il3] [iso-8859-3]
+\defineregimesynonym [il4] [iso-8859-4]
+\defineregimesynonym [il5] [iso-8859-9]
+\defineregimesynonym [il6] [iso-8859-10]
+\defineregimesynonym [il7] [iso-8859-13]
+%defineregimesynonym [il8] [iso-8859-14]
+\defineregimesynonym [il9] [iso-8859-15]
+\defineregimesynonym [il10] [iso-8859-16]
+
+\defineregimesynonym [latin1] [iso-8859-1]
+\defineregimesynonym [latin2] [iso-8859-2]
+\defineregimesynonym [latin3] [iso-8859-3]
+\defineregimesynonym [latin4] [iso-8859-4]
+\defineregimesynonym [latin5] [iso-8859-9]
+\defineregimesynonym [latin6] [iso-8859-10]
+\defineregimesynonym [latin7] [iso-8859-13]
+%defineregimesynonym [latin8] [iso-8859-14]
+\defineregimesynonym [latin9] [iso-8859-15]
+\defineregimesynonym [latin10] [iso-8859-16]
+
+% kind of special
+
+\defineregimesynonym [utf-8] [utf]
+\defineregimesynonym [utf8] [utf]
+
+% for historical reasons / compatibility
+
+\defineregimesynonym [windows] [cp1252]
+\defineregimesynonym [grk] [iso-8859-7]
+\defineregimesynonym [iso88595] [iso-8859-5]
+
+\protect \endinput
+
diff --git a/Master/texmf-dist/tex/context/base/regi-uni.tex b/Master/texmf-dist/tex/context/base/regi-uni.tex
index 2b749967fc9..c4d9521e9d0 100644
--- a/Master/texmf-dist/tex/context/base/regi-uni.tex
+++ b/Master/texmf-dist/tex/context/base/regi-uni.tex
@@ -2,17 +2,18 @@
%D [ file=enco-uni,
%D version=1998.10.18,
%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Unicode,
+%D subtitle=Unicode,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-%D This module activates all characters in the upper range
-%D and sets them to the basic unicodehandler.
+%D This module activates all characters in the upper range
+%D and sets them to the basic unicodehandler. Beware, this is
+%D a special purpose handler (esp for chinese encodings).
\startregime[unicode]
@@ -20,4 +21,4 @@
\stopregime
-\endinput
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/regi-utf.tex b/Master/texmf-dist/tex/context/base/regi-utf.tex
index b529406e135..da89eedec78 100644
--- a/Master/texmf-dist/tex/context/base/regi-utf.tex
+++ b/Master/texmf-dist/tex/context/base/regi-utf.tex
@@ -17,12 +17,30 @@
%D instead of a active token handler because here we don't want
%D the \type {{}}. We only support this in \ETEX.
+% ÀÁÂÃÄÅàáâãäå
+% ÆÇæç
+% ÈÉÊËèéêë
+% ÌÍÎÏÞìíîïþ
+% Ðð
+% Ññ
+% ÒÓÔÕÖòóôõö
+% Øø
+% ÙÚÛÜùúû
+% Ýýÿ
+% ß
+
\beginTEX
\expandafter \endinput
\endTEX
+\beginXETEX
+ \expandafter \endinput
+\endXETEX
+
\unprotect
+% beware, this may change: \utftwouniglyph rawchar
+
\startregime[utf]
\dostepwiserecurse{192}{223}{1}
diff --git a/Master/texmf-dist/tex/context/base/regi-vis.tex b/Master/texmf-dist/tex/context/base/regi-vis.tex
index ceac691c417..d1071354f96 100644
--- a/Master/texmf-dist/tex/context/base/regi-vis.tex
+++ b/Master/texmf-dist/tex/context/base/regi-vis.tex
@@ -1,152 +1,158 @@
-% temporary module
+%D \module
+%D [ file=regi-vis,
+%D version=2005.12.26,
+%D title=\CONTEXT\ Encoding Macros,
+%D subtitle=viscii,
+%D author=script-generated,
+%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.
-\startregime[viscii]
-
-\defineactivetoken 2 {\h{uA}}
-\defineactivetoken 5 {\~{uA}}
-\defineactivetoken 6 {\~{^A}}
-\defineactivetoken 20 {\h{Y}}
-\defineactivetoken 23 {\h{Y}}
-\defineactivetoken 24 {\d{Y}}
-\defineactivetoken 25 {\~{Y}}
-\defineactivetoken 30 {\d{Y}}
-
-\defineactivetoken 128 {\d{A}}
-\defineactivetoken 129 {\'{uA}}
-\defineactivetoken 130 {\`{uA}}
-\defineactivetoken 131 {\d{uA}}
-\defineactivetoken 132 {\'{^A}}
-\defineactivetoken 133 {\`{^A}}
-\defineactivetoken 134 {\h{^A}}
-\defineactivetoken 135 {\d{^A}}
-\defineactivetoken 136 {\~{E}}
-\defineactivetoken 137 {\d{E}}
-\defineactivetoken 138 {\'{^E}}
-\defineactivetoken 139 {\`{^E}}
-\defineactivetoken 140 {\h{^E}}
-\defineactivetoken 141 {\~{^E}}
-\defineactivetoken 142 {\d{^E}}
-\defineactivetoken 143 {\'{^O}}
-
-\defineactivetoken 144 {\`{^O}}
-\defineactivetoken 145 {\h{^O}}
-\defineactivetoken 146 {\~{^O}}
-\defineactivetoken 147 {\d{^O}}
-\defineactivetoken 148 {\d{hO}}
-\defineactivetoken 149 {\'{hO}}
-\defineactivetoken 150 {\`{hO}}
-\defineactivetoken 151 {\h{hO}}
-\defineactivetoken 152 {\d{I}}
-\defineactivetoken 153 {\h{O}}
-\defineactivetoken 154 {\d{O}}
-\defineactivetoken 155 {\h{I}}
-\defineactivetoken 156 {\h{U}}
-\defineactivetoken 157 {\~{U}}
-\defineactivetoken 158 {\d{U}}
-\defineactivetoken 159 {\`{Y}}
+%D Support for VISCII input encoding (regime) for Vietnamese.
+%D
+%D Usage:
+%D \type{\enableregime[vis]}
-\defineactivetoken 160 {\~{O}}
-\defineactivetoken 161 {\'{ua}}
-\defineactivetoken 162 {\`{ua}}
-\defineactivetoken 163 {\d{ua}}
-\defineactivetoken 164 {\'{^a}}
-\defineactivetoken 165 {\`{^a}}
-\defineactivetoken 166 {\h{^a}}
-\defineactivetoken 167 {\d{^a}}
-\defineactivetoken 168 {\~{e}}
-\defineactivetoken 169 {\d{ e}}
-\defineactivetoken 170 {\'{^e}}
-\defineactivetoken 171 {\`{^e}}
-\defineactivetoken 172 {\h{^e}}
-\defineactivetoken 173 {\~{^e}}
-\defineactivetoken 174 {\d{^e}}
-\defineactivetoken 175 {\'{^o}}
-\defineactivetoken 176 {\`{^o}}
-\defineactivetoken 177 {\h{^o}}
-\defineactivetoken 178 {\~{^o}}
-\defineactivetoken 179 {\~{hO}}
-\defineactivetoken 180 {\h{O}}
-\defineactivetoken 181 {\d{^o}}
-\defineactivetoken 182 {\`{ho}}
-\defineactivetoken 183 {\h{ho}}
-\defineactivetoken 184 {\d{i}}
-\defineactivetoken 185 {\d{hU}}
-\defineactivetoken 186 {\'{hU}}
-\defineactivetoken 187 {\`{hU}}
-\defineactivetoken 188 {\h{hU}}
-\defineactivetoken 189 {\h{o}}
-\defineactivetoken 190 {\'{ho}}
-\defineactivetoken 191 {\h{U}}
-
-\defineactivetoken 192 {\`{A}}
-\defineactivetoken 193 {\'{A}}
-\defineactivetoken 194 {\^{A}}
-\defineactivetoken 195 {\~{A}}
-\defineactivetoken 196 {\h{A}}
-\defineactivetoken 197 {\u{A}}
-\defineactivetoken 198 {\h{ua}}
-\defineactivetoken 199 {\~{ua}}
-\defineactivetoken 200 {\`{E}}
-\defineactivetoken 201 {\'{E}}
-\defineactivetoken 202 {\^{E}}
-\defineactivetoken 203 {\h{E}}
-\defineactivetoken 204 {\`{I}}
-\defineactivetoken 205 {\'{I}}
-\defineactivetoken 206 {\~{I}}
-\defineactivetoken 207 {\`{y}}
-
-\defineactivetoken 208 {\DJ{}}
-\defineactivetoken 209 {\'{hu}}
-\defineactivetoken 210 {\`{O}}
-\defineactivetoken 211 {\'{O}}
-\defineactivetoken 212 {\^{O}}
-\defineactivetoken 213 {\d{a}}
-\defineactivetoken 214 {\h{y}}
-\defineactivetoken 215 {\`{hu}}
-\defineactivetoken 216 {\h{hu}}
-\defineactivetoken 217 {\`{U}}
-\defineactivetoken 218 {\'{U}}
-\defineactivetoken 219 {\~{y}}
-\defineactivetoken 220 {\d{y}}
-\defineactivetoken 221 {\'{Y}}
-\defineactivetoken 222 {\~{ho}}
-\defineactivetoken 223 {\h{u}}
-
-\defineactivetoken 224 {\`{a}}
-\defineactivetoken 225 {\'{a}}
-\defineactivetoken 226 {\^{a}}
-\defineactivetoken 227 {\~{a}}
-\defineactivetoken 228 {\h{a}}
-\defineactivetoken 229 {\u{a}}
-\defineactivetoken 230 {\~{hu}}
-\defineactivetoken 231 {\~{^a}}
-\defineactivetoken 232 {\`{e}}
-\defineactivetoken 233 {\'{e}}
-\defineactivetoken 234 {\^{e}}
-\defineactivetoken 235 {\h{e}}
-\defineactivetoken 236 {\`{i}}
-\defineactivetoken 237 {\'{i}}
-\defineactivetoken 238 {\~{i}}
-\defineactivetoken 239 {\h{i}}
+\startregime[viscii]
-\defineactivetoken 240 {\dj{}}
-\defineactivetoken 241 {\d{hu}}
-\defineactivetoken 242 {\`{o}}
-\defineactivetoken 243 {\'{o}}
-\defineactivetoken 244 {\^{o}}
-\defineactivetoken 245 {\~{o}}
-\defineactivetoken 246 {\h{o}}
-\defineactivetoken 247 {\d{o}}
-\defineactivetoken 248 {\d{u}}
-\defineactivetoken 249 {\`{u}}
-\defineactivetoken 250 {\'{u}}
-\defineactivetoken 251 {\~{u}}
-\defineactivetoken 252 {\h{u}}
-\defineactivetoken 253 {\'{y}}
-\defineactivetoken 254 {\d{ho}}
-\defineactivetoken 255 {\~{hU}}
+\defineactivetoken 2 {\Abrevehook} % 1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+\defineactivetoken 5 {\Abrevetilde} % 1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+\defineactivetoken 6 {\Acircumflextilde} % 1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+\defineactivetoken 20 {\Yhook} % 1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE
+\defineactivetoken 25 {\Ytilde} % 1EF8 LATIN CAPITAL LETTER Y WITH TILDE
+\defineactivetoken 30 {\Ydotbelow} % 1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW
+\defineactivetoken 128 {\Adotbelow} % 1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW
+\defineactivetoken 129 {\Abreveacute} % 1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+\defineactivetoken 130 {\Abrevegrave} % 1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+\defineactivetoken 131 {\Abrevedotbelow} % 1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+\defineactivetoken 132 {\Acircumflexacute} % 1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+\defineactivetoken 133 {\Acircumflexgrave} % 1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+\defineactivetoken 134 {\Acircumflexhook} % 1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+\defineactivetoken 135 {\Acircumflexdotbelow} % 1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+\defineactivetoken 136 {\Etilde} % 1EBC LATIN CAPITAL LETTER E WITH TILDE
+\defineactivetoken 137 {\Edotbelow} % 1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW
+\defineactivetoken 138 {\Ecircumflexacute} % 1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+\defineactivetoken 139 {\Ecircumflexgrave} % 1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+\defineactivetoken 140 {\Ecircumflexhook} % 1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+\defineactivetoken 141 {\Ecircumflextilde} % 1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+\defineactivetoken 142 {\Ecircumflexdotbelow} % 1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+\defineactivetoken 143 {\Ocircumflexacute} % 1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+\defineactivetoken 144 {\Ocircumflexgrave} % 1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+\defineactivetoken 145 {\Ocircumflexhook} % 1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+\defineactivetoken 146 {\Ocircumflextilde} % 1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+\defineactivetoken 147 {\Ocircumflexdotbelow} % 1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+\defineactivetoken 148 {\Ohorndotbelow} % 1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+\defineactivetoken 149 {\Ohornacute} % 1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+\defineactivetoken 150 {\Ohorngrave} % 1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+\defineactivetoken 151 {\Ohornhook} % 1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+\defineactivetoken 152 {\Idotbelow} % 1ECA LATIN CAPITAL LETTER I WITH DOT BELOW
+\defineactivetoken 153 {\Ohook} % 1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE
+\defineactivetoken 154 {\Odotbelow} % 1ECC LATIN CAPITAL LETTER O WITH DOT BELOW
+\defineactivetoken 155 {\Ihook} % 1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE
+\defineactivetoken 156 {\Uhook} % 1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE
+\defineactivetoken 157 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE
+\defineactivetoken 158 {\Udotbelow} % 1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW
+\defineactivetoken 159 {\Ygrave} % 1EF2 LATIN CAPITAL LETTER Y WITH GRAVE
+\defineactivetoken 160 {\Otilde} % 00D5 LATIN CAPITAL LETTER O WITH TILDE
+\defineactivetoken 161 {\abreveacute} % 1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE
+\defineactivetoken 162 {\abrevegrave} % 1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE
+\defineactivetoken 163 {\abrevedotbelow} % 1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+\defineactivetoken 164 {\acircumflexacute} % 1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+\defineactivetoken 165 {\acircumflexgrave} % 1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+\defineactivetoken 166 {\Acircumflexhook} % 1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+\defineactivetoken 167 {\acircumflexdotbelow} % 1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+\defineactivetoken 168 {\etilde} % 1EBD LATIN SMALL LETTER E WITH TILDE
+\defineactivetoken 169 {\edotbelow} % 1EB9 LATIN SMALL LETTER E WITH DOT BELOW
+\defineactivetoken 170 {\ecircumflexacute} % 1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+\defineactivetoken 171 {\ecircumflexgrave} % 1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+\defineactivetoken 172 {\ecircumflexhook} % 1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+\defineactivetoken 173 {\ecircumflextilde} % 1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+\defineactivetoken 174 {\ecircumflexdotbelow} % 1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+\defineactivetoken 175 {\ocircumflexacute} % 1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+\defineactivetoken 176 {\ocircumflexgrave} % 1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+\defineactivetoken 177 {\ocircumflexhook} % 1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+\defineactivetoken 178 {\ocircumflextilde} % 1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+\defineactivetoken 179 {\Ohorntilde} % 1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE
+\defineactivetoken 180 {\Ohorn} % 01A0 LATIN CAPITAL LETTER O WITH HORN
+\defineactivetoken 181 {\ocircumflexdotbelow} % 1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+\defineactivetoken 182 {\ohorngrave} % 1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE
+\defineactivetoken 183 {\ohornhook} % 1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+\defineactivetoken 184 {\idotbelow} % 1ECB LATIN SMALL LETTER I WITH DOT BELOW
+\defineactivetoken 185 {\Uhorndotbelow} % 1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+\defineactivetoken 186 {\Uhornacute} % 1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+\defineactivetoken 187 {\Uhorngrave} % 1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+\defineactivetoken 188 {\Uhornhook} % 1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+\defineactivetoken 189 {\ohorn} % 01A1 LATIN SMALL LETTER O WITH HORN
+\defineactivetoken 190 {\ohornacute} % 1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE
+\defineactivetoken 191 {\Uhorn} % 01AF LATIN CAPITAL LETTER U WITH HORN
+\defineactivetoken 192 {\Agrave} % 00C0 LATIN CAPITAL LETTER A WITH GRAVE
+\defineactivetoken 193 {\Aacute} % 00C1 LATIN CAPITAL LETTER A WITH ACUTE
+\defineactivetoken 194 {\Acircumflex} % 00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 195 {\Atilde} % 00C3 LATIN CAPITAL LETTER A WITH TILDE
+\defineactivetoken 196 {\Ahook} % 1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE
+\defineactivetoken 197 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE
+\defineactivetoken 198 {\abrevehook} % 1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+\defineactivetoken 199 {\abrevetilde} % 1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE
+\defineactivetoken 200 {\Egrave} % 00C8 LATIN CAPITAL LETTER E WITH GRAVE
+\defineactivetoken 201 {\Eacute} % 00C9 LATIN CAPITAL LETTER E WITH ACUTE
+\defineactivetoken 202 {\Ecircumflex} % 00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 203 {\Ehook} % 1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE
+\defineactivetoken 204 {\Igrave} % 00CC LATIN CAPITAL LETTER I WITH GRAVE
+\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE
+\defineactivetoken 206 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE
+\defineactivetoken 207 {\ygrave} % 1EF3 LATIN SMALL LETTER Y WITH GRAVE
+\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE
+\defineactivetoken 209 {\uhornacute} % 1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE
+\defineactivetoken 210 {\Ograve} % 00D2 LATIN CAPITAL LETTER O WITH GRAVE
+\defineactivetoken 211 {\Oacute} % 00D3 LATIN CAPITAL LETTER O WITH ACUTE
+\defineactivetoken 212 {\Ocircumflex} % 00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 213 {\adotbelow} % 1EA1 LATIN SMALL LETTER A WITH DOT BELOW
+\defineactivetoken 214 {\yhook} % 1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE
+\defineactivetoken 215 {\uhorngrave} % 1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE
+\defineactivetoken 216 {\uhornhook} % 1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+\defineactivetoken 217 {\Ugrave} % 00D9 LATIN CAPITAL LETTER U WITH GRAVE
+\defineactivetoken 218 {\Uacute} % 00DA LATIN CAPITAL LETTER U WITH ACUTE
+\defineactivetoken 219 {\ytilde} % 1EF9 LATIN SMALL LETTER Y WITH TILDE
+\defineactivetoken 220 {\ydotbelow} % 1EF5 LATIN SMALL LETTER Y WITH DOT BELOW
+\defineactivetoken 221 {\Yacute} % 00DD LATIN CAPITAL LETTER Y WITH ACUTE
+\defineactivetoken 222 {\ohorntilde} % 1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE
+\defineactivetoken 223 {\uhorn} % 01B0 LATIN SMALL LETTER U WITH HORN
+\defineactivetoken 224 {\agrave} % 00E0 LATIN SMALL LETTER A WITH GRAVE
+\defineactivetoken 225 {\aacute} % 00E1 LATIN SMALL LETTER A WITH ACUTE
+\defineactivetoken 226 {\acircumflex} % 00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX
+\defineactivetoken 227 {\atilde} % 00E3 LATIN SMALL LETTER A WITH TILDE
+\defineactivetoken 228 {\ahook} % 1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE
+\defineactivetoken 229 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE
+\defineactivetoken 230 {\uhorntilde} % 1EEF LATIN SMALL LETTER U WITH HORN AND TILDE
+\defineactivetoken 231 {\acircumflextilde} % 1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+\defineactivetoken 232 {\egrave} % 00E8 LATIN SMALL LETTER E WITH GRAVE
+\defineactivetoken 233 {\eacute} % 00E9 LATIN SMALL LETTER E WITH ACUTE
+\defineactivetoken 234 {\ecircumflex} % 00EA LATIN SMALL LETTER E WITH CIRCUMFLEX
+\defineactivetoken 235 {\ehook} % 1EBB LATIN SMALL LETTER E WITH HOOK ABOVE
+\defineactivetoken 236 {\igrave} % 00EC LATIN SMALL LETTER I WITH GRAVE
+\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE
+\defineactivetoken 238 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE
+\defineactivetoken 239 {\ihook} % 1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE
+\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE
+\defineactivetoken 241 {\uhorndotbelow} % 1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+\defineactivetoken 242 {\ograve} % 00F2 LATIN SMALL LETTER O WITH GRAVE
+\defineactivetoken 243 {\oacute} % 00F3 LATIN SMALL LETTER O WITH ACUTE
+\defineactivetoken 244 {\ocircumflex} % 00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX
+\defineactivetoken 245 {\otilde} % 00F5 LATIN SMALL LETTER O WITH TILDE
+\defineactivetoken 246 {\ohook} % 1ECF LATIN SMALL LETTER O WITH HOOK ABOVE
+\defineactivetoken 247 {\odotbelow} % 1ECD LATIN SMALL LETTER O WITH DOT BELOW
+\defineactivetoken 248 {\udotbelow} % 1EE5 LATIN SMALL LETTER U WITH DOT BELOW
+\defineactivetoken 249 {\ugrave} % 00F9 LATIN SMALL LETTER U WITH GRAVE
+\defineactivetoken 250 {\uacute} % 00FA LATIN SMALL LETTER U WITH ACUTE
+\defineactivetoken 251 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE
+\defineactivetoken 252 {\uhook} % 1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE
+\defineactivetoken 253 {\yacute} % 00FD LATIN SMALL LETTER Y WITH ACUTE
+\defineactivetoken 254 {\ohorndotbelow} % 1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+\defineactivetoken 255 {\Uhorntilde} % 1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE
\stopregime
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/rlxtools.rlx b/Master/texmf-dist/tex/context/base/rlxtools.rlx
new file mode 100644
index 00000000000..2c5c3c6cef8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/rlxtools.rlx
@@ -0,0 +1,92 @@
+<?xml version='1.0 standalone='yes'?>
+
+<rl:manipulators>
+
+ <!-- pstopdf will be made independent of the example framework -->
+
+ <!-- rl:manipulator name='pdf' suffix='svg'>
+ <rl:old><rl:value name='path'/>/<rl:value name='file'/></rl:old>
+ <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf</rl:new>
+ <rl:step>
+ inkscape
+ --without-gui
+ --print="&gt;<rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.ps"
+ <rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.svg
+ </rl:step>
+ <rl:step>
+ texmfstart pstopdf
+ <rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.ps
+ <rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf
+ </rl:step>
+ </rl:manipulator -->
+
+ <!-- rl:manipulator name='pdf' suffix='svgz'>
+ <rl:old><rl:value name='path'/>/<rl:value name='file'/></rl:old>
+ <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf</rl:new>
+ <rl:step>
+ inkscape
+ --without-gui
+ --print="&gt;<rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.ps"
+ <rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.svgz
+ </rl:step>
+ <rl:step>
+ texmfstart pstopdf
+ <rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.ps
+ <rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf
+ </rl:step>
+ </rl:manipulator -->
+
+ <rl:manipulator name='pdf' suffix='svg'>
+ <rl:old><rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.svg</rl:old>
+ <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf</rl:new>
+ <rl:step>
+ texmfstart pstopdf --convert
+ <rl:value name='old'/>
+ <rl:value name='new'/>
+ </rl:step>
+ </rl:manipulator>
+
+ <rl:manipulator name='pdf' suffix='svgz'>
+ <rl:old><rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.svgz</rl:old>
+ <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file' method='nosuffix'/>.pdf</rl:new>
+ <rl:step>
+ texmfstart pstopdf --convert
+ <rl:value name='old'/>
+ <rl:value name='new'/>
+ </rl:step>
+ </rl:manipulator>
+
+ <rl:manipulator name='lowres' suffix='pdf'>
+ <rl:old><rl:value name='path'/>/<rl:value name='file'/></rl:old>
+ <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file'/></rl:new>
+ <rl:step>
+ texmfstart pstopdf --convert --method=4
+ --inputpath=<rl:value name='path'/>
+ --outputpath=<rl:value name='path'/>/<rl:value name='prefix'/>
+ <rl:value name='file'/>
+ </rl:step>
+ </rl:manipulator>
+
+ <rl:manipulator name='medres' suffix='pdf'>
+ <rl:old><rl:value name='path'/>/<rl:value name='file'/></rl:old>
+ <rl:new><rl:value name='path'/>/<rl:value name='prefix'/><rl:value name='file'/></rl:new>
+ <rl:step>
+ texmfstart pstopdf --convert --method=4
+ --inputpath=<rl:value name='path'/>
+ --outputpath=<rl:value name='path'/>/<rl:value name='prefix'/>
+ <rl:value name='file'/>
+ </rl:step>
+ </rl:manipulator>
+
+ <rl:manipulator name='pdf' suffix='gif'>
+ <rl:old><rl:value name='path'/>/<rl:value name='file' method='nosuffix'/>.gif</rl:old>
+ <rl:new><rl:value name='cache' default='.'/>/<rl:value name='file' method='nosuffix'/>.pdf</rl:new>
+ <rl:step>
+ texmfstart pstopdf --convert
+ --inputpath=<rl:value name='path'/>
+ --outputpath=<rl:value name='cache' default='.'/>
+ <rl:value name='file' method='nosuffix'/>.gif
+ </rl:step>
+ </rl:manipulator>
+
+</rl:manipulators>
diff --git a/Master/texmf-dist/tex/context/base/s-abr-01.tex b/Master/texmf-dist/tex/context/base/s-abr-01.tex
index 3c45346ea3a..54e5d6f9789 100644
--- a/Master/texmf-dist/tex/context/base/s-abr-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-abr-01.tex
@@ -33,6 +33,7 @@
\logo [BIBTEX] {bib\TeX}
\logo [BLUESKY] {BlueSky}
\logo [BSD] {bsd}
+\logo [BMP] {bmp}
\logo [CDROM] {cdrom}
\logo [CD] {cd}
\logo [CMR] {cmr}
@@ -81,8 +82,8 @@
\logo [FREEBSD] {FreeBSD}
\logo [FOXET] {foXet}
\logo [FTP] {ftp}
-\logo [GHOSTSCRIPT]{Ghost\-Script}
-\logo [GHOSTVIEW] {Ghost\-View}
+\logo [GHOSTSCRIPT]{Ghost\-script}
+\logo [GHOSTVIEW] {Ghost\-view}
\logo [GIF] {gif}
\logo [GNU] {gnu}
\logo [GS] {Ghost\-Script}
@@ -197,7 +198,7 @@
\logo [TUGNEWS] {Tug\-News}
\logo [TUG] {tug}
\logo [UNICODE] {Uni\-code}
-\logo [UNIX] {unix}
+\logo [UNIX] {Unix}
\logo [URI] {uri}
\logo [URL] {url}
\logo [USA] {usa}
diff --git a/Master/texmf-dist/tex/context/base/s-chi-00.tex b/Master/texmf-dist/tex/context/base/s-chi-00.tex
index bb41b5b05e1..add0b333b00 100644
--- a/Master/texmf-dist/tex/context/base/s-chi-00.tex
+++ b/Master/texmf-dist/tex/context/base/s-chi-00.tex
@@ -1,5 +1,5 @@
%D \module
-%D [ file=s-chi-00,
+%D [ file=s-chi-00,
%D version=1999.12.21,
%D title=\CONTEXT\ Style File,
%D subtitle=Basic Chinese Style,
@@ -12,17 +12,17 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\mainlanguage[cn]
+\input font-chi.tex % faster than \setupbodyfont[chi]
-\setupbodyfont[chi]
+\mainlanguage [cn]
\unprotect
-\setupsection [\v!sectionlevel-1] [\c!headconversion=\s!chinese]
-\setupsection [\v!sectionlevel-2] [\c!headconversion=\s!chinese]
-\setupsection [\v!sectionlevel-3] [\c!headconversion=\s!chinese]
+\setupsection [\s!section-1] [\c!headconversion=\s!chinese]
+\setupsection [\s!section-2] [\c!headconversion=\s!chinese]
+\setupsection [\s!section-3] [\c!headconversion=\s!chinese]
-\setupsection [\v!sectionlevel-2] [\v!appendix\c!conversion=]
+\setupsection [\s!section-2] [\v!appendix\c!conversion=]
\setuphead [\v!chapter] [\c!distance=1.25em]
\setuphead [\v!section] [\c!distance=1.25em]
@@ -50,4 +50,27 @@
\setuptyping[\c!tab=\v!no]
+%D This module (and font support) adapts to the \UTF\ regime, but you
+%D need to enable \UTF\ first!
+%D
+%D \starttyping
+%D \enableregime[utf] \usemodule[chi-00]
+%D
+%D \starttext
+%D
+%D 兡也包因沘氓侷柵苗孫孫財
+%D 崧淫設弼琶跑愍窟榜蒸奭稽
+%D 霄瓢館縲擻鼕孃魔釁佉沎岠
+%D 狋垚柛胅娭涘罞偟惈牻荺傒
+%D 焱菏酡廅滘絺赩塴榗箂踃嬁
+%D 澕蓴醊獧螗餟燱螬駸礑鎞瀧
+%D 鄿瀯騬醹躕鱕
+%D
+%D \blank
+%D
+%D Wang Lei is written as: 王磊
+%D
+%D \stoptext
+%D \stoptyping
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/s-jap-00.tex b/Master/texmf-dist/tex/context/base/s-jap-00.tex
new file mode 100644
index 00000000000..28cb6c2415a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-jap-00.tex
@@ -0,0 +1,23 @@
+%D \module
+%D [ file=s-jap-00,
+%D version=2006.01.19,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Basic Japanese Style,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D suggestions=Richard Gabriel,
+%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.
+
+\input font-jap.tex % faster than \setupbodyfont[jap]
+
+\mainlanguage [ja]
+
+\unprotect
+
+\setuptyping[\c!tab=\v!no]
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/s-pre-01.tex b/Master/texmf-dist/tex/context/base/s-pre-01.tex
index 2cc8c6e359c..b86133fa66b 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-01.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-01.tex
@@ -8,14 +8,14 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
%D This environment can be used to typeset interactive
%D presentations. This module was first used at the 1997 \TUG\
%D meeting.
-\usemodule[pre-general]
+\usemodule[pre-general]
%D \macros
%D {language}
@@ -30,7 +30,7 @@
%D {setupbodyfont,setuplayout}
%D
%D For screen reading, a Lucida Bright font looks nice. We use
-%D a 14.4 point bodyfont for the main text, but switch back to
+%D a 14.4 point bodyfont for the main text, but switch back to
%D 12 points for ornaments.
\startmode[asintended] \setupbodyfont[lbr] \stopmode
@@ -69,7 +69,7 @@
[topspace=12pt,
header=0pt,
footer=0pt,
- height=402pt, % 450 - 12 - 15 - 12 - 12 + 3
+ height=402pt, % 450 - 12 - 15 - 12 - 12 + 3
bottomdistance=15pt,
bottom=12pt,
backspace=12pt,
@@ -115,7 +115,7 @@
%D
%D We did not enable interactive text support yet, so let's do
%D that now. We force page reference to circumvent problems
-%D with named destinations in buggy viewers.
+%D with named destinations in buggy viewers.
\setupinteraction
[page=yes,
@@ -137,8 +137,8 @@
rightoffset=-3pt]
\startinteractionmenu[bottom]
- \txt \InteractionBar \\
- \txt \InteractionButtons \\
+ \txt \InteractionBar \\
+ \txt \InteractionButtons \\
\stopinteractionmenu
%D \macros
@@ -166,7 +166,7 @@
\setupinteractionbar
[framecolor=white,rulethickness=1pt,
height=\bottomheight,strut=no]
-
+
\def\InteractionButtons%
{\interactionbuttons
[width=15em]
@@ -179,23 +179,23 @@
%D \macros
%D {StartTitlePage, TitlePage}
%D
-%D The titlepage is rather simple and can be typeset in two
-%D ways:
+%D The titlepage is rather simple and can be typeset in two
+%D ways:
%D
%D \starttyping
%D \StartTitlePage
-%D text \\ text \\ text
+%D text \\ text \\ text
%D \StopTitlepage
%D \stoptyping
%D
%D or more straightforward:
%D
%D \starttyping
-%D \TitlePage{text\\text\\text}
+%D \TitlePage{text\\text\\text}
%D \stoptyping
-%D
-%D The first alternative can be used for more complicated
-%D title pages.
+%D
+%D The first alternative can be used for more complicated
+%D title pages.
\def\StartTitlePage%
{\startstandardmakeup
@@ -236,8 +236,8 @@
%D {definehead}
%D
%D The commands \type{\Topic} and \type{\Subject} are defined
-%D as copies of head. We use \type{\Nopic} for internal
-%D purposes.
+%D as copies of head. We use \type{\Nopic} for internal
+%D purposes.
\definehead [Topic] [chapter]
\definehead [Subject] [section]
@@ -247,10 +247,10 @@
%D \macros
%D {setuphead}
%D
-%D Because chapters and sections do not make sense in
-%D presentations, we use our own command for typesetting the
-%D titles. Sectionnumbers are of course hidden from viewing.
-%D Each topic is followed by a list of subjects that belong
+%D Because chapters and sections do not make sense in
+%D presentations, we use our own command for typesetting the
+%D titles. Sectionnumbers are of course hidden from viewing.
+%D Each topic is followed by a list of subjects that belong
%D to the topic.
\setuphead
@@ -302,15 +302,15 @@
%D {\midaligned{#2}}
%D \stoptyping
%D
-%D But why should we complicate things when we can use
-%D alternative~\type{g}. The test is only needed if one
-%D does not automatically goes a new page with each subject.
+%D But why should we complicate things when we can use
+%D alternative~\type{g}. The test is only needed if one
+%D does not automatically goes a new page with each subject.
\def\PlaceSubjectList%
{\blank
- \determinelistcharacteristics[Subject]
+ \determinelistcharacteristics[Subject]
% \ifnum\utilitylistlength>0 \placelist[Subject] \fi}
- \doifmode{*list}{\placelist[Subject]}}
+ \doifmode{*list}{\placelist[Subject]}}
\setuplist
[Subject, Topic]
@@ -323,7 +323,7 @@
% %D {setuptexttexts}
% %D
% %D The topics will be listed in the right edge, using:
-%
+%
% \setuptexttexts
% [edge]
% [][\TopicList]
@@ -332,8 +332,8 @@
%D {setuplist, placelist,startinteractionmenu}
%D
%D The actual topic list is typeset using a \type{\vbox}. We
-%D have to specify \type{criteriumcriterium=all} because otherwise no
-%D list will be typeset. (By default lists are typeset
+%D have to specify \type{criteriumcriterium=all} because otherwise no
+%D list will be typeset. (By default lists are typeset
%D locally.)
\startinteractionmenu[right]
@@ -348,7 +348,7 @@
style=\setsmallbodyfont\bfx]
\stopinteractionmenu
-\def\Topics#1% temporary hack
+\def\Topics#1% temporary hack
{\Nopic{#1}
\placelist[Topic][criterium=all]}
@@ -357,12 +357,12 @@
%D \macros
%D {setuptexttexts, button}
-%D
+%D
%D During a presentation, we want to use the cursor to point to
%D parts of the text. Furthermore we want to be able to jump to
%D the next page, without the need to move the cursor on buttons.
%D Therefore we make the text part of the screen into an
-%D invisible button.
+%D invisible button.
\setuptexttexts
[\GotoNextPage][]
@@ -374,11 +374,31 @@
%D {setupsubpagenumber}
%D
%D The left bottom navigation bar shows the subpages, which will
-%D be counted by text. One can change this in the preentation
-%D itself by saying \type {[way=byTopic]}.
+%D be counted by text. One can change this in the preentation
+%D itself by saying \type {[way=byTopic]}.
\setupsubpagenumber
[way=bytext, % Topic,
state=start]
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-original}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-pre-02.tex b/Master/texmf-dist/tex/context/base/s-pre-02.tex
index 4cd450f84a1..9df1fe3833c 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-02.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-02.tex
@@ -8,12 +8,12 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
%D This environment can be used to typeset interactive
-%D presentations. This module was first used at the 1998
-%D publishers conference of the European Portable Document
+%D presentations. This module was first used at the 1998
+%D publishers conference of the European Portable Document
%D Association (now merged into a graphics association).
\usemodule[pre-general]
@@ -21,8 +21,8 @@
%D \macros
%D {setupbodyfont, switchtobodyfont, setuplayout}
%D
-%D At \PRAGMA\ we prefer using the Lucida Bright fonts, but
-%D one can of course load another typeface.
+%D At \PRAGMA\ we prefer using the Lucida Bright fonts, but
+%D one can of course load another typeface.
\startmode[asintended] \setupbodyfont[lbr] \stopmode
@@ -34,7 +34,7 @@
%D \macros
%D {setuppapersize, setuplayout}
%D
-%D The papersize suits the screen dimensions. The layout is
+%D The papersize suits the screen dimensions. The layout is
%D rather simple. We use the whole width of the screen and only
%D have navigational tools at the bottom of the screen.
@@ -55,8 +55,8 @@
%D \macros
%D {setupwhitespace, setuptyping}
%D
-%D We don't have much height, so we use a more cramped
-%D spacing. Verbatim text looks better when indented.
+%D We don't have much height, so we use a more cramped
+%D spacing. Verbatim text looks better when indented.
%D
\setupwhitespace
@@ -69,7 +69,7 @@
%D {definecolor, setupcolors}
%D
%D Of course we enable color. We define some logical colors,
-%D of which most default to the same green shade.
+%D of which most default to the same green shade.
\definecolor [BackgroundColor] [r=.8, g=.8, b=.8]
\definecolor [OrnamentColor] [r= 0, g=.7, b=.4]
@@ -79,8 +79,8 @@
%D \macros
%D {setupinteraction, setupinteractionscreen}
-%D
-%D We still have to enable interaction mode. We go full
+%D
+%D We still have to enable interaction mode. We go full
%D screen!
\setupinteraction
@@ -103,31 +103,31 @@
%D \macros
%D {defineoverlay, setupbackgrounds}
-%D
-%D The navigational elements and the backgrounds are
+%D
+%D The navigational elements and the backgrounds are
%D provided by \METAPOST.
-%D
+%D
%D When \METAPOST\ is used, it makes sense to generate the
%D graphics at runtime. This is supported when one enables
%D system calls in the local \type {texmf.cnf} file and add the
%D switch \type {\runMPgraphicstrue} to the local file \type
-%D {cont-sys.tex}. When direct processing is disabled or not
-%D supported, \TEXEXEC\ will take care of graphic generation.
+%D {cont-sys.tex}. When direct processing is disabled or not
+%D supported, \TEXEXEC\ will take care of graphic generation.
\startuniqueMPgraphic{PageBackground}
fill unitsquare
- xyscaled(OverlayWidth,OverlayHeight)
- withcolor OverlayColor ;
+ xyscaled(OverlayWidth,OverlayHeight)
+ withcolor OverlayColor ;
draw unitsquare
- xyscaled(OverlayWidth,OverlayHeight)
+ xyscaled(OverlayWidth,OverlayHeight)
enlarged (-2*OverlayLineWidth)
withpen pencircle scaled OverlayLineWidth
- withcolor OverlayLineColor ;
+ withcolor OverlayLineColor ;
\stopuniqueMPgraphic
\defineoverlay
[PageBackground]
- [\uniqueMPgraphic{PageBackground}]
+ [\uniqueMPgraphic{PageBackground}]
\setupbackgrounds
[page]
@@ -139,15 +139,15 @@
%D \macros
%D {setuptexttexts}
%D
-%D By clicking on the text area, one goes to the next page.
-%D We hook this feature into the text backgrounds.
+%D By clicking on the text area, one goes to the next page.
+%D We hook this feature into the text backgrounds.
\startuniqueMPgraphic{TextBackground}
draw unitsquare
- xyscaled(OverlayWidth,OverlayHeight)
+ xyscaled(OverlayWidth,OverlayHeight)
enlarged (4*OverlayLineWidth)
withpen pencircle scaled OverlayLineWidth
- withcolor OverlayLineColor ;
+ withcolor OverlayLineColor ;
\stopuniqueMPgraphic
\defineoverlay
@@ -214,14 +214,14 @@
[menu=on]
\def\WhateverButton
- {\doifreferencefoundelse{Whatever}
- {\raw [Whatever] \uniqueMPgraphic{UpArrow} \\}
+ {\doifreferencefoundelse{Whatever}
+ {\raw [Whatever] \uniqueMPgraphic{UpArrow} \\}
{}}
\startinteractionmenu[bottom]
- \but [Topics] \\ % secret button
+ \but [Topics] \\ % secret button
\hfill
- \WhateverButton % user specific
+ \WhateverButton % user specific
\kern2\bottomheight
\raw [previouspage] \uniqueMPgraphic{LeftArrow} \\
\kern.5\bottomheight
@@ -253,23 +253,23 @@
%D \macros
%D {StartTitlePage, TitlePage}
%D
-%D The titlepage is rather simple and can be typeset in two
-%D ways:
+%D The titlepage is rather simple and can be typeset in two
+%D ways:
%D
%D \starttyping
%D \StartTitlePage
-%D text \\ text \\ text
+%D text \\ text \\ text
%D \StopTitlepage
%D \stoptyping
%D
%D or as one||liner:
%D
%D \starttyping
-%D \TitlePage{text\\text\\text}
+%D \TitlePage{text\\text\\text}
%D \stoptyping
-%D
-%D The first alternative can be used for more complicated
-%D title pages.
+%D
+%D The first alternative can be used for more complicated
+%D title pages.
\def\StartTitlePage%
{\startstandardmakeup
@@ -289,8 +289,8 @@
%D {definehead}
%D
%D The commands \type{\Topic} and \type{\Subject} are defined
-%D as copies of head. We use \type{\Nopic} for internal
-%D purposes.
+%D as copies of head. We use \type{\Nopic} for internal
+%D purposes.
\definehead [Topic] [chapter]
\definehead [Subject] [section]
@@ -323,8 +323,8 @@
%D \macros
%D {setuplist}
%D
-%D When found, the subject list is automatically placed
-%D after the topic head.
+%D When found, the subject list is automatically placed
+%D after the topic head.
\setuplist
[Topic,Subject]
@@ -337,7 +337,7 @@
[Topic]
[criterium=all]
-\def\Topics#1%
+\def\Topics#1%
{\determinelistcharacteristics[Topic]
\doifmode{*list}
{\Nopic[Topics]{#1}
@@ -349,7 +349,7 @@
[Subject]
[criterium=Topic]
-\def\Subjects%
+\def\Subjects%
{\determinelistcharacteristics[Subject]
\doifmode{*list}
{\placelist[Subject]}}
@@ -358,4 +358,24 @@
[Topic]
[after={\blank[3*medium]\Subjects}]
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-green}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-pre-03.tex b/Master/texmf-dist/tex/context/base/s-pre-03.tex
index c7420ba3779..bdd7960c5a4 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-03.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-03.tex
@@ -99,7 +99,7 @@
% path p; p := superellipse(r,t,l,b,.8) ;
% fill p withcolor \MPcolor{Backgroundcolor} ;
% draw p withcolor \MPcolor{OrnamentColor} ;
-% color contrastcolor ; contrastcolor = 2/3 * \MPcolor{OrnamentColor} ;
+% color contrastcolor ; contrastcolor = 2/3 * \MPcolor{OrnamentColor} ;
% if (pos>0) and (tot>0):
% pair pa ; pa := point 5 of p ;
% pair pb ; pb := point 7 of p ;
@@ -117,28 +117,28 @@
\startuseMPgraphic{PageShape}
StartPage ;
- path p ; pair pa, pb ; numeric len ; color contrastcolor ;
- fill Page withcolor \MPcolor {PageColor} ;
+ path p ; pair pa, pb ; numeric len ; color contrastcolor ;
+ fill Page withcolor \MPcolor {PageColor} ;
pickup pencircle rotated 45 xscaled 10pt yscaled 20pt ;
p := Page enlarged (-10pt,-15pt) superellipsed .8 ;
- p := p shifted (-1.5pt,0) ; % looks better
+ p := p shifted (-1.5pt,0) ; % looks better
fill p withcolor \MPcolor{BackgroundColor} ;
draw p withcolor \MPcolor{OrnamentColor} ;
- contrastcolor = 2/3 * \MPcolor{OrnamentColor} ;
+ contrastcolor = 2/3 * \MPcolor{OrnamentColor} ;
if (PageNumber>0) and (NOfPages>0):
draw point 5 of p withcolor contrastcolor ;
draw point 7 of p withcolor contrastcolor ;
len := 2/NOfPages ;
pa := point (5+len*PageNumber) of p ;
pb := point (5+len*(PageNumber-1)) of p ;
- draw (p cutafter pa) cutbefore pb
+ draw (p cutafter pa) cutbefore pb
withcolor contrastcolor ;
fi ;
StopPage ;
\stopuseMPgraphic
%D We use the viewer provided feature to go to the previous or
-%D next page.
+%D next page.
\defineoverlay[PrevButton][\overlaybutton{PreviousPage}]
\defineoverlay[NextButton][\overlaybutton{NextPage}]
@@ -151,11 +151,11 @@
[text][text]
[background=NextButton]
-% or using hard coded next/prev pages:
+% or using hard coded next/prev pages:
%
% \defineoverlay[PrevButton][\overlaybutton{previouspage}]
% \defineoverlay[NextButton][\overlaybutton{nextpage}]
-%
+%
% \setupbackgrounds[state=repeat]
% \setupbackground[text][text][background=NextButton]
%
@@ -234,4 +234,24 @@
\def\TitlePage#1%
{\StartTitlePage#1\StopTitlePage}
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-funny}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-pre-04.tex b/Master/texmf-dist/tex/context/base/s-pre-04.tex
index 29b040a8b89..09cc79b72e8 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-04.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-04.tex
@@ -8,17 +8,17 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-\usemodule[pre-general]
+\usemodule[pre-general]
%D \macros
%D {setupbodyfont}
%D
%D This is just another environment for typesetting interactive
%D presentations. I wrote this module on behalf of a course I
-%D gave for the United Kingdom \TeX\ users group.
+%D gave for the United Kingdom \TeX\ users group.
\setupbodyfont[ams,pos,14.4pt]
@@ -28,33 +28,33 @@
%D I started using dark blue for the navigational elements. In
%D that context, dark red is a logical choice for the contrast
%D color. While playing around with the navigational elements
-%D I decided to use the not so dominant color yellow for the
-%D status bar.
-%D
+%D I decided to use the not so dominant color yellow for the
+%D status bar.
+%D
%D A few days before I wrote this style, the recent acquisition
%D of Mondriaans last painting by the Dutch governement was a
%D hot topic in the dutch news scenary. Therefore I decided to
%D replace the rather dull title page by something more
%D colorful, in mondriaan colors, but far more random than any
-%D of his paintings. For consistence we remap the already
-%D defined primary colors.
+%D of his paintings. For consistence we remap the already
+%D defined primary colors.
\setupcolors [state=start]
-\definecolor [NoneColor] [s=.6]
+\definecolor [NoneColor] [s=.6]
\definecolor [GotoColor] [b=.6] \definecolor[blue] [GotoColor]
\definecolor [ExitColor] [r=.6] \definecolor[red] [ExitColor]
-\definecolor [JumpColor] [s=.6]
+\definecolor [JumpColor] [s=.6]
\definecolor [UserColor] [g=.6] \definecolor[green] [UserColor]
\definecolor [StepColor] [r=.6,g=.6] \definecolor[yellow][StepColor]
\definecolor [PageColor] [s=.80] \definecolor[gray] [PageColor]
-\definecolor [TextColor] [s=.90]
+\definecolor [TextColor] [s=.90]
%D \macros
%D {setuppapersize}
%D
-%D As usual, we take a screen oriented paper size:
+%D As usual, we take a screen oriented paper size:
\setuppapersize
[S6][S6]
@@ -62,9 +62,9 @@
%D \macros
%D {setuplayout,setupinteractionscreen}
%D
-%D The layout definition fits into this $600\times450$ point
+%D The layout definition fits into this $600\times450$ point
%D area, but the dimensions are somewhat diffused by the text
-%D background offset.
+%D background offset.
\setuplayout
[width=530pt,
@@ -85,10 +85,10 @@
%D \macros
%D {setupbackgrounds}
%D
-%D Both the page and the text area have a gray background.
-%D The \type {[text,text]} area also has an offset. Later we
+%D Both the page and the text area have a gray background.
+%D The \type {[text,text]} area also has an offset. Later we
%D will see that we have to compensate for that in the
-%D navigational areas.
+%D navigational areas.
\setupbackgrounds
[page]
@@ -104,19 +104,19 @@
%D \macros
%D {setupinteraction}
%D
-%D For convenient navigation, we turn on interaction.
+%D For convenient navigation, we turn on interaction.
\setupinteraction
[state=start,
menu=on,
- color=UserColor,
+ color=UserColor,
contrastcolor=NoneColor]
%D \macros
%D {setupsubpagenumber}
%D
-%D When navigating the document, we keep the title page out
-%D of sight, therefore we use sub page numbers.
+%D When navigating the document, we keep the title page out
+%D of sight, therefore we use sub page numbers.
\setupsubpagenumber
[state=start,
@@ -127,7 +127,7 @@
%D
%D There is only one interaction menu, located in the right
%D edge of the screen. Both offsets enlarge the edge by the
-%D same amount as the text background offset.
+%D same amount as the text background offset.
\setupinteractionmenu
[right]
@@ -146,10 +146,10 @@
%D start||stop alternative for setting the content. The macro
%D \type {\interactioncolor} expands into either the
%D interaction color or the contrast color, the latter only
-%D when no jump is possible.
+%D when no jump is possible.
\startinteractionmenu[right]
- \setupinteraction[color=GotoColor]
+ \setupinteraction[color=GotoColor]
\but [previoussubpage] \Triangle {90}\framedwidth\interactioncolor \\
\vskip10pt
\but [nextsubpage] \Triangle{270}\framedwidth\interactioncolor \\
@@ -162,11 +162,11 @@
%D \macros
%D {setupinteractionbar}
%D
-%D The interaction bar at the bottom is also larger than the
-%D normal width of the bottom area.
+%D The interaction bar at the bottom is also larger than the
+%D normal width of the bottom area.
\setupinteractionbar
- [alternative=f,
+ [alternative=f,
width=\textwidth,
height=\bottomheight,
distance=10pt,
@@ -176,29 +176,29 @@
%D \macros
%D {setupbottomtexts}
%D
-%D The bar is centered in the middle.
+%D The bar is centered in the middle.
-\setupbottomtexts
+\setupbottomtexts
[\interactionbar]
-%D We can exit viewing with a close button, located on the
-%D rightmost bottom area.
+%D We can exit viewing with a close button, located on the
+%D rightmost bottom area.
\def\CloseButton
{\button
[width=\rightedgewidth,height=\bottomheight,offset=overlay,
background=color,backgroundcolor=ExitColor,frame=off]
{}%
- [CloseDocument]}
+ [CloseDocument]}
\setupbottomtexts
[edge][][\CloseButton]
-%D \macros
+%D \macros
%D {definesymbol,setupitemize}
%D
-%D Because some prominent things are rectangular or triangular,
-%D we prefer some different symbols in itemizations:
+%D Because some prominent things are rectangular or triangular,
+%D we prefer some different symbols in itemizations:
\definesymbol[1][$\blacktriangleright$]
\definesymbol[2][$\blacktriangledown$]
@@ -245,11 +245,11 @@
%D \macros
%D {Topic, Nopic, Subject,
-%D definehead, setuphead}
+%D definehead, setuphead}
%D
-%D We use \type {\Topic} and \type {\Subject} instead of
-%D chapters and sections. The \type {\Nopic} alternative is
-%D meant for internal use.
+%D We use \type {\Topic} and \type {\Subject} instead of
+%D chapters and sections. The \type {\Nopic} alternative is
+%D meant for internal use.
\definehead [Topic] [chapter]
\definehead [Nopic] [title]
@@ -275,9 +275,9 @@
%D {Topics, Subjects,
%D setuplist, placelist, startcolumns}
%D
-%D This style is meant for the more large presentations, and
-%D therefore provided for a list of topics as well as local
-%D lists of subjects. When many topics are introduces, the
+%D This style is meant for the more large presentations, and
+%D therefore provided for a list of topics as well as local
+%D lists of subjects. When many topics are introduces, the
%D list is typeset in columns.
\setuplist
@@ -291,28 +291,28 @@
[Topic]
[criterium=all]
-\def\Topics#1%
+\def\Topics#1%
{\determinelistcharacteristics[Topic]
- \ifnum\utilitylistlength>0
+ \ifnum\utilitylistlength>0
\Nopic[Topics]{#1}
- \ifnum\utilitylistlength>12
+ \ifnum\utilitylistlength>12
\startcolumns
\placelist[Topic]
\stopcolumns
\else
\placelist[Topic]
- \fi
+ \fi
\fi}
-\def\Subjects%
+\def\Subjects%
{\placelist[Subject]}
-%D Last we define the overlays. Look at the way colors are
+%D Last we define the overlays. Look at the way colors are
%D linked into the macros.
\startMPinclusions
def triangle (expr wid, rot, col) =
- x1 := x3 := y1 := 0 ; x2 := y3 := wid ; y2 := .5y3 ;
+ x1 := x3 := y1 := 0 ; x2 := y3 := wid ; y2 := .5y3 ;
fill (z1--z2--z3--cycle) rotated rot withcolor col ;
currentpicture := currentpicture xysized (wid,wid) ;
enddef ;
@@ -331,27 +331,47 @@
\def\Triangle#1#2#3%
{\uniqueMPgraphic{triangle}{rotation=#1,width=#2,color=#3}}
-\startuseMPgraphic{title} % can be simplified with "randomized"
- color c ; path p ;
- for i=1 upto 250 :
- x0 := uniformdeviate \overlaywidth ;
+\startuseMPgraphic{title} % can be simplified with "randomized"
+ color c ; path p ;
+ for i=1 upto 250 :
+ x0 := uniformdeviate \overlaywidth ;
y0 := uniformdeviate \overlayheight ;
- sx := uniformdeviate 20 ;
+ sx := uniformdeviate 20 ;
sy := uniformdeviate 20 ;
- cc := round(uniformdeviate 2) ;
- if cc=0 : c := \MPcolor{GotoColor} fi ;
- if cc=1 : c := \MPcolor{ExitColor} fi ;
- if cc=2 : c := \MPcolor{StepColor} fi ;
- qq := round(uniformdeviate 1) ;
- if qq=0 :
+ cc := round(uniformdeviate 2) ;
+ if cc=0 : c := \MPcolor{GotoColor} fi ;
+ if cc=1 : c := \MPcolor{ExitColor} fi ;
+ if cc=2 : c := \MPcolor{StepColor} fi ;
+ qq := round(uniformdeviate 1) ;
+ if qq=0 :
p := unitsquare xscaled sx yscaled sy ;
else :
- rr := round(uniformdeviate 3) * 90 ;
- x1 := x3 := y1 := 0 ; x2 := y3 := sx; y2 := .5y3 ;
+ rr := round(uniformdeviate 3) * 90 ;
+ x1 := x3 := y1 := 0 ; x2 := y3 := sx; y2 := .5y3 ;
p := (z1--z2--z3--cycle) rotated rr ;
- fi ;
- fill p shifted z0 withcolor c ;
+ fi ;
+ fill p shifted z0 withcolor c ;
endfor ;
\stopuseMPgraphic
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-colorfull}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-pre-05.tex b/Master/texmf-dist/tex/context/base/s-pre-05.tex
index f095ae09156..9b3ae89ff04 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-05.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-05.tex
@@ -8,13 +8,13 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
-\usemodule[pre-general]
+\usemodule[pre-general]
-%D As all styles sofar, this one has the same structuring
-%D commands.
+%D As all styles sofar, this one has the same structuring
+%D commands.
\startmode[asintended] \setupbodyfont[lbr] \stopmode
@@ -22,7 +22,7 @@
\setupcolors [state=start]
-\definecolor [BackgroundColor] [s=.95]
+\definecolor [BackgroundColor] [s=.95]
\definecolor [OrnamentColor] [r=.6,g=.7,b=.8]
\setuppapersize
@@ -68,7 +68,7 @@
color=OrnamentColor,
contrastcolor=OrnamentColor]
-%D Watch how we use a list alternative that matches the
+%D Watch how we use a list alternative that matches the
%D menu.
\setupinteractionmenu
@@ -77,7 +77,7 @@
style=smallbold,
frame=off,
offset=10pt,
- height=35pt,
+ height=35pt,
before=,
after=,
inbetween=\endgraf,
@@ -96,7 +96,7 @@
\setupinteractionmenu
[right]
[height=30pt]
- \but [CloseDocument] Close \\
+ \but [CloseDocument] Close \\
\stopinteractionmenu
\setupwhitespace
@@ -140,19 +140,19 @@
\def\TitlePage#1%
{\StartTitlePage#1\StopTitlePage}
-%D \macros
+%D \macros
%D {Topics,Subjects}
%D
-%D Since the lists are in the menu, we don't honor list
-%D placement macros.
+%D Since the lists are in the menu, we don't honor list
+%D placement macros.
\def\Topics#1{}
\def\Subjects{}
%D \macros
-%D {Topic, Nopic, Subject}
+%D {Topic, Nopic, Subject}
%D
-%D Since t his style is meant for rather flat structured
+%D Since t his style is meant for rather flat structured
%D documents, only \type {\Topic} makes sense.
\definehead [Topic] [chapter]
@@ -175,27 +175,27 @@
continue=no,
style=\tfa]
-%D We use only one kind of base graphic, which is sligthly
-%D tuned for the different usage.
+%D We use only one kind of base graphic, which is sligthly
+%D tuned for the different usage.
\startMPinclusions
- def random_hash_frame (expr width, height, offset, linewidth ) =
+ def random_hash_frame (expr width, height, offset, linewidth ) =
def delta = ((uniformdeviate .5offset) + .25offset) enddef ;
x1 := offset ; y1 := offset ; x2 := width-offset ; y2 := height-offset ;
- drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{BackgroundColor}) ;
+ drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{BackgroundColor}) ;
fill z1--(x2,y1)--z2--(x1,y2)--cycle ;
- drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
+ drawoptions(withpen pencircle scaled linewidth withcolor \MPcolor{OrnamentColor}) ;
draw (x1-delta,y1)--(x2+delta,y1) ;
draw (x2,y1-delta)--(x2,y2+delta) ;
draw (x2+delta,y2)--(x1-delta,y2) ;
draw (x1,y2+delta)--(x1,y1-delta) ;
- drawoptions();
+ drawoptions();
setbounds currentpicture to unitsquare xscaled width yscaled height ;
- enddef ;
+ enddef ;
\stopMPinclusions
\startuseMPgraphic{HashFrameA}
@@ -207,14 +207,34 @@
\stopuseMPgraphic
\startuseMPgraphic{TitleGraphic}
- for i=1 upto 300 :
- offset := uniformdeviate 10pt ;
- width := 2*offset + 30pt + uniformdeviate 30pt ;
- height := 2*offset + 10pt + uniformdeviate 10pt ;
- addto currentpicture also
- image(random_hash_frame(width,height,offset,1pt)) shifted
- (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
- endfor ;
+ for i=1 upto 300 :
+ offset := uniformdeviate 10pt ;
+ width := 2*offset + 30pt + uniformdeviate 30pt ;
+ height := 2*offset + 10pt + uniformdeviate 10pt ;
+ addto currentpicture also
+ image(random_hash_frame(width,height,offset,1pt)) shifted
+ (uniformdeviate OverlayWidth, uniformdeviate OverlayHeight) ;
+ endfor ;
\stopuseMPgraphic
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-fuzzy}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-pre-06.tex b/Master/texmf-dist/tex/context/base/s-pre-06.tex
index d3b99d9b77e..7a84323e934 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-06.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-06.tex
@@ -27,7 +27,7 @@
\usemodule[pre-general]
-%D \macros
+%D \macros
%D {setupbodyfont}
%D
%D As said, we will use the Antikwa Torunska, and because we
@@ -36,7 +36,7 @@
\setupbodyfont
[ant,14.4pt]
-%D \macros
+%D \macros
%D {definecolor, setupcolors}
%D
%D Thus style only uses gray scales, but nevertheless we turn
@@ -49,7 +49,7 @@
\definecolor [ContrastColor] [s=.9]
\definecolor [InteractionColor] [s=.6]
-%D \macros
+%D \macros
%D {setuppapersize}
%D
%D As (nearly) always, we use a 600 pt times 450 pt screen
@@ -268,9 +268,9 @@
%D
%D We use a nested \type {\everypar}; everything in there
%D will be put in front of each paragraph. The nesting prevents
-%D the first paragraph from indenting. The struts give the
+%D the first paragraph from indenting. The struts give the
%D lines a decent height, which looks better inrelation to the
-%D next pages.
+%D next pages.
\def\StartTitlePage%
{\startstandardmakeup
@@ -292,4 +292,34 @@
\def\TitlePage#1%
{\StartTitlePage#1\StopTitlePage}
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\usemodule[pre-antikwa]
+
+\starttext
+
+\TitlePage{Title Page\\pre-polish}
+
+\Topics{Some Nice Lists}
+
+\Topic{Some Lists}
+
+\Subject{A list}
+
+\startitemize
+\item first
+\item second
+\stopitemize
+
+\Subject{A bigger list}
+
+\startitemize
+\item first
+\item second
+\item third
+\item fourth
+\stopitemize
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-pre-07.tex b/Master/texmf-dist/tex/context/base/s-pre-07.tex
index 65514403a0a..bf84971bbd3 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-07.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-07.tex
@@ -16,12 +16,12 @@
%D This is just one way of implementing such a style. Today
%D we have more \METAPOST\ interfacing available, and
%D thereby moore tools and alternative ways to reach such a
-%D goal. I must admit that the main macro looks fuzzy. On
-%D the other hand, the presentation can look quite structured.
-%D
+%D goal. I must admit that the main macro looks fuzzy. On
+%D the other hand, the presentation can look quite structured.
+%D
%D \starttyping
%D \Topics{...}
-%D
+%D
%D \StartIdeas
%D \Topic{...}
%D \StartIdea ... \StopIdea
@@ -54,7 +54,7 @@
%D keep the random seed reasonable constant.
\setupsystem
- [random=big]
+ [random=big]
\setupcolors
[state=start]
@@ -193,4 +193,20 @@
\def\StopIdeas%
{}
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\Topics{This is about \unknown}
+
+\StartIdeas
+ \Topic{Some topic}
+ \StartIdea An idea \unknown \StopIdea
+ \StartIdea \unknown\ and another \StopIdea
+\StopIdeas
+
+\stoptext
+
+
diff --git a/Master/texmf-dist/tex/context/base/s-pre-13.tex b/Master/texmf-dist/tex/context/base/s-pre-13.tex
index a7b68dd69b9..6032f36d286 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-13.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-13.tex
@@ -12,7 +12,7 @@
%C details.
%D This is again one of the \EUROTEX\ 99 styles. It's one of
-%D the quick and dirty styles supporting basic structuring.
+%D the quick and dirty styles supporting basic structuring.
\setuppapersize
[S6][S6]
@@ -27,14 +27,14 @@
topspace=2cm,
backspace=2cm]
-%D This style is meant to be used with lucida handwriting
-%D fonts. If you don't have that font, you may reconsider
-%D using this style.
+%D This style is meant to be used with lucida handwriting
+%D fonts. If you don't have that font, you may reconsider
+%D using this style.
\startmode[asintended] \setupbodyfont[lbr,hw] \stopmode
%D These colors will mostly be used in the graphics drawn by
-%D \METAPOST.
+%D \METAPOST.
\setupcolors
[state=start]
@@ -44,8 +44,8 @@
\definecolor[LineColor] [g=.4]
\definecolor[SymbolColor][r=.4]
-%D When interacting, we will use button shaped that are
-%D quite random and thereby regenerated for each instance.
+%D When interacting, we will use button shaped that are
+%D quite random and thereby regenerated for each instance.
\setupinteractionscreen
[option=max]
@@ -66,23 +66,23 @@
\startinteractionmenu[bottom]
\hfill
- \got [previouspage] \symbol[prevmark] \\
- \got [nextpage] \symbol[nextmark] \\
- \got [CloseDocument] \symbol[stopmark] \\
- \txt \tfd \SymbolColor \pagenumber \\
+ \got [previouspage] \symbol[prevmark] \\
+ \got [nextpage] \symbol[nextmark] \\
+ \got [CloseDocument] \symbol[stopmark] \\
+ \txt \tfd \SymbolColor \pagenumber \\
\stopinteractionmenu
%D When not processed at runtime, the itemmark graphics can
%D result in processing loops due to funny dimensions.
%D Therefore, from now on, the itemize macros limit the height
-%D and depth.
+%D and depth.
\definesymbol[itemmark][\useMPgraphic{itemmark}]
\definesymbol[stopmark][\useMPgraphic{stopmark}]
\definesymbol[nextmark][\useMPgraphic{nextmark}]
\definesymbol[prevmark][\useMPgraphic{prevmark}]
-%D Of course we have some backgrounds.
+%D Of course we have some backgrounds.
\defineoverlay [page] [\useMPgraphic{page}]
\defineoverlay [next] [\overlaybutton{forward}]
@@ -90,11 +90,11 @@
\setupbackgrounds
[page]
- [background={page,prev}]
+ [background={page,prev}]
\setupbackgrounds
[text]
- [background=next]
+ [background=next]
\setuphead
[chapter]
@@ -114,7 +114,7 @@
width=3\bodyfontsize]
\def\StartTitlePage%
- {\setupinteractionmenu[bottom][state=stop] % will be named page block
+ {\setupinteractionmenu[bottom][state=stop] % will be named page block
\startstandardmakeup
\setupalign[middle]
\def\\%
@@ -149,11 +149,11 @@
\def\Topics#1%
{\Nopic{#1}
\bgroup
- \setupinteraction
+ \setupinteraction
[color=,
contrastcolor=]
\determinelistcharacteristics[Topic]
- \ifnum\utilitylistlength>12
+ \ifnum\utilitylistlength>12
\startcolumns[n=2]
\placelist[Topic]
\stopcolumns
@@ -162,35 +162,35 @@
\fi
\egroup}
-%D We don't support another level of structuring.
+%D We don't support another level of structuring.
\let\Subject \Topic
\let\Subjects\relax
-%D Most of this style is \METAPOST\ definitions. We could
-%D have shared some code, but it would not on forehand make
-%D things more readable, so we stick to the following
-%D definitions.
+%D Most of this style is \METAPOST\ definitions. We could
+%D have shared some code, but it would not on forehand make
+%D things more readable, so we stick to the following
+%D definitions.
\startuseMPgraphic{page}
- width := \overlaywidth ;
- height := \overlayheight ;
+ width := \overlaywidth ;
+ height := \overlayheight ;
- d := 15 ; dd := d ; dd := 10 ;
+ d := 15 ; dd := d ; dd := 10 ;
- def fuzzy (expr p,dx,dy) =
+ def fuzzy (expr p,dx,dy) =
(xpart p +dx-uniformdeviate dx,ypart p+dy-uniformdeviate dy)
- enddef ;
+ enddef ;
- pair ll, lr, ur, ul ;
+ pair ll, lr, ur, ul ;
ll := (d,d) ;
lr := (width-d,d) ;
ur := (width-d,height-d) ;
ul := (d,height-d) ;
- path p, q, r, s ;
+ path p, q, r, s ;
p := ll.. for i=.1 step .1 until .9 : fuzzy (i[ll,lr],0,+dd).. endfor lr ;
q := lr.. for i=.1 step .1 until .9 : fuzzy (i[lr,ur],-dd,0).. endfor ur ;
@@ -201,27 +201,27 @@
fill p & q & r & s -- cycle withcolor \MPcolor{TextColor} ;
- color c ; c := \MPcolor{LineColor} ;
+ color c ; c := \MPcolor{LineColor} ;
- draw p withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
- draw q withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
- draw r withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
- draw s withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
+ draw p withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
+ draw q withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
+ draw r withpen pencircle xscaled 20 yscaled 5 rotated 30 withcolor c ;
+ draw s withpen pencircle xscaled 5 yscaled 20 rotated 30 withcolor c ;
\stopuseMPgraphic
\startuseMPgraphic{itemmark}
- width := BodyFontSize ; height := width/4 ;
+ width := BodyFontSize ; height := width/4 ;
maxheight := StrutHeight ; line := 3width/2 ;
- def fuzzy = -(height/4)+uniformdeviate (height/2) enddef ;
+ def fuzzy = -(height/4)+uniformdeviate (height/2) enddef ;
- draw
- ((0,0+fuzzy)--(width,height+fuzzy/2))
- shifted (line/2,0)
- withpen pencircle
- xscaled line yscaled (line/4)
- rotated (25+uniformdeviate 10) withcolor \MPcolor{SymbolColor} ;
+ draw
+ ((0,0+fuzzy)--(width,height+fuzzy/2))
+ shifted (line/2,0)
+ withpen pencircle
+ xscaled line yscaled (line/4)
+ rotated (25+uniformdeviate 10) withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,maxheight) ;
\stopuseMPgraphic
@@ -229,15 +229,15 @@
\startuseMPgraphic{nextmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
- def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
+ def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (0,0+fuzzy) ; z2 = (width,height/2+fuzzy/2) ; z3 = (0,height+fuzzy) ;
- draw
+ draw
(z1..{right}z2 & z2{left}..z3)
- withpen pencircle
- xscaled line yscaled (line/4)
- rotated 30 withcolor \MPcolor{SymbolColor} ;
+ withpen pencircle
+ xscaled line yscaled (line/4)
+ rotated 30 withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
@@ -245,15 +245,15 @@
\startuseMPgraphic{prevmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
- def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
+ def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (width,0+fuzzy) ; z2 = (0,height/2+fuzzy/2) ; z3 = (width,height+fuzzy) ;
- draw
+ draw
(z1..{left}z2 & z2{right}..z3)
- withpen pencircle
- xscaled line yscaled (line/4)
- rotated 30 withcolor \MPcolor{SymbolColor} ;
+ withpen pencircle
+ xscaled line yscaled (line/4)
+ rotated 30 withcolor \MPcolor{SymbolColor} ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
@@ -261,7 +261,7 @@
\startuseMPgraphic{stopmark}
LoadPageState ; width := BottomHeight ; height := line := width/2 ;
- def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
+ def fuzzy = -(height/8)+uniformdeviate (height/4) enddef ;
z1 = (0,0+fuzzy) ;
z2 = (width,height+fuzzy) ;
@@ -269,14 +269,34 @@
z4 = (0,height+fuzzy) ;
z5 = (width/2,height/2) ;
- drawoptions
- (withpen pencircle
- xscaled line yscaled (line/4)
- rotated 30 withcolor \MPcolor{SymbolColor}) ;
+ drawoptions
+ (withpen pencircle
+ xscaled line yscaled (line/4)
+ rotated 30 withcolor \MPcolor{SymbolColor}) ;
draw z1..{right}z5..z2 ; draw z3..{left}z5..z4 ;
setbounds currentpicture to unitsquare xyscaled(width,height) ;
\stopuseMPgraphic
-\endinput
+\doifnotmode{demo}{\endinput}
+
+%D The (rather silly) demo section.
+
+\starttext
+
+\TitlePage{Title Page\\pre-writing}
+
+\Topics{Some Nice Quotes}
+
+\Topic{A Few}
+
+\Subject{Knuth} \input knuth
+\Subject{Tufte} \input tufte
+
+\Topic{Some More}
+
+\Subject{Zapf} \input zapf
+\Subject{Bryson} \input bryson
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-pre-14.tex b/Master/texmf-dist/tex/context/base/s-pre-14.tex
index 7a777c27edf..f44117e7c9c 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-14.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-14.tex
@@ -15,18 +15,18 @@
%D In the process of making a couple of simple styles for
%D \EUROTEX\ 99, I came to this one. The joke is in the
%D pagenumber. This style can be used for short presentations
-%D with much text.
+%D with much text.
\startmode[asintended] \setupbodyfont[lbr] \stopmode
\setupbodyfont[14.4pt]
-%D Since we expect text, we can best be very tolerant.
+%D Since we expect text, we can best be very tolerant.
-\setuptolerance
+\setuptolerance
[verytolerant,stretch]
-%D As most styles we choose a large screen page size.
+%D As most styles we choose a large screen page size.
\setuppapersize
[S6][S6]
@@ -42,8 +42,8 @@
topspace=1cm,
backspace=1cm]
-%D We only use two colors, named \type {One} and \type
-%D {Two}:
+%D We only use two colors, named \type {One} and \type
+%D {Two}:
\setupcolors
[state=start]
@@ -54,15 +54,15 @@
%D If you've looked at the demo file, you will have noticed
%D that the background consists of four pieces: two filled
%D rectangles and two half numbers. These are put on th epage
-%D using four overlays:
+%D using four overlays:
\setupbackgrounds
[page]
- [background={one,two,three,four}]
+ [background={one,two,three,four}]
%D When we code this in \TEX, we get the following
%D definitions. As an alternative we coudl have used layers
-%D but I'm afraid that it would not have led to less code.
+%D but I'm afraid that it would not have led to less code.
\defineoverlay
[one]
@@ -80,8 +80,8 @@
width=\overlaywidth,height=\overlayheight]
{}}}]
-%D We could have used the main backgroundcolor instead of
-%D overlay \type {one}.
+%D We could have used the main backgroundcolor instead of
+%D overlay \type {one}.
\definefont[NumberFont][RegularBold at 3cm]
@@ -123,7 +123,7 @@
\edef\overlaywidth{\the\scratchdimen}}
%D A much cleaner implementation is the following. If you hate
-%D \METAPOST, you can run this style in the specified mode:
+%D \METAPOST, you can run this style in the specified mode:
\startnotmode[no-metapost]
@@ -135,36 +135,36 @@
\startuseMPgraphic{number}
StartPage ;
- path Vage ; picture Left, Right ;
+ path Vage ; picture Left, Right ;
x1 = x2 = xpart (llcorner Field[Text][RightEdge] shifted (-RightEdgeDistance/2,0)) ;
y1 = ypart llcorner Page ;
y2 = ypart ulcorner Page ;
Vage := llcorner Page -- z1 -- z2 -- ulcorner Page -- cycle ;
fill Page withcolor \MPcolor {One} ;
fill Vage withcolor \MPcolor {Two} ;
- if PageNumber>0 :
+ if PageNumber>0 :
defaultfont := "\truefontname{RegularBold}" ;
- Left := Right := thelabel("\folio",origin) ysized 3cm ;
- clip Right to boundingbox Right shifted (bbwidth(Right)/2,0) ;
+ Left := Right := thelabel("\folio",origin) ysized 3cm ;
+ clip Right to boundingbox Right shifted (bbwidth(Right)/2,0) ;
draw Left shifted z1 shifted (0,2.25cm) withcolor \MPcolor {One} ;
draw Right shifted z1 shifted (0,2.25cm) withcolor \MPcolor {Two} ;
- fi ;
+ fi ;
StopPage ;
\stopuseMPgraphic
\stopnotmode
-%D We use the simple label typesetting present in \METAPOST\
-%D because digits are seldom kerned so real \TEX ing is not
-%D needed. As in the previous method, we let the graphics
-%D overlap so that we don't get white lines due to rounding
-%D problems in viewers.
-%D
+%D We use the simple label typesetting present in \METAPOST\
+%D because digits are seldom kerned so real \TEX ing is not
+%D needed. As in the previous method, we let the graphics
+%D overlap so that we don't get white lines due to rounding
+%D problems in viewers.
+%D
%D We put a button behind the text (this overlay is calculated
-%D each page).
+%D each page).
-\defineoverlay
- [nextpage]
+\defineoverlay
+ [nextpage]
[\overlaybutton{nextpage}]
\setupbackgrounds
@@ -183,7 +183,7 @@
[color=,
contrastcolor=]
-%D Next we define structuring commands.
+%D Next we define structuring commands.
\definehead[Topic] [chapter] \setuphead[Topic] [style=\bfc]
\definehead[Subject][section] \setuphead[Subject][style=\bfa]
@@ -193,12 +193,12 @@
[number=no,
after={\blank[big]}]
-%D Because we will provide a menu, we don't offer lists.
+%D Because we will provide a menu, we don't offer lists.
\let\Topics \gobbleoneargument
\let\Subjects\relax
-%D The table of contents goes to the right edge.
+%D The table of contents goes to the right edge.
\startinteractionmenu[right]
\setupinteraction
@@ -218,7 +218,7 @@
maxwidth=\rightedgewidth,
style=\bfa]
-%D We safe some space:
+%D We safe some space:
\setupwhitespace
[medium]
@@ -226,8 +226,8 @@
\setupblank
[medium]
-%D In the titlepage, we still use the \TEX\ overlays,
-%D so that we don't have to define a second graphic.
+%D In the titlepage, we still use the \TEX\ overlays,
+%D so that we don't have to define a second graphic.
\def\TitlePage#1%
{\StartTitlePage#1\StopTitlePage}
@@ -246,7 +246,7 @@
\stopstandardmakeup
\egroup}
-%D This is it.
+%D This is it.
\doifnotmode{demo}{\endinput}
@@ -259,6 +259,6 @@
\Topic{Reich} \input reich
\Topic{Zapf} \input zapf
\Topic{Materie} \input materie
-\Topic{Stork} \input stork
+%Topic{Stork} \input stork
\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-pre-30.tex b/Master/texmf-dist/tex/context/base/s-pre-30.tex
new file mode 100644
index 00000000000..2a3899c9290
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-pre-30.tex
@@ -0,0 +1,258 @@
+%D \module
+%D [ file=s-pre-30,
+%D version=2006.04.25,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment 30,
+%D author=Hans Hagen,
+%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.
+
+\usemodule[streams]
+
+\setuppapersize
+ [S6] [S6]
+
+\setupbodyfont
+ [12pt,tt]
+
+\definemeasure[bleed][6pt]
+
+\definecolor[maincolor-3][r=.5,g=.2,b=.2]
+\definecolor[maincolor-1][r=.2,g=.5,b=.2]
+\definecolor[maincolor-2][r=.2,g=.2,b=.5]
+
+\definecolor[pagecolor] [s=.5]
+\definecolor[resultcolor][s=1,t=.85,a=1]
+\definecolor[maincolor] [maincolor-3]
+
+\definecolorgroup
+ [maingroup]
+ [.5:.2:.2,
+ .2:.5:.2,
+ .2:.2:.5]
+
+\definecolorgroup
+ [resultgroup]
+ [1:.85:.85,
+ .85:1:.85,
+ .85:.85:1]
+
+\def\CurrentColor{1}
+
+\definecolor[maincolor] [maingroup:\CurrentColor]
+\definecolor[resultcolor][resultgroup:\CurrentColor]
+
+\def\NextColor{\ifnum\CurrentColor=3 \def\CurrentColor{1}\else\doglobal\increment\CurrentColor\fi}
+
+\setuplayout
+ [backspace=\measure{bleed},
+ topspace=30pt,
+ bottomdistance=\measure{bleed},
+ bottom=\dimexpr30pt-\measure{bleed}\relax,
+ header=0pt,
+ footer=0pt,
+ topdistance=\measure{bleed},
+ top=\dimexpr30pt-\measure{bleed}\relax,
+ width=middle,
+ height=middle]
+
+\setuptop
+ [before=\vfill,
+ after=\vfill,
+ strut=yes]
+
+\setupbackgrounds
+ [text]
+ [backgroundoffset=\measure{bleed},
+ background=color,
+ backgroundcolor=maincolor]
+
+\setupbackgrounds
+ [page]
+ [background=color,
+ backgroundcolor=pagecolor]
+
+\setupcolors
+ [state=start,
+ textcolor=white]
+
+\setuphead
+ [chapter]
+ [style=\ttd]
+
+\setuphead
+ [section]
+ [style=\ttd]
+
+\defineproperty
+ [result]
+ [layer]
+ [state=stop]
+
+\definelayer
+ [result]
+
+\setuplayer
+ [result]
+ [width=\textwidth,
+ height=\textheight]
+
+\setupbackgrounds
+ [text]
+ [background={color,toggle,foreground,result}]
+
+\setupinteraction
+ [state=start,
+ click=no,
+ menu=on,
+ color=white,
+ contrastcolor=white,
+ closepageaction=HideLayer{result},
+ openpageaction=HideLayer{result}]
+
+% We add a dummy color switch so that each page has at least one
+% transparency; else acrobat will render the pages differently
+% bug in 6 and 7).
+
+\startinteractionmenu[bottom]
+% \color[resultcolor]{ }%
+ \hfill
+ \got [content] content \\
+ \got [previouspage] previous \\
+ \got [nextpage] next \\
+ \got [ToggleLayer{result}] result \\
+ \got [CloseDocument] close \\
+\stopinteractionmenu
+
+\setuphead
+ [section]
+ [placehead=no,
+ incrementnumber=list]
+
+\setuplist
+ [section]
+ [alternative=f]
+
+\defineoverlay
+ [toggle]
+ [\overlaybutton{ToggleLayer{result}}]
+
+\definestreamlayer
+ [resultstream]
+
+\startsetups streamlayer:resultstream:flush
+ \setlayer
+ [result]
+ [preset=middlebottom,
+ hoffset=\measure{bleed},
+% voffset=-\measure{bleed}]
+ voffset=\measure{bleed}]
+ {\startproperty[result]%
+% \framed
+% [offset=overlay,
+% frame=off,
+% background=color,
+% backgroundoffset=1\dimexpr\measure{bleed}\relax,
+% backgroundcolor=maincolor]
+ {\framed
+ [offset=overlay,
+ frame=off,
+ foregroundcolor=maincolor,
+ background=color,
+ backgroundoffset=1\dimexpr\measure{bleed}\relax,
+ backgroundcolor=resultcolor]
+ {\tightlayer[\currentstreamlayer]}}
+ \stopproperty}
+\stopsetups
+
+\startsetups show-definition
+ \subject{definition}
+ \typebuffer
+ \getbuffer
+ \page
+\stopsetups
+
+\startsetups show-result
+ \startstreamlayer[resultstream]
+ \subject{result}
+ \getbuffer
+ \stopstreamlayer
+ \placestreamlayer[resultstream]
+ \page
+\stopsetups
+
+\startsetups show-usage
+ \subject{usage}
+ \typebuffer
+ \startstreamlayer[resultstream]
+ \subject{result}
+ \getbuffer
+ \stopstreamlayer
+ \placestreamlayer[resultstream]
+ \page
+\stopsetups
+
+\startsetups show-usage-lines
+ \subject{usage}
+ \typebuffer
+ \startstreamlayer[resultstream]
+ \subject{result}
+ \startlines
+ \getbuffer
+ \stoplines
+ \stopstreamlayer
+ \placestreamlayer[resultstream]
+ \page
+\stopsetups
+
+\startsetups show-contents
+ \startcolumns[n=3]
+ \placelist[section][criterium=text]
+ \stopcolumns
+ \pagereference[content]
+ \page
+ \NextColor
+\stopsetups
+
+\def\TitlePage#1%
+ {\title{#1}
+ \setups{show-contents}}
+
+\def\StartSample#1%
+ {\starttext
+ \page
+ \section{#1}
+ \setuptoptexts[][\processedfile\enspace:\enspace\lowercase{#1}]}
+
+\def\StopSample
+ {\page
+ \setuptoptexts[][]
+ \stoptext
+ \NextColor}
+
+\endinput
+
+\usemodule[pre-30]
+
+% \TitlePage{Howling to the moon}
+
+\StartSample{Basics}
+
+\startbuffer
+\lua{a = 1.5 ; b = 1.8 ; c = a*b ; tex.print(c) ;}
+
+\startlua
+ a = 1
+ b = 2
+ c = a*b
+ tex.print(c)
+\stoplua
+\stopbuffer
+
+\setups{show-usage}
+
+\StopSample
diff --git a/Master/texmf-dist/tex/context/base/s-pre-50.tex b/Master/texmf-dist/tex/context/base/s-pre-50.tex
index 0332001ab37..782f6aea102 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-50.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-50.tex
@@ -8,29 +8,29 @@
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
%D When my mailbox started to overflow with messages about
%D problems with the presentation step mechanism, I looked up
%D old presentaton, hacked a bit and cooked up an alternative
-%D that is less dependent on \PDF\ trickery.
+%D that is less dependent on \PDF\ trickery.
%D
-%D Consider it a cheap trick and prelude to a couple of new
-%D presentation styles. (At the time of writing this, I
-%D still have some 10 of those styles to clean up and
-%D document.) You can give it a try:
+%D Consider it a cheap trick and prelude to a couple of new
+%D presentation styles. (At the time of writing this, I
+%D still have some 10 of those styles to clean up and
+%D document.) You can give it a try:
%D
-%D \starttyping
-%D texexec --pdf --mode=demo s-pre-50
-%D \stoptyping
+%D \starttyping
+%D texexec --pdf --mode=demo s-pre-50
+%D \stoptyping
% Basic definitions.
\defineframedtext
[horizontal]
[width=\textwidth,
- frame=off,
+ frame=off,
strut=no,
height=fit,
align={right,lohi},
@@ -50,7 +50,7 @@
\setupcollector
[contribution]
[voffset=-.25\bodyfontsize]
-
+
\setupframedtexts
[horizontal]
[background=color,
@@ -59,7 +59,7 @@
\stopmode
-%D Structure and trick.
+%D Structure and trick.
\def\StartSteps
{\checkutilities}
@@ -74,7 +74,7 @@
\flushcollector[contribution]
\page}
-%D Trick.
+%D Trick. Nowadays we can use streams.
\installoutput\FlushStep
{\StartStep\unvbox\normalpagebox\StopStep}
diff --git a/Master/texmf-dist/tex/context/base/s-pre-60.tex b/Master/texmf-dist/tex/context/base/s-pre-60.tex
index baedffaa30b..bd6b6ae4f77 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-60.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-60.tex
@@ -11,6 +11,16 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+\startmode[paper]
+ \let\StartSteps\relax
+ \let\StopSteps \relax
+ \let\FlushStep \relax
+ \let\ResetStep \relax
+ \let\StartBusy\relax
+ \let\StopBusy \relax
+ \endinput
+\stopmode
+
\newcounter\StepCounter
\newcounter\StepMaximum
@@ -79,7 +89,7 @@
\def\StopBusy {\removeunwantedspaces\stopproperty}
\setupinteraction
- [openaction=SetupStepper,
+ [%openaction=SetupStepper,
closeaction=ResetStepper,
openpageaction=CheckStepper,
closepageaction=ResetStepper]
@@ -111,4 +121,23 @@
[symbol={attach-normal,attach-down},
textlayer=\StepLayer]
+%D Handy:
+
+\def\StartLocalSteps{\ResetStep}
+\def\StopLocalSteps {}
+
+\def\StartLocalStep {\NextStep\StartStep}
+\def\StopLocalStep {\StopStep}
+
+%D used as (given some definitions):
+%D
+%D \starttyping
+%D \StartLocalSteps
+%D \startcombination[both]
+%D {\StartLocalStep\placestreamlayer[left]\StopLocalStep} {}
+%D {\StartLocalStep\placestreamlayer[right]\StopLocalStep} {}
+%D \stopcombination
+%D \StopLocalSteps
+%D \stoptyping
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/s-pre-61.tex b/Master/texmf-dist/tex/context/base/s-pre-61.tex
index fd30624c308..c2040a0d935 100644
--- a/Master/texmf-dist/tex/context/base/s-pre-61.tex
+++ b/Master/texmf-dist/tex/context/base/s-pre-61.tex
@@ -30,14 +30,14 @@
\setuplayout
[topspace=10pt,
- header=40pt,
+ header=30pt,
headerdistance=20pt,
height=middle,
footerdistance=20pt,
footer=0pt,
- bottomdistance=10pt,
+ bottomdistance=20pt,
bottom=20pt,
- bottomspace=40pt,
+ bottomspace=50pt,
backspace=30pt,
width=middle]
@@ -123,7 +123,8 @@
enlarged 4pt
withcolor \MPcolor{pagecolor} ;
fill Field[Text][Text]
- topenlarged (TopSpace +4pt)
+ enlarged 10pt
+% topenlarged (HeaderHeight+HeaderDistance)
leftenlarged (BackSpace+4pt)
rightenlarged (CutSpace +4pt)
withcolor OverlayColor ;
@@ -136,6 +137,7 @@
enlarged 4pt
withcolor \MPcolor{pagecolor} ;
fill Field[Text][Text]
+ enlarged 10pt
leftenlarged (BackSpace+4pt)
rightenlarged (CutSpace+4pt)
withcolor OverlayColor ;
diff --git a/Master/texmf-dist/tex/context/base/s-pre-62.tex b/Master/texmf-dist/tex/context/base/s-pre-62.tex
new file mode 100644
index 00000000000..c3683cbfad6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-pre-62.tex
@@ -0,0 +1,210 @@
+%D \module
+%D [ file=s-pre-62,
+%D version=2005.03.04,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment 62,
+%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 Melior
+
+\usemodule[pre-60]
+
+\usetypescriptfile
+ [type-ghz]
+
+\definetypeface[mainface][rm][serif][melior] [default][encoding=texnansi]
+\definetypeface[mainface][tt][mono] [modern] [default][encoding=texnansi,rscale=1.05]
+\definetypeface[mainface][ss][serif][melior] [default][encoding=texnansi]
+\definetypeface[mainface][mm][math] [palatino][default][encoding=texnansi,rscale=0.95]
+
+\setupbodyfont
+ [mainface,14.4pt]
+
+\setuppapersize
+ [S6][S6]
+
+\setvariables[layout][dx=0,dy=1,nx=2,ny=2,step=64]
+
+\definemeasure[layoutwd][\dimexpr\paperwidth /\getvariable{layout}{step}\relax]
+\definemeasure[layoutht][\dimexpr\paperheight/\getvariable{layout}{step}\relax]
+
+\setuplayout
+ [ width=middle,
+ height=middle,
+ header=0pt,
+ footer=0pt,
+ margin=0pt,
+ backspace=5\measure{layoutwd},
+ topspace=5\measure{layoutht}]
+
+\setuplayout
+ [step]
+ [ backspace=\numexpr2+ \getvariable{layout}{dx}\relax\measure{layoutwd},
+ cutspace=\numexpr3+\getvariable{layout}{nx}-\getvariable{layout}{dx}\relax\measure{layoutwd},
+ topspace=\numexpr2+ \getvariable{layout}{dy}\relax\measure{layoutht},
+ bottomspace=\numexpr3+\getvariable{layout}{ny}-\getvariable{layout}{dy}\relax\measure{layoutht}]
+
+
+\definecolor[layout:left] [t=.5,a=1,b=1]
+\definecolor[layout:right] [t=.5,a=1,r=1]
+\definecolor[layout:top] [t=.5,a=1,g=1]
+\definecolor[layout:bottom][t=.5,a=1,y=1]
+\definecolor[layout:page] [s=.75]
+
+\definehspace[menu][\measure{layoutwd}]
+
+\setupinteraction
+ [state=start,
+ click=off,
+ style=,
+ color=interactioncolor,
+ contrastcolor=interactioncolor]
+
+\setupinteractionscreen
+ [option=max]
+
+\setupbuttons
+ [color=maincolor,
+ contrastcolor=maincolor,
+ style=\tf, % acceptable
+ height=2\measure{layoutht},
+ width=2\measure{layoutwd},
+ offset=overlay,
+ frame=off]
+
+\definecolor[interactioncolor][darkgray]
+\definecolor[maincolor] [lightgray]
+
+\setuptexttexts
+ []
+ [\vbox to \textheight{\vfill\hfill\setups{menu:content}}]
+
+\startsetups menu:content
+
+ \button{\symbol[firstpage]}[firstpage]
+ \hspace[menu]
+ \button{\symbol[previouspage]}[previouspage]
+ \hspace[menu]
+ \button{\StartBusy\symbol[PauseRendering]\StopBusy}[InvokeStepper]
+ \hspace[menu]
+ \button{\symbol[nextpage]}[nextpage]
+ \hspace[menu]
+ \button{\symbol[lastpage]}[lastpage]
+ \hspace[menu]
+ \button{\symbol[CloseDocument]}[CloseDocument]
+
+\stopsetups
+
+\startuseMPgraphic{page}{step}
+ StartPage ;
+ numeric dx, dy ; dx := PaperWidth/\MPvar{step} ; dy := PaperHeight/\MPvar{step} ;
+ fill Page withcolor .5white ;
+ fill
+ ulcorner Page -- urcorner Page --
+ urcorner Page shifted (0,-TopSpace+dy) -- ulcorner Page shifted (0,-TopSpace+dy) -- cycle
+ withcolor \MPcolor{layout:top} ;
+ fill
+ llcorner Page -- lrcorner Page --
+ lrcorner Page shifted (0,BottomSpace-dy) -- llcorner Page shifted (0,BottomSpace-dy) -- cycle
+ withcolor \MPcolor{layout:bottom} ;
+ fill
+ ulcorner Page -- llcorner Page --
+ llcorner Page shifted (BackSpace-dx,0) -- ulcorner Page shifted (BackSpace-dx,0) -- cycle
+ withcolor \MPcolor{layout:left} ;
+ fill
+ urcorner Page -- lrcorner Page --
+ lrcorner Page shifted (-CutSpace+dx,0) -- urcorner Page shifted (-CutSpace+dx,0) -- cycle
+ withcolor \MPcolor{layout:right} ;
+ fill Field[Text][Text] enlarged (dx,dy) withcolor white ;
+ fill Field[Text][Text] enlarged (dx,dy) withcolor \MPcolor{layout:page} ;
+ StopPage ;
+\stopuseMPgraphic
+
+\defineoverlay[page][\useMPgraphic{page}{step=\getvariable{layout}{step}}]
+
+\setupbackgrounds
+ [page]
+ [background=page]
+
+\setupcolors
+ [state=start]
+
+\startsetups nextstep
+ % pagebreak handlers are grouped, so we need to set global
+ \ifnum\getvariable{layout}{dx}=\getvariable{layout}{nx}\relax
+ \ifnum\getvariable{layout}{dy}=\getvariable{layout}{ny}\relax
+ \setxvariables[layout][dy=1]
+ \else
+ \setxvariables[layout][dy=\the\numexpr\getvariable{layout}{dy}+1\relax]
+ \fi
+ \setxvariables[layout][dx=1]
+ \else
+ \setxvariables[layout][dx=\the\numexpr\getvariable{layout}{dx}+1\relax]
+ \fi
+ % global anyway
+ \setuplayout[step]
+\stopsetups
+
+\definefontsynonym[MainTitleFont][SerifBold]
+
+\definefont[ChapterTitleFont][MainTitleFont sa 2]
+
+\appendtoks
+ \NormalizeFontHeight \TitleFont {\setstrut\strut\quad} {4\lineheight} {MainTitleFont}
+ \NormalizeFontHeight \SubTitleFont {\setstrut\strut\quad} {3\lineheight} {MainTitleFont}
+ \NormalizeFontHeight \ChapterNumberFont {XVI} {4\lineheight} {MainTitleFont}
+\to \everystarttext
+
+\setupsection
+ [section-2]
+ [bodypartconversion=Romannumerals]
+
+\installpagebreakhandler {step} {\setups{nextstep}}
+
+\definepagebreak[chapter][yes,step]
+
+\setuphead
+ [chapter]
+ [page=chapter,
+ command=\MyChapterCommand]
+
+\definehead[Topic][chapter]
+\definehead[Nopic][title]
+
+\setuphead[chapter,Topic,Nopic]
+ [numberstyle=\ChapterNumberFont,
+ textstyle=\ChapterTitleFont,
+ numbercolor=lightgray,
+ textcolor=darkgray]
+
+\def\MyChapterCommand#1#2%
+ {\hbox \bgroup % we need to nil the strut added by the headplacement
+ \setupframed[frame=off,lines=4,offset=overlay]%
+ \rlap{\hskip2\lineheight\framed{\setnostrut#1}}\framed{#2}%
+ \egroup}
+
+\setupitemize
+ [each]
+ [R,broad]
+ [stopper=,
+ color=lightgray]
+
+\def\doTitlePage#1#2#3%
+ {\startstandardmakeup[headerstate=high,textstate=stop]
+ \setupalign[middle]
+ \def\\{\def\\{\endgraf}\endgraf\vfil\ignorespaces#2}%
+ \startcolor[darkgray]
+ #1\setstrut\setupinterlinespace\vfil#3\vfil
+ \stopcolor
+ \stopstandardmakeup}
+
+\def\TitlePage {\doTitlePage\TitleFont\relax}
+\def\SubTitlePage{\doTitlePage\TitleFont\SubTitleFont}
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/s-pre-63.tex b/Master/texmf-dist/tex/context/base/s-pre-63.tex
new file mode 100644
index 00000000000..76de8b99186
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-pre-63.tex
@@ -0,0 +1,73 @@
+%D \module
+%D [ file=s-pre-63,
+%D version=2006.05.11,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Presentation Environment 63,
+%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.
+
+\usemodule[pre-61,streams]
+
+\definemeasure[textgap] [\dimexpr24pt\relax]
+
+\definemeasure[leftwidth] [\dimexpr.25\textwidth-.5\measure{textgap}\relax]
+\definemeasure[rightwidth][\dimexpr.75\textwidth-.5\measure{textgap}\relax]
+
+\definestreamlayer[left] [width=\measure{leftwidth}]
+\definestreamlayer[right][width=\measure{rightwidth}]
+
+\setupbodyfont[12pt]
+
+\definefont[LeftFont][Normal sa 3]
+
+\setupheader[style=\tfc,before=\vss,after=\vss]
+
+\startsetups streamlayer:left:settings
+ \hsize\measure{leftwidth}
+ \LeftFont
+ \setupinterlinespace
+\stopsetups
+
+\startsetups streamlayer:right:settings
+ \hsize\measure{rightwidth}
+\stopsetups
+
+\definecombination[both][distance=\measure{textgap},location=top]
+
+\startsetups place:both
+ \startcombination[both]
+ {\StartLocalStep\placestreamlayer[left]\StopLocalStep} {}
+ {\StartLocalStep\placestreamlayer[right]\StopLocalStep} {}
+ \stopcombination
+\stopsetups
+
+\def\StartPage {\page \StartLocalSteps}
+\def\StopPage {\StopLocalSteps \page}
+
+\def\StartLeft {\startstreamlayer[left]}
+\def\StartRight{\startstreamlayer[right]}
+
+\def\StopLeft {\stopstreamlayer}
+\def\StopRight {\stopstreamlayer}
+
+\def\StartPair {}
+\def\StopPair {\setups[place:both]}
+
+\doifnotmode {demo} {\endinput}
+
+\setupbodyfont[8pt] \definefont[BigFont][Normal sa 4]
+
+\starttext
+
+\StartPage
+ \StartPair \StartLeft ZAPF \StopLeft \StartRight \input zapf \StopRight \StopPair
+ \StartPair \StartLeft DAVIS \StopLeft \StartRight \input davis \StopRight \StopPair
+ \StartPair \StartLeft WARD \StopLeft \StartRight \input ward \StopRight \StopPair
+\StopPage
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/s-syn-01.tex b/Master/texmf-dist/tex/context/base/s-syn-01.tex
new file mode 100644
index 00000000000..d797be61e8f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/s-syn-01.tex
@@ -0,0 +1,54 @@
+%D \module
+%D [ file=s-syn-01,
+%D version=0000.00.00,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Preliminary Syntax Stuff,
+%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 This is needed for the \METAFUN\ manual (this module was
+%D called \type {p-syn-01} on my machine).
+
+\unprotect
+
+\def\Indent #1{\ifvmode\noindent\hbox to 2em{\hss#1}\else#1\fi}
+\def\Sugar #1{\ifhmode\unskip\unskip\unskip\fi\kern.25em{#1}\kern.25em\ignorespaces}
+\def\Something#1{\Sugar{\mathematics{\langle\hbox{#1}\rangle}}}
+\def\Lbrace {\Sugar{\tttf\leftargument}}
+\def\Rbrace {\Sugar{\tttf\rightargument}}
+\def\Or {\Sugar{\mathematics{\vert}}}
+\def\Optional #1{\Sugar{\mathematics{[\hbox{#1}]}}}
+\def\Means {\Sugar{\mathematics{\rightarrow}}}
+\def\Tex #1{\Sugar{\type{#1}}}
+\def\Literal #1{\Sugar{\type{#1}}}
+\def\Syntax #1{\strut\kern-.25em{#1}\kern-.25em}
+\def\Next {\crlf\hbox to 2em{}\nobreak}
+\def\Whatever #1{\Sugar{\mathematics{(\hbox{#1})}}}
+\def\Quote #1{\Sugar{\quote{#1}}}
+
+\def\Or {\Sugar{\Indent{\mathematics{\vert}}}}
+\def\Means {\Sugar{\Indent{\mathematics{\rightarrow}}}}
+
+\def\StartSyntax
+ {\goodbreak
+ \startlines
+ \catcode`\#=12
+ \let\L \Literal
+ \let\S \Something
+ \def\FL##1{\color[darkred]{\L{##1}}}
+ \def\FS##1{\S{\color[darkred]{##1}}}
+ \let\M \Means
+ \let\O \Or
+ \let\Q \Quote
+ \let\LB\Lbrace
+ \let\RB\Rbrace}
+
+\def\StopSyntax
+ {\stoplines}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/sort-def.tex b/Master/texmf-dist/tex/context/base/sort-def.tex
index e2496f19644..10dc31b14e4 100644
--- a/Master/texmf-dist/tex/context/base/sort-def.tex
+++ b/Master/texmf-dist/tex/context/base/sort-def.tex
@@ -31,6 +31,9 @@
\exportsortexpansion{eth} {}
\exportsortexpansion{Eth} {}
+\exportsortexpansion{dj} {dstroke}
+\exportsortexpansion{Dj} {Dstroke}
+
\exportsortexpansion{Acircumflex} {}
\exportsortexpansion{acircumflex} {}
\exportsortexpansion{Ccircumflex} {}
diff --git a/Master/texmf-dist/tex/context/base/sort-ini.tex b/Master/texmf-dist/tex/context/base/sort-ini.tex
index 84d32e2ff12..970cbff1f24 100644
--- a/Master/texmf-dist/tex/context/base/sort-ini.tex
+++ b/Master/texmf-dist/tex/context/base/sort-ini.tex
@@ -11,10 +11,16 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% dodo: autokeyexpansion => igv utf: \setupregister[index][keyexpansion=yes]
+
%D This module replaces existing sort key handling and is meant to be
%D used with the new texutil functionality. This module defines a few
%D auxiliary macros.
+\ifx\exportsortaction\undefined \else \endinput \fi
+
+\writestatus{loading}{Context Sorting Macros (ini)}
+
%D The sorting method is largely bases on the one used in the old version
%D of texutil but i've changed the interface a bit. It all boils down to
%D a bunch of substitutions. The reimplementation makes it easier to extend
@@ -68,6 +74,8 @@
\unprotect
+\newevery \everysavesortkeys \relax
+
\let\currentexportclass\empty
\def\exportsortaction#1#2#3%
@@ -84,17 +92,59 @@
{\exportsortexpansion{#1}{#2}%
\exportsortdivision {#2}{#1}}
-% Next we overload some macros defined in enco-ini and core-uti. This
-% will change.
+\def\exportutfsortexpansion#1#2#3%
+ {\bgroup
+ \edef\utfsorta{\string\unknownchar}%
+ \dostepwiserecurse{#2}{#3}\plusone
+ {\edef\utfsortb{\@EA\string\csname\doutfunihash{#1}{\recurselevel}\endcsname}%
+ \ifx\utfsortb\utfsorta \else
+ \edef\utfsortc{\numbertoutf{\numexpr#1*256+\recurselevel\relax}}%
+ \expanded{\exportsortshortcut{\utfsortc}{\utfsortb\space}}% space is really needed
+ \fi}%
+ \egroup}
+
+\def\savesortdefinitions
+ {\bgroup
+ \doifelse \currentregime {utf}
+ {\exportutfsortexpansion{0}{128}{255}%
+ \exportutfsortexpansion{1}{0}{255}}
+ {\def\defineactivecharacter##1 ##2%
+ {\expanded{\exportsortshortcut{\rawcharacter{##1}}}{##2}}%
+ \doifelse{\characterregime}\nocharacterregime
+ {\doifnot{\characterencoding}\nocharacterencoding % to be sure, autoregime
+ {\the\executeifdefined{\@reg@\characterencoding}\emptytoks}}%
+ {\the\executeifdefined{\@reg@\characterregime}\emptytoks}}%
+ \egroup
+ \readfile{\f!sortprefix def}\donothing\donothing % default
+ \global\let\savesortdefinitions\relax}
-\let\definesortkey\gobblefourarguments
+\def\savesortlanguage#1% language specifics
+ {\doifsomething{#1}
+ {\doifundefined{\f!sortprefix::#1}%
+ {\bgroup
+ \global\letvalue{\f!sortprefix::#1}\empty
+ \def\currentexportclass{#1}%
+ \enablemode[sortorder-#1]%
+ \readfile{\f!sortprefix lan}\donothing\donothing
+ \egroup}}}
+
+\prependtoks
+ \savesortdefinitions
+\to \everysavesortkeys
\def\savesortkeys
- {\globallet\savesortkeys\relax
- \enablemode[sortorder-\currentmainlanguage]%
- \readfile{\f!sortprefix new}\donothing\donothing % temporary hacks
- \readfile{\f!sortprefix def}\donothing\donothing % defaults
- \readfile{\f!sortprefix lan}\donothing\donothing}% language specifics
+ {\the\everysavesortkeys
+ \global\everysavesortkeys\emptytoks}
+
+% \defineregister[one]
+% \defineregister[two] \setupregister[two][language=cz]
+%
+% \starttext
+% test \one{one} test \one{two} test \one {\aacute} test \one{alpha} test \one{chow}
+% test \two{one} test \two{two} test \two {\aacute} test \two{alpha} test \two{chow}
+% \blank[3*big] \placeregister[one]
+% \blank[3*big] \placeregister[two]
+% \stoptext
% already done \prependtoks \savesortkeys \to \everystarttext
diff --git a/Master/texmf-dist/tex/context/base/sort-lan.tex b/Master/texmf-dist/tex/context/base/sort-lan.tex
index 60b0699acb9..ad5232b02c8 100644
--- a/Master/texmf-dist/tex/context/base/sort-lan.tex
+++ b/Master/texmf-dist/tex/context/base/sort-lan.tex
@@ -11,6 +11,15 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% for testing:
+
+\startmode[sortorder-en]
+ \exportsortexpansion{aacute}{a+1}
+ \exportsortexpansion{Aacute}{A+2}
+ \exportsortexpansion{agrave}{a+1}
+ \exportsortexpansion{Agrave}{A+2}
+\stopmode
+
%D This module replaces existing sort key handling and is meant to be
%D used with the new texutil functionality. Here we define the language
%D specific sort rules.
@@ -19,6 +28,18 @@
%
% a-c, ccaron, cacute, d, dstroke, e-s, scaron, t-z, zcaron
+% \enableregime[utf]
+% \mainlanguage[sl]
+% \starttext
+% \ccaron\index{\ccaron\space 1}
+% \Ccaron\index{\Ccaron\space 1}
+% č\index{č 2}
+% Č\index{Č 2}
+% \v c\index{\v c 3}
+% \v C\index{\v C 3}
+% \placeindex
+% \stoptext
+
% \startmode[sortorder-sl]
% \exportsortexpansion {ccaron} {cz}
% \exportsortexpansion {cacute} {czz}
@@ -70,6 +91,36 @@
%
% a-z, aring, adiaeresis, odiaeresis
+% \mainlanguage[sv]
+% \starttext
+% a\index{a}
+% a\index{a}
+% z\index{z}
+% z\index{z}
+% q\index{q}
+% q\index{q}
+% \index{}
+% \index{}
+% \index{}
+% \index{}
+% \index{}
+% \index{}
+% \index{}
+% \index{}
+% \index{}
+% \aring\index{\aring}
+% \adiaeresis\index{\adiaeresis}
+% \odiaeresis\index{\odiaeresis}
+% A\index{A}
+% \index{}
+% \index{}
+% \index{}
+% \Aring\index{\Aring}
+% \Adiaeresis\index{\Adiaeresis}
+% \Odiaeresis\index{\Odiaeresis}
+% \placeindex
+% \stoptext
+
\startmode[sortorder-sv]
\exportsortrule {aring} {z+1}
\exportsortrule {adiaeresis} {z+2}
@@ -96,11 +147,57 @@
% czech
%
-% a-c ccaron d-
+% a) make a single group for: "a", "", "A", ""
+% b) make a different two groups for: "c", "C" and "c", "C"
+% c) sorting rule: "A" < "" < "a" < "" < "C" < "c" < "C" < "c"
+% d) sorting rule: "h" < "ch" < "i" ("c" < "h")
+
+\gdef\czsortdivisionch{ch}
+\gdef\czsortdivisionCh{Ch}
\startmode[sortorder-cz]
- \exportsortrule {ccaron} {c+1}
- \exportsortreduction {ch} {c}
+ \exportsortexpansion {aacute} {a+1}
+ \exportsortexpansion {Aacute} {A+1}
+ \exportsortexpansion {ccaron} {c+1}
+ \exportsortexpansion {Ccaron} {C+1}
+ \exportsortdivision {c+1} {ccaron}
+ \exportsortexpansion {dcaron} {d+1}
+ \exportsortexpansion {Dcaron} {D+1}
+ \exportsortdivision {d+1} {dcaron}
+ \exportsortexpansion {eacute} {e+1}
+ \exportsortexpansion {Eacute} {E+1}
+ \exportsortexpansion {ecaron} {e+2}
+ \exportsortexpansion {Ecaron} {E+2}
+ \exportsortreduction {ch} {h+1}
+ \exportsortexpansion {ch} {h+1}
+ \exportsortreduction {Ch} {H+1}
+ \exportsortexpansion {Ch} {H+1}
+ \exportsortdivision {h+1} {czsortdivisionch}
+ \exportsortexpansion {iacute} {i+1}
+ \exportsortexpansion {Iacute} {I+1}
+ \exportsortexpansion {ncaron} {n+1}
+ \exportsortexpansion {Ncaron} {N+1}
+ \exportsortdivision {n+1} {ncaron}
+ \exportsortexpansion {oacute} {o+1}
+ \exportsortexpansion {Oacute} {O+1}
+ \exportsortexpansion {rcaron} {r+1}
+ \exportsortexpansion {Rcaron} {R+1}
+ \exportsortdivision {r+1} {rcaron}
+ \exportsortexpansion {scaron} {s+1}
+ \exportsortexpansion {Scaron} {S+1}
+ \exportsortdivision {s+1} {scaron}
+ \exportsortexpansion {tcaron} {t+1}
+ \exportsortexpansion {Tcaron} {T+1}
+ \exportsortdivision {t+1} {tcaron}
+ \exportsortexpansion {uacute} {u+1}
+ \exportsortexpansion {Uacute} {U+1}
+ \exportsortexpansion {uring} {u+2}
+ \exportsortexpansion {Uring} {U+2}
+ \exportsortexpansion {yacute} {y+1}
+ \exportsortexpansion {Yacute} {Y+1}
+ \exportsortexpansion {zcaron} {z+1}
+ \exportsortexpansion {Zcaron} {Z+1}
+ \exportsortdivision {z+1} {zcaron}
\stopmode
\endinput
diff --git a/Master/texmf-dist/tex/context/base/spec-def.tex b/Master/texmf-dist/tex/context/base/spec-def.tex
index d24d257c708..62313585e6c 100644
--- a/Master/texmf-dist/tex/context/base/spec-def.tex
+++ b/Master/texmf-dist/tex/context/base/spec-def.tex
@@ -961,8 +961,10 @@
\defineoutput [dpx] [dpx]
\defineoutput [acrobat] [pdf,ps,tr]
-\defineoutput [xetex] [dvi,xtx]
-\defineoutput [xtx] [dvi,xtx]
+\defineoutput [xetex] [dpx]
+\defineoutput [xtx] [dpx]
+\defineoutput [xdv] [dvi,xtx]
+\defineoutput [xdv2pdf] [dvi,xtx]
%D Please let me know if we need more. From now on we default
%D to:
diff --git a/Master/texmf-dist/tex/context/base/spec-dpx.tex b/Master/texmf-dist/tex/context/base/spec-dpx.tex
index 161cee303fd..f317a388701 100644
--- a/Master/texmf-dist/tex/context/base/spec-dpx.tex
+++ b/Master/texmf-dist/tex/context/base/spec-dpx.tex
@@ -65,7 +65,7 @@
%D \type{"1 0 0 1 -x -y cm"}.
%D
%D 2. \type{pdf:literal direct #1} puts directly the given PDF commands
-%D #1 without changing the text matrix.
+%D \type {#1} without changing the text matrix.
%D
%D Literal \PDF\ inclusion is implemented as:
@@ -264,8 +264,7 @@
\def\assignPDFtransparency#1#2%
{\def\PDFtransparencyidentifier{/Tr#1}%
- %\def\PDFtransparencyreference{\PDFobjref{#2}}}
- \def\PDFtransparencyreference{@TR:#2}}
+ \def\PDFtransparencyreference{@TR:#2}} % todo: \PDFobjref{TR:#2}
\def\presetPDFtransparency#1#2%
{\initializePDFtransparency
@@ -273,12 +272,9 @@
\def\dopresetPDFtransparency#1#2%
{\global\advance\PDFcurrenttransparency \plusone
- %\immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}%
-% \special{pdf: object @TR:\the\PDFcurrenttransparency\space \PDFtransparancydictionary{#1}{#2}{}}%
\doPDFreserveDPXobject{TR:\the\PDFcurrenttransparency}{<< >>}%
\special{pdf:\doPDFcheckedDPXobject{TR:\the\PDFcurrenttransparency}\PDFtransparancydictionary{#1}{#2}{}}%
\edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}%
- %\edef\PDFtransparencyreference {\PDFobjref\pdflastobj}%
\edef\PDFtransparencyreference {@TR:\the\PDFcurrenttransparency}%
\setxvalue{\@@PDT#1:#2}%
{\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\PDFcurrenttransparency}}%
@@ -287,15 +283,11 @@
\PDFtransparencyreference\space}}
\def\initializePDFtransparency
- %{\immediate\pdfobj{\PDFtransparancydictionary{1}{1}{/AIS false}}%
-% {\special{pdf: object @TR:0 \PDFtransparancydictionary{1}{1}{/AIS false}}%
{\doPDFreserveDPXobject{TR:0}{<< >>}%
\special{pdf:\doPDFcheckedDPXobject{TR:0}\PDFtransparancydictionary{1}{1}{/AIS false}}%
\xdef\PDFtransparencyresetidentifier{/Tr0}%
- %\xdef\PDFtransparencyresetreference{\PDFobjref\pdflastobj}%
\xdef\PDFtransparencyresetreference{@TR:0}%
\setxvalue{\@@PDT0:0}%
- %{\noexpand\assignPDFtransparency{0}{\the\pdflastobj}}%
{\noexpand\assignPDFtransparency{0}{0}}%
\appendtoPDFdocumentextgstates
{\PDFtransparencyresetidentifier\space
@@ -404,35 +396,70 @@
% wd nextbox > #3 ivm offset
-\definespecial\dostartobject#1#2#3#4#5%
+% \definespecial\dostartobject#1#2#3#4#5%
+% {\bgroup
+% \dowithnextbox
+% {\dosetobjectreference{#1}{#2}{@#1::#2}%
+% \scratchdimen#3\edef\width {\the\scratchdimen\space}%
+% \scratchdimen#4\edef\height{\the\scratchdimen\space}%
+% \setbox\nextbox\vbox
+% {\special{pdf:bxobj @#1::#2 width \width height \height}%
+% % we need to compensate for the box offset (ugly, sigh)
+% \scratchdimen\nextboxht
+% \advance\scratchdimen\nextboxdp
+% \advance\scratchdimen-#4\relax
+% \nextboxdp\zeropoint
+% \nextboxht\zeropoint
+% \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}%
+% \ifx\currentPDFresources\empty
+% \else
+% \special{pdf:put @resources <<\currentPDFresources>>}%
+% \global\let\currentPDFresources\empty
+% \fi
+% \special{pdf:exobj}}%
+% \smashbox\nextbox
+% \flushatshipout{\box\nextbox}%
+% \egroup}%
+% \hbox\bgroup}
+
+% \definespecial\dostopobject
+% {\egroup}
+
+\def\doDVIPDFMXstartobject#1#2#3#4#5#6%
{\bgroup
\dowithnextbox
- {\dosetobjectreference{#1}{#2}{@#1::#2}%
- \scratchdimen#3\edef\width {\the\scratchdimen\space}%
- \scratchdimen#4\edef\height{\the\scratchdimen\space}%
+ {\ifcase#1\or\dosetobjectreference{#2}{#3}{@#2::#3}\fi
+ \scratchdimen#4\edef\width {\the\scratchdimen\space}%
+ \scratchdimen#5\edef\height{\the\scratchdimen\space}%
\setbox\nextbox\vbox
- {\special{pdf:bxobj @#1::#2 width \width height \height}%
- % we need to compensate for the box offset (ugly, sigh)
- \scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
- \advance\scratchdimen-#4\relax
- \nextboxdp\zeropoint
- \nextboxht\zeropoint
- \hbox to #3{\hss\lower.5\scratchdimen\box\nextbox\hss}%
+ {\special{pdf:bxobj @#2::#3 width \width height \height}%
+ % we need to compensate for the box offset (ugly, sigh)
+ \scratchdimen\nextboxht
+ \advance\scratchdimen\nextboxdp
+ \advance\scratchdimen-#5\relax
+ \nextboxdp\zeropoint
+ \nextboxht\zeropoint
+ \hbox to #4{\hss\lower.5\scratchdimen\box\nextbox\hss}%
\ifx\currentPDFresources\empty
\else
- \special{pdf:put @resources <<\currentPDFresources\the\pdfpageresources>>}%
+ \special{pdf:put @resources <<\currentPDFresources>>}%
\global\let\currentPDFresources\empty
\fi
\special{pdf:exobj}}%
- \smashbox\nextbox
- \flushatshipout{\box\nextbox}%
- \egroup}%
+ \smashbox\nextbox
+ \flushatshipout{\box\nextbox}%
+ \egroup}%
\hbox\bgroup}
-\definespecial\dostopobject
+\def\doDVIPDFMXstopobject
{\egroup}
+\definespecial\dostartobject#1#2#3#4#5%
+ {\doDVIPDFMXstartobject\plusone{#1}{#2}{#3}{#4}{#5}}
+
+\definespecial\dostopobject
+ {\doDVIPDFMXstopobject}
+
\definespecial\doinsertobject#1#2%
{\hbox
{\doPDFgetobjectreference{#1}{#2}\PDFobjectreference
@@ -753,9 +780,9 @@
{\vbox to \zeropoint
{\vss
\hbox to \zeropoint
- {\special{pdf:btrans matrix #1 #2 #3 #4 #5 #6}%
+ {\special{pdf:btrans matrix #1 #2 #3 #4 #5 #6}%
\rlap{\special{pdf:image width 1bp height 1bp (#7)}}
- \special{pdf:etrans}\hss}}}
+ \special{pdf:etrans}\hss}}}
{\message{[unknown figure #7]}}}
%D 5. Modified codes from \type{supp-pdf}
@@ -764,11 +791,21 @@
\newcounter\MPPDFcounter
-\def\setMPPDFobject#1#2%
- {\ifx\currentPDFresources\empty\else\doPDFpageresource{#1}\fi
- \def\getMPPDFobject{\box#2}}
+\newcounter\MPPDFobjectcounter
-\let\getMPPDFobject\relax
+\def\setMPPDFobject#1#2% resources boxnumber
+ {\doglobal\increment\MPPDFobjectcounter
+ \xdef\getMPPDFobject
+ {\vbox to \the\ht#2%
+ {\vss
+ \hbox to \the\wd#2%
+ {\scratchdimen\wd#2\scratchdimen.5\scratchdimen\hskip-\the\scratchdimen
+ \special{pdf:uxobj @MPPDF::\MPPDFobjectcounter}}}}%
+ \expanded{\doDVIPDFMXstartobject\zerocount{MPPDF}\MPPDFobjectcounter{\the\wd#2}{\the\ht#2}{\the\dp#2}}%
+ \box#2%
+ \doDVIPDFMXstopobject}
+
+\let\getMPPDFobject\gobbletwoarguments
\definespecial\doinsertMPfile#1%
{\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}}
@@ -809,13 +846,17 @@
\vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
\else
%\vss\box\scratchbox
- \vss\hbox to #4\scaledpoint{\box\scratchbox\hss}
+ \vss\hbox to #4\scaledpoint{\box\scratchbox\hss}%
\fi\fi}}%
\box\scratchbox
\elabelgroup}
%D 7. Copied codes from \type{spec-dvi}
+% coming pdftex versions will provide pos support in dvi mode (untested)
+
+% \ifnum\pdftexversion>140 .. \fi
+
\definespecial\dosetposition#1%
{\special{pos:pxy "#1"}}
@@ -828,11 +869,21 @@
\let\flushDVIpositionpapersize\relax
\definespecial\dosetpositionpapersize#1#2%
- {\xdef\flushDVIpositionpapersize%
+ {\xdef\flushDVIpositionpapersize
{\special{pos:papersize #1 #2}%
- \noexpand\installprogram{dvipos \jobname}%
+ \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }%
\global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
+\beginXETEX
+
+ \definespecial\dosetpositionpapersize#1#2%
+ {\xdef\flushDVIpositionpapersize
+ {\special{pos:papersize #1 #2}%
+ \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.xdv }%
+ \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
+
+\endXETEX
+
\prependtoksonce \flushDVIpositionpapersize \to \everyshipout
\stopspecials
diff --git a/Master/texmf-dist/tex/context/base/spec-dvi.tex b/Master/texmf-dist/tex/context/base/spec-dvi.tex
index 5da86743c74..e13698cf394 100644
--- a/Master/texmf-dist/tex/context/base/spec-dvi.tex
+++ b/Master/texmf-dist/tex/context/base/spec-dvi.tex
@@ -21,6 +21,8 @@
%D Reuse of object is not supported by the \DVI\ format. We
%D therefore just duplicate them using boxes.
+\setjobsuffix{dvi} % can be overloaded in other spec's
+
\startspecials[tex]
\newbox\DVIobjects \newcounter\DVIobjectcounter
@@ -106,7 +108,7 @@
%
% \appendtoksonce
% \ifspecialbasedsettings
-% \ifpositioning\installprogram{dvipos \jobname}\fi
+% \ifpositioning\installprogram{dvipos -o \jobname.tuo \jobname.dvi}\fi
% \fi
% \to \everystoptext
%
@@ -115,7 +117,7 @@
\definespecial\dosetpositionpapersize#1#2%
{\xdef\flushDVIpositionpapersize%
{\special{pos:papersize #1 #2}%
- \noexpand\installprogram{dvipos \jobname}%
+ \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }%
\global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
\prependtoksonce \flushDVIpositionpapersize \to \everyshipout
diff --git a/Master/texmf-dist/tex/context/base/spec-fdf.tex b/Master/texmf-dist/tex/context/base/spec-fdf.tex
index 853dbb678a6..5f759941bc0 100644
--- a/Master/texmf-dist/tex/context/base/spec-fdf.tex
+++ b/Master/texmf-dist/tex/context/base/spec-fdf.tex
@@ -59,7 +59,14 @@
\newif\ifovercomePDFbugs \overcomePDFbugsfalse % dest sort problem / 3-
\newif\ifovercomePDFspace \overcomePDFspacetrue % dest sort problem / 3-
-\newif\ifovercomePDFpage \overcomePDFpagetrue % pdf spec change / 5+
+
+% the pdf spec changed cq. viewers started behaving differently / 5+
+
+\chardef\overcomePDFpage\plusone % page numbers/ beware: optimizers remove this one
+\chardef\overcomePDFpage\plustwo % page:number
+%chardef\overcomePDFpage\plusthree % pdftex page ref feature
+
+\ifx\pdfpageref\undefined \else \chardef\overcomePDFpage\plusthree \fi
\chardef\safePDFcode=`-
@@ -399,6 +406,9 @@
\doPDFaddtocatalog{\currentPDFpagemode\currentPDFviewerprefs}%
\doPDFaddtoinfo{/Trapped /False}%
\doPDFaddtoinfo{/ConTeXt.Version (\contextversion)}%
+ \doPDFaddtoinfo{/ConTeXt.Time (\number\normalyear.\twodigits\normalmonth.\twodigits\normalday\space \twodigits\currenthour:\twodigits\currentminute)}%
+ \doPDFaddtoinfo{/ConTeXt.Jobname (\jobname)}%
+ \doPDFaddtoinfo{/ConTeXt.Url (www.pragma-ade.com)}%
\to \everyfirstshipout
\def\PDFversion{1.5}
@@ -453,13 +463,17 @@
\def\doPDFsetupidentity#1#2#3#4#5#6%
{\bgroup
\enablePDFdocencoding
+ \edef\!!stringa{#5}%
+ \ifx\!!stringa\empty \ifx\pdfdate\undefined\else
+ \edef\!!stringa{D:\pdfdate}%
+ \fi \fi
\expanded{\doPDFaddtoinfo
{/Title (#1)
/Subject (#2)
/Author (#3)
/Creator (#4)
- /ModDate (#5)
- /ID (\jobname.#5) % needed for pdf/x
+ /ModDate (\!!stringa)
+ /ID (\jobname.\!!stringa) % needed for pdf/x
/Keywords (#6)}}%
\egroup}
@@ -653,7 +667,6 @@
\doifelsenothing{#3}% #1 = url
{\scratchcounter0#5\relax
\ifnum\scratchcounter>0
- \advance\scratchcounter \minusone % pdf starts numbering at zero
\doifelsenothing{#4}
{\let\PDFfile\empty}
{\expanded{\beforesplitstring#4}\at.\to\PDFfile
@@ -663,12 +676,18 @@
{\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile
\edef\PDFfile{R /F (\PDFfile)\PDFgotonewwindow}}}%
\ifx\PDFfile\empty
- \ifovercomePDFpage % a named page ref
- \edef\PDFdestination{(page:\the\scratchcounter)}%
- \else % beware: optimizers remove this one
+ \ifcase\overcomePDFpage
+ \or % pdf starts numbering at zero
+ \advance\scratchcounter \minusone
\edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}%
+ \or % pdf starts numbering at zero
+ \advance\scratchcounter \minusone
+ \edef\PDFdestination{(page:\the\scratchcounter)}%
+ \or % pdftex starts numbering at one
+ \edef\PDFdestination{[\pdfpageref\scratchcounter\space0 R \PDFpageviewwrd]}%
\fi
- \else % across files it's a page number
+ \else % across files it's a page number / pdf starts numbering at zero
+ \advance\scratchcounter \minusone
\edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}%
\fi
\edef\action{/S /GoTo\PDFfile\space /D \PDFdestination}%
@@ -694,7 +713,7 @@
\let\lastfakedPDFpage\!!zerocount
\def\fakePDFpagedestination % as in pdf, we start numbering at zero
- {\iflocation \ifovercomePDFpage \ifarrangingpages \else
+ {\iflocation \ifarrangingpages \ifnum\overcomePDFpage=\plustwo \else
\ifnum\lastfakedPDFpage<\realpageno
\bgroup
\xdef\lastfakedPDFpage{\realfolio}%
@@ -973,8 +992,8 @@
\@EA\processallactionsinset\@EA
[#9]
[\v!controls=>\donetrue,
- \v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat },
- \v!preview=>\edef\pdf@@options{\pdf@@options /Poster true }]%
+ \v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat },
+ \v!preview=>\edef\pdf@@options{\pdf@@options /Poster true }]%
\edef\pdf@@actions{\pdf@@actions /ShowControls \ifdone true\else false\fi}%
\doPDFannotation width #7 height #8 data
{/Subtype /Movie
diff --git a/Master/texmf-dist/tex/context/base/spec-ini.tex b/Master/texmf-dist/tex/context/base/spec-ini.tex
index c53fbbd5cee..8d867e9a1be 100644
--- a/Master/texmf-dist/tex/context/base/spec-ini.tex
+++ b/Master/texmf-dist/tex/context/base/spec-ini.tex
@@ -80,9 +80,9 @@
\stopmessages
\startmessages italian library: specials
- title: specialit
+ title: specialitø
1: -- caricato
- 2: non permesso un annidamento maggiore --
+ 2: non ø permesso un annidamento maggiore --
3: -- reimpostato
4: il comando -- non esiste
5: caricamento del file di definizione --
@@ -112,6 +112,17 @@
7: driver necunoscut --
\stopmessages
+\startmessages french library: specials
+ title: specials
+ 1: -- chargé
+ 2: pas d'imbracations plus profondes ne sont permises --
+ 3: -- est remis à zéro
+ 4: la commande -- n'existe pas
+ 5: chargement du fichier de définition --
+ 6: l'imbrication n'est pas permise
+ 7: pilote -- inconnu
+\stopmessages
+
\startmessages dutch library: interactions
21: -- code tussengevoegd
\stopmessages
@@ -133,13 +144,17 @@
\stopmessages
\startmessages norwegian library: interactions
- 21: -- kode satt inn / tilfyd
+ 21: -- kode satt inn / tilføyd
\stopmessages
\startmessages romanian library: interactions
21: -- cod inserat
\stopmessages
+\startmessages french library: interactions
+ 21: -- code inseré
+\stopmessages
+
%D \TEX\ produces files in the \DVI\ format. This format is
%D well defined and stable. In this format one||byte commands
%D are used which can optionally be followed by length
@@ -167,6 +182,21 @@
%D output.
%D \macros
+%D {jobsuffix}
+%D
+%D By default, \TEX\ produces \DVI\ files which can be
+%D converted to other filetypes. Sometimes it is handy to
+%D know what the target file will be. In other driver
+%D modules we wil set \type {\jobsuffix} to \type {pdf}.
+
+\def\jobsuffix{dvi}
+
+\def\setjobsuffix#1%
+ {\resetsystemmode\jobsuffix
+ \edef\jobsuffix{#1}%
+ \setsystemmode\jobsuffix}
+
+%D \macros
%D {everyresetspecials}
%D
%D Now what will this one do? We'll see in a few lines.
@@ -393,10 +423,9 @@
{\doifdefinedelse{\@@specfil@@#1}
{\edef\currentspecialfile{\getvalue{\@@specfil@@#1}}}
{\edef\currentspecialfile{#1}}%
- \makeshortfilename[\f!specialprefix\currentspecialfile]%
- \showmessage\m!specials5\currentspecialfile
+ \makeshortfilename[\truefilename{\f!specialprefix\currentspecialfile}]%
\startreadingfile
- \readsysfile\shortfilename\donothing\donothing
+ \readsysfile\shortfilename{\showmessage\m!specials5\currentspecialfile}\donothing
\stopreadingfile
\showmessage\m!specials1\preloadedspecials}}
diff --git a/Master/texmf-dist/tex/context/base/spec-mis.tex b/Master/texmf-dist/tex/context/base/spec-mis.tex
index 0134c8bbc74..6bd7c699443 100644
--- a/Master/texmf-dist/tex/context/base/spec-mis.tex
+++ b/Master/texmf-dist/tex/context/base/spec-mis.tex
@@ -209,7 +209,7 @@
\long\def\preservePSpar#1\to#2%
{\bgroup
- \def\par{\rawcharacter{12}\rawcharacter{12}}%
+ \def\par{\rawcharacter{12}\rawcharacter{12}}% hm, should be one 13 but 12 ff is platform safe
\expanded{\egroup\noexpand\def\noexpand#2{#1}}}
%D \macros
diff --git a/Master/texmf-dist/tex/context/base/spec-tpd.tex b/Master/texmf-dist/tex/context/base/spec-tpd.tex
index 56fd9342cb6..c21139b03ce 100644
--- a/Master/texmf-dist/tex/context/base/spec-tpd.tex
+++ b/Master/texmf-dist/tex/context/base/spec-tpd.tex
@@ -93,13 +93,14 @@
\pdfvorigin=1 true in
\fi
-%D We default to 300 dots per inch image resolution.
+%D We default to 300 dots per inch image resolution and 600 dpi
+%D bitmap fonts (when asked for).
-\ifx\pdfimageresolution\undefined
- \newcount\pdfimageresolution
-\fi
+\ifx\pdfimageresolution\undefined \newcount\pdfimageresolution \fi
+\ifx\pdfpkresolution \undefined \newcount\pdfpkresolution \fi
\pdfimageresolution=300
+\pdfpkresolution =600
%D Another downward compatible hack:
@@ -241,7 +242,7 @@
%D nasty but needed
-\appendtoksonce \loadallfontmapfiles \to \everyPDFximage
+\appendtoksonce \loadallfontmapfiles \to \everyPDFximage % currently == \everyPDFxform
%D \macros
%D {doinsertfile,dogetnofinsertpages}
@@ -305,12 +306,19 @@
\definefileinsertion{tpd}{pdf}{\handlepdfimage}
\definefileinsertion{tpd}{png}{\handlepdfimage}
\definefileinsertion{tpd}{jpg}{\handlepdfimage}
-%definefileinsertion{tpd}{tif}{\handlepdfimage} % unstable
+\definefileinsertion{tpd}{jb2}{\handlepdfimage}
+
+% \definefileinsertion{tpd}{jpeg} {\handlepdfimage}
+% \definefileinsertion{tpd}{jbig2}{\handlepdfimage}
+
+%definefileinsertion{tpd}{tif}{\handlepdfimage} % unstable and gone
%D Experimental:
% \definefileinsertion{tpd}{svg}{\doPDFinsertsvg}
% \definefileinsertion{tpd}{svgz}{\doPDFinsertsvg}
+%
+% todo: no placeholder but manipulator of evt autorlx
\def\doPDFinsertsvg#1#2#3#4#5#6#7#8#9%
{\externalfigureplaceholder{#1}{#7}{#8}}
@@ -341,44 +349,45 @@
\ifnum\pdftexversion>13
-\def\checkpdfimagepagenumber#1%
- {\let\pdfimagepagenumber\empty
- \getfromcommacommand[#1][1]%
- \doifnumberelse\commalistelement
- {\ifcase\commalistelement\else
- \edef\pdfimagepagenumber{page \commalistelement}%
- %\message{(pdf image \pdfimagepagenumber)}%
- \fi}
- {}}
-
-\def\handlepdfimage#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \the\everyPDFximage
- \doifvalidpdfimagefileelse{#1}
- {\checkpdfimagepagenumber{#9}%
- \immediate\pdfximage
- \ifdim#7>\zeropoint \!!width #7\fi
- \ifdim#8>\zeropoint \!!height #8\fi
- \pdfimagepagenumber
-\@@DriverImageBox
- {#1}%
- \xdef\PDFimagereference{\the\pdflastximage}%
- \xdef\nofinsertpages{\the\pdflastximagepages}%
- \pdfrefximage\pdflastximage}
- {\framed[\c!width=#7,\c!height=#8]{#1}}%
- \egroup}
+ \def\checkpdfimagepagenumber#1%
+ {\let\pdfimagepagenumber\empty
+ \getfromcommacommand[#1][1]%
+ \doifnumberelse\commalistelement
+ {\ifcase\commalistelement\else
+ \edef\pdfimagepagenumber{page \commalistelement}%
+ %\message{(pdf image \pdfimagepagenumber)}%
+ \fi}
+ {}}
+
+ \def\handlepdfimage#1#2#3#4#5#6#7#8#9%
+ {\bgroup
+ \the\everyPDFximage
+ \doifvalidpdfimagefileelse{#1}
+ {\checkpdfimagepagenumber{#9}%
+ %\pdfimmediateximage
+ \ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi
+ \ifdim#7>\zeropoint \!!width #7\fi
+ \ifdim#8>\zeropoint \!!height #8\fi
+ \pdfimagepagenumber
+ \@@DriverImageBox
+ {#1}%
+ \xdef\PDFimagereference{\the\pdflastximage}%
+ \xdef\nofinsertpages{\the\pdflastximagepages}%
+ \pdfrefximage\pdflastximage}
+ {\framed[\c!width=#7,\c!height=#8]{#1}}%
+ \egroup}
\else
-\def\handlepdfimage#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \doifvalidpdfimagefileelse{#1}
- {\pdfimage
- \ifdim#7>\zeropoint \!!width #7\fi
- \ifdim#8>\zeropoint \!!height #8\fi
- {#1}}%
- {\framed[\c!width=#7,\c!height=#8]{#1}}%
- \egroup}
+ \def\handlepdfimage#1#2#3#4#5#6#7#8#9%
+ {\bgroup
+ \doifvalidpdfimagefileelse{#1}
+ {\pdfimage
+ \ifdim#7>\zeropoint \!!width #7\fi
+ \ifdim#8>\zeropoint \!!height #8\fi
+ {#1}}%
+ {\framed[\c!width=#7,\c!height=#8]{#1}}%
+ \egroup}
\fi
@@ -439,70 +448,73 @@
% \fi
% \@@DriverImageBox}
+\def\pdfimmediateximage{\immediate\pdfximage}
+
\ifnum\pdftexversion>13
-\def\checkpdfimageattributes
- {\ifx\PDFfigurereference\empty
- \global\let\pdfimageattributes\empty
- \else
- \immediate\pdfobj
- {[ << /Image \PDFobjref\PDFfigurereference
- /DefaultForPrinting true >> ]}%
- \xdef\pdfimageattributes
- {attr {/Alternates \PDFobjref\pdflastobj}}%
- \fi}
-
-\global\let\PDFimagecolorreference\empty
-
-\def\checkpdfimagecolorspecs
- {\ifx\pdflastximagecolordepth \undefined
- \global\let\pdfimagecolorspecs\empty
- \else\ifx\PDFimagecolorreference\empty
- \global\let\pdfimagecolorspecs\empty
- \else
- \xdef\pdfimagecolorspecs{colorspace \PDFimagecolorreference\space}%
- \fi\fi
- \global\let\PDFimagecolorreference\empty}
-
-\def\dogetTPDfiguresize#1#2#3#4#5#6#7%
- {\ifmeasureTPDfiguresize
- #4\zeropoint
- #5\zeropoint
- \doifvalidpdfimagefileelse{#2}
- {\ifvoid\foundexternalfigure
- \donetrue
- \else\ifx\PDFfigurereference\empty
- \donetrue
- \else
- \doifinstringelse\filesuffix{\c!png,\c!jpg}\donetrue\donefalse
- \fi\fi}
- {\donefalse}%
- \ifdone
- \the\everyPDFximage
- \checkpdfimagepagenumber{#3}%
- \checkpdfimageattributes
- \checkpdfimagecolorspecs
- \global\setbox\foundexternalfigure\hbox
- {\immediate\pdfximage
- \pdfimageattributes
- \pdfimagecolorspecs
- \pdfimagepagenumber
- \@@DriverImageBox
- {#2}%
- \xdef\PDFimagereference{\the\pdflastximage}%
- \xdef\nofinsertpages{\the\pdflastximagepages}%
- \pdfrefximage\pdflastximage}%
- #6\wd\foundexternalfigure
- #7\ht\foundexternalfigure
- \global\let\PDFfigurereference\empty
- \global\let\PDFimageattributes\empty
+ \def\checkpdfimageattributes
+ {\ifx\PDFfigurereference\empty
+ \global\let\pdfimageattributes\empty
\else
- #6\zeropoint
- #7\zeropoint
- \fi
- \else
- #1{#2}{#3}{#4}{#5}{#6}{#7}% \normaldogetfiguresize...
- \fi}
+ \immediate\pdfobj
+ {[ << /Image \PDFobjref\PDFfigurereference
+ /DefaultForPrinting true >> ]}%
+ \xdef\pdfimageattributes
+ {attr {/Alternates \PDFobjref\pdflastobj}}%
+ \fi}
+
+ \global\let\PDFimagecolorreference\empty
+
+ \def\checkpdfimagecolorspecs
+ {\ifx\pdflastximagecolordepth \undefined
+ \global\let\pdfimagecolorspecs\empty
+ \else\ifx\PDFimagecolorreference\empty
+ \global\let\pdfimagecolorspecs\empty
+ \else
+ \xdef\pdfimagecolorspecs{colorspace \PDFimagecolorreference\space}%
+ \fi\fi
+ \global\let\PDFimagecolorreference\empty}
+
+ \def\dogetTPDfiguresize#1#2#3#4#5#6#7%
+ {\ifmeasureTPDfiguresize
+ #4\zeropoint
+ #5\zeropoint
+ \doifvalidpdfimagefileelse{#2}
+ {\ifvoid\foundexternalfigure
+ \donetrue
+ \else\ifx\PDFfigurereference\empty
+ \donetrue
+ \else
+ \doifinstringelse\filesuffix{\c!png,\c!jpg}\donetrue\donefalse
+ \fi\fi}
+ {\donefalse}%
+ \ifdone
+ \the\everyPDFximage
+ \checkpdfimagepagenumber{#3}%
+ \checkpdfimageattributes
+ \checkpdfimagecolorspecs
+ \global\setbox\foundexternalfigure\hbox
+ {\ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi
+ %\pdfimmediateximage
+ \pdfimageattributes
+ \pdfimagecolorspecs
+ \pdfimagepagenumber
+ \@@DriverImageBox
+ {#2}%
+ \xdef\PDFimagereference{\the\pdflastximage}%
+ \xdef\nofinsertpages{\the\pdflastximagepages}%
+ \pdfrefximage\pdflastximage}%
+ #6\wd\foundexternalfigure
+ #7\ht\foundexternalfigure
+ \global\let\PDFfigurereference\empty
+ \global\let\PDFimageattributes\empty
+ \else
+ #6\zeropoint
+ #7\zeropoint
+ \fi
+ \else
+ #1{#2}{#3}{#4}{#5}{#6}{#7}% \normaldogetfiguresize...
+ \fi}
\else
@@ -1450,7 +1462,8 @@
\else
\def\setMPPDFobject#1#2% resources boxnumber
- {\immediate\pdfxform resources{#1}#2%
+ {\the\everyPDFxform
+ \immediate\pdfxform resources{#1}#2%
\edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}}
\fi
diff --git a/Master/texmf-dist/tex/context/base/spec-xtx.tex b/Master/texmf-dist/tex/context/base/spec-xtx.tex
index ea355abd7bb..ee71a60a2cf 100644
--- a/Master/texmf-dist/tex/context/base/spec-xtx.tex
+++ b/Master/texmf-dist/tex/context/base/spec-xtx.tex
@@ -1,4 +1,11 @@
-%D \module %D [ file=spec-xtx, %D version=2004.11.08, %D title=\CONTEXT\ Special Macros, %D subtitle=\XETEX\ support, %D author={Adam Lindsay \& Hans Hagen \& \unknown}, %D date=\currentdate, %D copyright={Adam Lindsay \& Hans Hagen}]
+%D \module
+%D [ file=spec-xtx,
+%D version=2004.11.08,
+%D title=\CONTEXT\ Special Macros,
+%D subtitle=\XETEX\ support,
+%D author={Adam Lindsay \& Hans Hagen \& \unknown},
+%D date=\currentdate,
+%D copyright={Adam Lindsay \& Hans Hagen}]
\unprotect
@@ -15,7 +22,7 @@
\definespecial\dostartrotation#1%
{\special{x:gsave}\special{x:rotate #1}}
-\definespecial\dostoprotation%
+\definespecial\dostoprotation
{\special{x:grestore}}
%D Scaling and mirroring are also fine.
@@ -23,13 +30,13 @@
\definespecial\dostartscaling#1#2%
{\special{x:gsave}\special{x:scale #1 #2}}
-\definespecial\dostopscaling%
+\definespecial\dostopscaling
{\special{x:grestore}}
-\definespecial\dostartmirroring%
+\definespecial\dostartmirroring
{\special{x:gsave}\special{x:scale -1 1}}
-\definespecial\dostopmirroring%
+\definespecial\dostopmirroring
{\special{x:grestore}}
%D Colors are done with the \DVIPDFMX\ color model, which are
@@ -37,11 +44,10 @@
%D Although hex colors were accommodated by Hans, we'll try the
%D more familiar \DVIPDFMX\ ones. One good side-effect of the
-%D previous approach
-%D was that it kept track of the color state (transparency
-%D in XeTeX is accomplished setting the color to an RGBA quadruple,
-%D rather than an RGB triple). So transparency will need another
-%D plan.
+%D previous approach was that it kept track of the color state
+%D (transparency in XeTeX is accomplished setting the color to
+%D an RGBA quadruple, rather than an RGB triple). So transparency
+%D will need another plan.
% \macros
% {dostarttransparency,dostoptransparency}
@@ -158,90 +164,4 @@
\stopspecials
-\protect
-
-%\endinput
-
-% FOR THE MOMENT HERE
-
-\ifx\dqfontquote\undefined \else \endinput \fi
-
-\unprotect
-
-% actually, we can use "" in pdftex> 1.20 as well
-
-\def\parsefontspec#1%
- {\xdef\somefontspec{#1\space}%
- \@EA\doparsefontspec\somefontspec\relax]% =>#1 \empty]
- \donoparsefontspec}
-
-\def\doparsefontspec#1%
- {\ifx"#1%
- \@EA\dodqparsefontspec
- \else\ifx'#1%
- \@EAEAEA\dosqparsefontspec
- \else
- \@EAEAEA\dodoparsefontspec
- \fi\fi#1}
-
-\def\dqfontquote{"}
-\def\sqfontquote{'}
-
-\def\dodqparsefontspec"#1"#2%
- {\def\somefontname{#1}%
- \let\somefontquote\dqfontquote
- \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2}
-
-\def\dosqparsefontspec'#1'#2%
- {\def\somefontname{#1}%
- \let\somefontquote\sqfontquote
- \ifx#2\relax\@EA\setnaturalfontspec\else\@EA\setforcedfontspec\fi#2}
-
-\def\dodoparsefontspec#1 #2%
- {\def\somefontname{#1}%
- \let\somefontquote\empty
- \ifx\somefontname\empty % space before fontname
- \@EA\doparsefontspec
- \else\ifx#2\relax
- \@EAEAEA\setnaturalfontspec
- \else
- \@EAEAEA\setforcedfontspec
- \fi\fi
- #2}
-
-\def\setnaturalfontspec#1]%
- {\@fs@scaled\plusthousand\relax}
-
-\def\setforcedfontspec#1 #2\relax]%
- {\csname\@fs@#1\endcsname#2\relax}
-
-\beginXETEX \font
-
-\def\donoparsefontspec % #1 == \cs
- {\edef\fontfile{\somefontquote\truefontname\somefontname\somefontquote}%
- \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi
- \edef\lastfontname{\fontfile\somefontspec}%
- \ifx\fontclass\empty
- \expandafter\definefontlocal
- \else
- \expandafter\definefontglobal
- \fi} % #1 == \cs
-
-\endXETEX
-
\protect \endinput
-
-\starttext
-
-\definedfont[{cmr10} at 40pt] test
-\definedfont['cmss10' at 40pt] test
-\definedfont["cmtt10" at 40pt] test
-
-\definedfont[{cmr10} at 40pt] test
-\definedfont['cmss10' at 40pt] test
-\definedfont["cmtt10" at 40pt] test
-
-% \definedfont["Gentium" at 40pt] test
-
-\stoptext
-
diff --git a/Master/texmf-dist/tex/context/base/supp-ali.tex b/Master/texmf-dist/tex/context/base/supp-ali.tex
index 3dc8848a39a..8727efbb271 100644
--- a/Master/texmf-dist/tex/context/base/supp-ali.tex
+++ b/Master/texmf-dist/tex/context/base/supp-ali.tex
@@ -147,8 +147,7 @@
\def\pushcharacteralign
{\ifundefined{@cac@\alignmentclass}%
- \doglobal
- \appendetoks\noexpand\do{\alignmentclass}\to\@@characteralignlst
+ \doglobal\appendetoks\noexpand\do{\alignmentclass}\to\@@characteralignlst
\fi
\setxvalue{@cac@\alignmentclass}{\noexpand\do
{\afterassignwidth}{\beforeassignwidth}{\alignmentcharacter}}}
@@ -161,7 +160,7 @@
\executeifdefined{@cac@\alignmentclass}\donothing}
\def\resetcharacteralign % does not work well nested
- {\def\do##1{\letbeundefined{@cac@##1}}%
+ {\def\do##1{\global\letbeundefined{@cac@##1}}% global !
\the\@@characteralignlst
\global\@@characteralignlst\emptytoks}
diff --git a/Master/texmf-dist/tex/context/base/supp-box.tex b/Master/texmf-dist/tex/context/base/supp-box.tex
index 4b451a6bfab..76c71c1994d 100644
--- a/Master/texmf-dist/tex/context/base/supp-box.tex
+++ b/Master/texmf-dist/tex/context/base/supp-box.tex
@@ -453,10 +453,13 @@
{\beginofshapebox
\unvbox\nextbox
\endofshapebox
- \global\count1\zerocount
- \reshapebox{\global\advance\count1\plusone}%
- \egroup\noflines\count1 }%
- \vbox}
+ % \global\count1\zerocount
+ % \reshapebox{\global\advance\count1\plusone}%
+ % \egroup\noflines\count1 }%
+ \scratchcounter\zerocount
+ \reshapebox{\global\advance\scratchcounter\plusone}%
+ \expandafter\egroup\expandafter\noflines\the\scratchcounter\relax
+ }\vbox}
%D \macros
%D {doiftextelse, doiftext}
@@ -1023,8 +1026,8 @@
\def\obeyedspace{\hskip\zeropoint\hbox to \onepoint{}\hskip\zeropoint}%
\let\obeyedline \obeyedspace
\ifcase-#1\or
- \def\next{#3}\scantokens\expandafter{\next}%
- % also ok: \scantokens{#3}%
+ \def\next{#3\relax}\scantokens\expandafter{\next}% relax catches lookahead problem
+ % also ok: \scantokens{#3}% % as in \hyphenatedword{spanish|?|}
\or
\readfile{#3}\donothing\donothing
\else
@@ -1802,7 +1805,7 @@
%D
%D \normalvbox
%D \bgroup
-%D \converthboxtovbox
+%D \convertvboxtohbox
%D \egroup
%D \stoptyping
%D
@@ -1878,6 +1881,26 @@
\setbox0\normalhbox{\box2\unhbox0}%
\repeat}
+% \def\makehboxofhboxes
+% {\setbox0\normalhbox{}%
+% \doloop % \doloop { .. \exitloop .. }
+% {% \dorecurse{3}{\unskip\unpenalty}% get rid of ... (better do this in a shapeloop)
+% \setbox2\lastbox
+% \ifhbox2
+% \setbox0\normalhbox{\box2\unhbox0}%
+% \else
+% \exitloop
+% \fi}}
+
+% \def\flushboxesonly % feed this into \makehboxofhboxes
+% {\dowithnextbox
+% {\beginofshapebox
+% \unvbox\nextbox
+% \endofshapebox
+% \doreshapebox{\box\shapebox}{}{}{}% get rid of penalties etc
+% \innerflushshapebox}
+% \vbox}
+
\def\removehboxes
{\setbox0\lastbox
\ifhbox0
diff --git a/Master/texmf-dist/tex/context/base/supp-fil.tex b/Master/texmf-dist/tex/context/base/supp-fil.tex
index cd0c48150e8..da4b595b844 100644
--- a/Master/texmf-dist/tex/context/base/supp-fil.tex
+++ b/Master/texmf-dist/tex/context/base/supp-fil.tex
@@ -509,7 +509,7 @@
{\sanitizefilename#1\to\readfilename
\checkfilename\readfilename
\ifcase\kindoffile
- \edef\locreadfilename{\pathplusfile\f!currentpath{#1}}%
+ \edef\readfilename{\pathplusfile\f!currentpath{#1}}%
\fi}
%D \macros
@@ -591,6 +591,8 @@
%D regards to active characters (german ", polish /,
%D french : and ;).
+%D We need to redo this: catcode sets and such
+
\def\startreadingfile% beter een every en \setnormalcatcodes
{\doglobal\increment\readingfilelevel
\setxvalue{\string\readingfilelevel::\readingfilelevel}%
@@ -615,11 +617,17 @@
\catcode`\\=\@@escape
\catcode`\{=\@@begingroup
\catcode`\}=\@@endgroup
- \catcode`\%=\@@comment}
+ \catcode`\%=\@@comment
+ \pushendofline
+ \restoreendofline}
\def\stopreadingfile
- {\getvalue{\string\readingfilelevel::\readingfilelevel}%
+ {\popendofline
+ \getvalue{\string\readingfilelevel::\readingfilelevel}%
\doglobal\decrement\readingfilelevel}
+
+\let\normalstartreadingfile\startreadingfile
+\let\normalstopreadingfile \stopreadingfile
%D \macros
%D {splitfilename}
diff --git a/Master/texmf-dist/tex/context/base/supp-fun.tex b/Master/texmf-dist/tex/context/base/supp-fun.tex
index 5f0700deb57..812323826ff 100644
--- a/Master/texmf-dist/tex/context/base/supp-fun.tex
+++ b/Master/texmf-dist/tex/context/base/supp-fun.tex
@@ -135,8 +135,9 @@
{\convertargument #7\to\asciia
\convertcommand \DroppedString\to\asciib
\ExpandBothAfter\doifinstringelse\asciia\asciib
- {\dontleavehmode
- \ifhmode\hskip-\parindent\fi
+ {\noindentation
+ \dontleavehmode
+ %\ifhmode\hskip-\parindent\fi % sensitive for context mechanism
\keeplinestogether{#6}%
\setbox0\hbox{\definedfont[#2 at #3]#1{#7}\hskip#4}%
\ifdim\dp0>\strutdp % one of those Q's , will be option
diff --git a/Master/texmf-dist/tex/context/base/supp-lan.tex b/Master/texmf-dist/tex/context/base/supp-lan.tex
index ebb47424c8f..83ab14df0d2 100644
--- a/Master/texmf-dist/tex/context/base/supp-lan.tex
+++ b/Master/texmf-dist/tex/context/base/supp-lan.tex
@@ -184,8 +184,8 @@
%D compound characters like |-| or || to be separated from the
%D words. \TEX\ hackers will recognise the next two macro's:
-\def\prewordbreak {\penalty10000\hskip0pt\relax}
-\def\postwordbreak {\penalty0\prewordbreak}
+\def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax}
+\def\postwordbreak {\penalty\zerocount\prewordbreak}
%D We first show the original implementation, which only
%D supports \type{|} as command and delimiter. Before
@@ -359,7 +359,7 @@
%D
%D \starttyping
%D \startlanguagespecifics[de]
-%D \installcompoundcharacter "a {\moveaccent{-.1ex}\"a\midworddiscretionary}
+%D \installcompoundcharacter "a {{\moveaccent{-.1ex}\"a\midworddiscretionary}}
%D \stoplanguagespecifics
%D \stoptyping
%D
@@ -507,11 +507,16 @@
\nextnextnext}
\def\checkbeforediscretionary
- {\setbox0\lastbox
- \ifdim\wd0=\zeropoint
- \let\postwordbreak\prewordbreak
- \fi
- \box0\relax}
+ {\ifvmode\dontleavehmode\fi
+ \ifhmode
+ \begingroup
+ \setbox\scratchbox\lastbox
+ \ifdim\wd\scratchbox=\zeropoint
+ \let\postwordbreak\prewordbreak
+ \fi
+ \box\scratchbox\relax
+ \endgroup
+ \fi}
\def\checkafterdiscretionary
{\ifx,\nextnext
@@ -604,8 +609,8 @@
{\uccode`'=`'\relax \uccode`~=`~\relax \uccode`_=`_\relax
\uccode`(=`(\relax \uccode`)=`)\relax \uccode`==`=\relax
\uccode`<=`<\relax \uccode`>=`>\relax
- \let\dotextmodediscretionary = \activedotextmodediscretionary
- \let\dododotextmodediscretionary = \activedododotextmodediscretionary}
+ \let\dotextmodediscretionary \activedotextmodediscretionary
+ \let\dododotextmodediscretionary\activedododotextmodediscretionary}
%D We only have to redefine two macros. While saving the
%D \type{\uccode} in a macro we have to take care of empty
@@ -673,7 +678,7 @@
\allowbreak\postwordbreak
\egroup
\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \nextnextnext}
+ \nextnextnext} % no lookahead in commands
%D Now we can safely do things like: \enableactivediscretionaries
%D
@@ -769,11 +774,12 @@
\allowbreak\postwordbreak
\egroup
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
- \nextnextnext}
+ \nextnextnext} % no lookahead in commands
%D Since most things in \CONTEXT\ are configurable, we
%D slightly change the previous definition so that we can
-%D install new functionality outside this module.
+%D install new functionality outside this module. We also
+%D support lookahead (over the egroup).
\def\@tmd@{@@tmd@@}
@@ -804,10 +810,14 @@
\discretionary{\hbox{#2}}{}{\hbox{#2}}%
\allowbreak\postwordbreak
\egroup
+ \else\ifx\nextnextnext\egroup % so we can properly do things afterward
+ \@EA\egroup
+ \@EA\let\@EA\nextnextnext\@EA\empty
+ \csname\@tmd@\discretionarytoken\endcsname
\else
\csname\@tmd@\discretionarytoken\endcsname
- \fi\fi
- \nextnextnext} % can be \egroup so \aftergroup\ignorespaces
+ \fi\fi\fi
+ \nextnextnext} % lookahead in commands
\def\definetextmodediscretionary #1
{\convertargument#1\to\ascii
@@ -816,9 +826,6 @@
\definetextmodediscretionary {} % empty case, also handled in parser
{\prewordbreak\compoundhyphen\allowbreak\postwordbreak}
-\definetextmodediscretionary =
- {\prewordbreak\textmodediscretionary}
-
\definetextmodediscretionary ~
{\prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak}
@@ -852,32 +859,41 @@
\definetextmodediscretionary >
{\endofsubsentencespacing\prewordbreak\endofsubsentence}
-\definetextmodediscretionary . % not yet definitive
- {\prewordbreak\midsentence\prewordbreak}
+% \definetextmodediscretionary . % not yet definitive
+% {\prewordbreak\midsentence\prewordbreak}
+
+\definetextmodediscretionary =
+ {\prewordbreak\midsentence\prewordbreak} % {\prewordbreak\compoundhyphen}
\definetextmodediscretionary ^
{\prewordbreak\discretionary{\hbox{$|$}}{}{\hbox{$|$}}%
\allowbreak\postwordbreak}
+% french
+
\definetextmodediscretionary :
{\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{:}:}
- %\space\aftergroup\ignorespaces}
\definetextmodediscretionary ;
{\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{;};}
- %\space\aftergroup\ignorespaces}
\definetextmodediscretionary ?
{\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{?}?}
- %\space\aftergroup\ignorespaces}
\definetextmodediscretionary !
{\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{!}!}
- %\space\aftergroup\ignorespaces}
\definetextmodediscretionary *
{\prewordbreak\discretionary{-}{}{\kern.05em}\prewordbreak}
+% spanish
+
+\definetextmodediscretionary ??
+ {\prewordbreak\questiondown}
+
+\definetextmodediscretionary !!
+ {\prewordbreak\exclamdown}
+
\ifx\hspaceamount\undefined
\def\hspaceamount#1#2{\kern.16667em}
@@ -898,6 +914,10 @@
%D In those situations where the nature of characters is
%D less predictable, we can use the more direct approach:
+%D Beware: an \type {\ignorespaces} in a definition works
+%D okay here, but not in the main mechanism because there
+%D we have \type {\nextnextnext}.
+
\unexpanded\def\directdiscretionary#1%
{\convertargument#1\to\discretionarytoken
\let\textmodediscretionary\compoundhyphen
@@ -954,16 +974,16 @@
\def\@cc@{@cc@} % compound character
\def\@cs@{@cs@} % compound characters
-% \def\installcompoundcharacter #1#2#3 #4% {{#4}} keeps move local
+% \def\installcompoundcharacter #1#2#3 #4% {#4} no grouping
% {\setvalue{\@nc@\string#1}{\char`#1}%
% \ifnum\catcode`#1=\@@active \else
% \setevalue{\@nn@\string#1}{\number\catcode`#1}% new
% \fi
% \def\!!stringa{#3}%
% \ifx\!!stringa\empty
-% \setvalue{\@cc@\string#1\string#2}{{#4}}%
+% \setvalue{\@cc@\string#1\string#2}{#4}%
% \else
-% \setvalue{\@cs@\string#1\string#2\string#3}{{#4}}%
+% \setvalue{\@cs@\string#1\string#2\string#3}{#4}%
% \fi
% \catcode`#1=\@@active
% \scratchcounter=\the\uccode`~
@@ -971,7 +991,7 @@
% \uppercase{\unexpanded\def~{\handlecompoundcharacter~}}%
% \uccode`~=\scratchcounter}
-\def\installcompoundcharacter #1#2#3 #4% {{#4}} keeps move local
+\def\installcompoundcharacter #1#2#3 #4% {#4} no grouping
{\chardef\thecompoundcharacter`#1%
%\@EA\def\csname\@nc@\string#1\endcsname{\char`#1}%
\@EA\chardef\csname\@nc@\string#1\endcsname\thecompoundcharacter
@@ -984,7 +1004,7 @@
\@cc@\string#1\string#2%
\else
\@cs@\string#1\string#2\string#3%
- \fi\endcsname{{#4}}%
+ \fi\endcsname{#4}%
\catcode\thecompoundcharacter\@@active
\scratchcounter\uccode\activehackcode
\uccode\activehackcode\thecompoundcharacter
@@ -1187,7 +1207,7 @@
%D
%D The following macro is taken from plain \TEX.
-\def\nonbreakablespace{\penalty\!!tenthousand\ }
+\def\nonbreakablespace{\penalty\plustenthousand\ }
\let~\nonbreakablespace
@@ -1356,6 +1376,8 @@
\else
\prewordbreak\discretionary{}{##1{}{}}{##1{}{}}\prewordbreak
\fi}%
+ \def\splitanyway##1%
+ {\prewordbreak##1\prewordbreak}%
\def\flushurl%
{\savedurl\let\savedurl\empty}%
\def\\%
@@ -1429,7 +1451,13 @@
\def\scanurl#1%
{\advance\scratchcounter\plusone
- \ifx#1\~%
+ \ifx#1\blankspace
+ \flushurl\splitanyway\normalspace
+ \else\ifx#1\ %
+ \flushurl\splitanyway\normalspace
+ \else\ifx#1\space
+ \flushurl\splitanyway\normalspace
+ \else\ifx#1\~%
\flushurl\splitbefore\~%
\else\ifx#1\#%
\flushurl\splitbefore\#%
@@ -1447,27 +1475,27 @@
\flushurl\splitbefore\#%
\else\ifnum\catcode`#1=4
\flushurl\splitbefore\&%
- \else\if#1\lettertilde
+ \else\expandafter\if\string#1\lettertilde
\flushurl\splitbefore\~%
- \else\if#1\letterpercent
+ \else\expandafter\if\string#1\letterpercent
\flushurl\splitbefore\%%
- \else\if#1\letterunderscore
+ \else\expandafter\if\string#1\letterunderscore
\flushurl\splitbefore\_%
- \else\if#1\letterquestionmark
+ \else\expandafter\if\string#1\letterquestionmark
\flushurl\splitafter\letterquestionmark
- \else\if#1\letterat
+ \else\expandafter\if\string#1\letterat
\flushurl\splitafter\letterat
- \else\if#1\letterslash
+ \else\expandafter\if\string#1\letterslash
\edef\savedurl{\savedurl\letterslash}%
- \else\if#1+%
+ \else\expandafter\if\string#1+%
\flushurl\splitafter+%
- \else\if#1:%
+ \else\expandafter\if\string#1:%
\flushurl\splitafter:%
- \else\if#1.%
+ \else\expandafter\if\string#1.%
\flushurl\splitafter.%
- \else\if#1(%
+ \else\expandafter\if\string#1(%
\flushurl\splitbefore(%
- \else\if#1)%
+ \else\expandafter\if\string#1)%
\flushurl\splitafter)%
\else
\ifx\savedurl\empty\else
@@ -1475,15 +1503,15 @@
\let\savedurl\empty
\fi
\ifcase\urlhyphenmethod
- #1%
+ \string#1%
\else
\ifnum\scratchcounter>\plusthree % so, \http: will not break
- \edef\savedurl{#1}%
+ \edef\savedurl{\string#1}%
\else
- #1%
+ \string#1%
\fi
\fi
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
% \setupinteraction[state=start]
% \def\gotoURL#1{\useURL[foo][#1]\goto{\url[foo]}[url(foo)]}
@@ -1494,6 +1522,12 @@
% \hsize1pt\gotoURL{http://www.physik.fu-berlin.de/SomeVeryVeryVeryLongDirectory/And/AQuiteLongFileName.html}
% \stoptext
+% \useencoding[ffr]
+% \mainlanguage[fr]
+% \starttext
+% \hyphenatedurl{http://somewhere.to/go}
+% \stoptext
+
%D When Joop Susan asked (on the \CONTEXT\ mailing list) how
%D to handle url's passed as argument, the following solutions
%D came to my mind:
diff --git a/Master/texmf-dist/tex/context/base/supp-mat.tex b/Master/texmf-dist/tex/context/base/supp-mat.tex
index 15ae7fdd8d0..5b2305f8b5f 100644
--- a/Master/texmf-dist/tex/context/base/supp-mat.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mat.tex
@@ -45,21 +45,41 @@
%D
%D Which is implemented as:
-\def\mathematics#1{\relax\ifmmode#1\else$#1$\fi} % lookahead bug reported by brooks
+\long\def\mathematics#1{\relax\ifmmode#1\else $#1$\fi} % lookahead bug reported by brooks
+\long\def\displaymath#1{\relax\ifmmode#1\else$$#1$$\fi}
+\long\def\inlinemath #1{\relax\ifmmode#1\else $#1$\fi}
-\def\startmathmode
- {\ifmmode
+\let\stopmathmode\relax
+
+\def\startmathmode % cannot be used nested
+ {\relax\ifmmode
\let\stopmathmode\relax
\else
$\def\stopmathmode{$}% \let\stopmathmode=$
\fi}
+\def\startmathmode % nested variant
+ {\relax\ifmmode
+ \begingroup\let\stopmathmode\endgroup
+ \else
+ $\let\stopmathmode$%
+ \fi}
+
\def\nomathematics#1%
- {\ifmmode\hbox{#1}\else#1\fi}
+ {\relax\ifmmode\hbox{#1}\else#1\fi}
\let\math\mathematics
%D \macros
+%D {displaymathematics,inlinemathematics,automathematics}
+%D
+%D An example of usage of the following can be found in the MathML module:
+
+\long\def\displaymathematics#1{\relax\ifmmode#1\else\dostartformula{}#1\dostopformula\fi}
+ \let\inlinemathematics \mathematics
+ \def\automathematics {\relax\ifhmode\@EA\inlinemathematics\else\@EA\displaymathematics\fi}
+
+%D \macros
%D {dimension, nodimension}
%D
%D The next few macros are used for typesetting dimensions in
diff --git a/Master/texmf-dist/tex/context/base/supp-mis.tex b/Master/texmf-dist/tex/context/base/supp-mis.tex
index 51205dc1ef4..d2105e34cf7 100644
--- a/Master/texmf-dist/tex/context/base/supp-mis.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mis.tex
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D I will clean up this module (a la supp-pdf.tex preamble).
-
%D Some support modules are more or less independant. This
%D module, which is not part of plain \CONTEXT, provides the
%D missing macros and declarations of registers.
@@ -22,7 +20,23 @@
%D Because \LATEX\ has no safe package loading mechanism, we
%D need to take care of possible interference.
-\def\StartLatexHack % replace this by the one in supp-pdf
+% \def\StartLatexHack
+% {\edef\StopLatexHack
+% {\catcode`\noexpand/=\the\catcode`/
+% \catcode`\noexpand-=\the\catcode`-
+% \catcode`\noexpand:=\the\catcode`:
+% \catcode`\noexpand;=\the\catcode`;
+% \catcode`\noexpand"=\the\catcode`"
+% \catcode`\noexpand<=\the\catcode`<
+% \catcode`\noexpand>=\the\catcode`>}%
+% \catcode`/=12 \catcode`-=12
+% \catcode`:=12 \catcode`;=12
+% \catcode`"=12 \catcode`<=12 \catcode`>=12 }
+
+%D Adapted conform request from morten.hoegholm@latex-project.org,
+%D i.e. untested by me; using strings makes Babel more happy.
+
+\def\StartLatexHack
{\edef\StopLatexHack
{\catcode\string`\noexpand/=\the\catcode\string`/
\catcode\string`\noexpand-=\the\catcode\string`-
@@ -175,29 +189,20 @@
\newdimen\scratchdimen % 21
\fi
-\def\stripnewabove#1%
- {\ifnum10<9#1 #1\else\expandafter\stripnewabove\fi}%
-
-\def\newabove\csname#1\endcsname#2% \dimen \name
- {\csname#1\endcsname#2%
- \ifnum\expandafter\stripnewabove\meaning#2>20\else
- \newabove\csname#1\endcsname#2%
- \fi}
-
-\ifnocontextobject \scratchcounter \do \newabove \csname newcount\endcsname \scratchcounter \fi
-\ifnocontextobject \scratchtoks \do \newabove \csname newtoks\endcsname \scratchtoks \fi
-\ifnocontextobject \scratchdimen \do \newabove \csname newdimen\endcsname \scratchdimen \fi
-\ifnocontextobject \scratchskip \do \newabove \csname newskip\endcsname \scratchskip \fi
-\ifnocontextobject \scratchmuskip \do \newabove \csname newmuskip\endcsname \scratchmuskip \fi
-\ifnocontextobject \scratchbox \do \csname newbox\endcsname \scratchbox \fi
-\ifnocontextobject \scratchread \do \csname newread\endcsname \scratchread \fi
-\ifnocontextobject \scratchwrite \do \csname newwrite\endcsname \scratchwrite \fi
+\ifnocontextobject \scratchcounter \do \newcount \scratchcounter \fi
+\ifnocontextobject \scratchtoks \do \newtoks \scratchtoks \fi
+\ifnocontextobject \scratchdimen \do \newdimen \scratchdimen \fi
+\ifnocontextobject \scratchskip \do \newskip \scratchskip \fi
+\ifnocontextobject \scratchmuskip \do \newmuskip \scratchmuskip \fi
+\ifnocontextobject \scratchbox \do \newbox \scratchbox \fi
+\ifnocontextobject \scratchread \do \newread \scratchread \fi
+\ifnocontextobject \scratchwrite \do \newwrite \scratchwrite \fi
%D Watch out, in the past we ran into troubles with \type {\onepoint}
%D (and others) mening something different in \LATEX\ then here. In
%D such situations clashes are bound to happen. For this reason the
%D assignments are no inside the test. We try to catch those situations
-%D but we cannot keep ahead of the future.
+%D but we cannot keep ahead of teh future.
\ifnocontextobject \zeropoint \do \newdimen \zeropoint \zeropoint = 0pt \fi % else problems with dimen12
\ifnocontextobject \onepoint \do \newdimen \onepoint \onepoint = 1pt \fi
@@ -655,7 +660,7 @@
\def\dodohandletokens
{\ifx\next\end \else
- \docommand{\next}%
+ \docommando{\next}%
\expandafter\dohandletokens
\fi}
@@ -663,7 +668,7 @@
{\afterassignment\dodohandletokens\let\next= }
\long\def\handletokens#1\with#2%
- {\let\docommand=#2%
+ {\let\docommando=#2%
\dohandletokens#1\end}
\fi
diff --git a/Master/texmf-dist/tex/context/base/supp-mpe.tex b/Master/texmf-dist/tex/context/base/supp-mpe.tex
index f1d54f7533d..04ee0a81376 100644
--- a/Master/texmf-dist/tex/context/base/supp-mpe.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mpe.tex
@@ -38,11 +38,7 @@
%D \chardef\makeMPintoPDFobject\plusone
%D \stoptyping
-\ifx\writestatus\undefined
- \immediate\write16{[Loading MPS to PDF extensions.]}
-\else
- \writestatus{loading}{Context Support Macros / MPS extensions}
-\fi
+\writestatus{loading}{MetaPost Special Extensions}
%D We implement extensions by using the \METAPOST\ special
%D mechanism. Opposite to \TEX's specials, the \METAPOST\ ones
@@ -421,11 +417,6 @@
\ifnum\MPrgbnumber\lastMPgvalue>10 % really needed
\scratchcounter\MPrgbnumber\lastMPbvalue
\edef\currentMPspecial{\the\scratchcounter}%
-\let\previousMPcolorspec\currentMPcolorspec
-\edef\currentMPcolorspec{\lastMPrvalue\lastMPgvalue\lastMPbvalue}%
-\ifx\previousMPcolorspec\currentMPcolorspec \else
- \revokeMPtransparencyspecial
-\fi
\ifnum\finiMPpath=2 % to outer level
\the\invokeMPspecials
\fi
diff --git a/Master/texmf-dist/tex/context/base/supp-mps.tex b/Master/texmf-dist/tex/context/base/supp-mps.tex
index 23e6ccc89d9..17d26d631ca 100644
--- a/Master/texmf-dist/tex/context/base/supp-mps.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mps.tex
@@ -50,6 +50,8 @@
\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
+% todo : sort out ^^M, \par and ; mess
+
%D \macros
%D {startMPgraphic}
%D
@@ -196,24 +198,111 @@
%D passing them to \type{\MPinclusions}:
%D
%D \starttyping
+%D \startMPinclusions
+%D input mp-mine ;
+%D \stopMPinclusions
+%D \stoptyping
+%D
+%D \starttyping
%D \MPinclusions{input mp-mine}
%D \stoptyping
%D
+%D These commands reset their content each time. You can append
+%D code as follows:
+%D
+%D \starttyping
+%D \startMPinclusions[+]
+%D input mp-mine ;
+%D \stopMPinclusions
+%D \stoptyping
+%D
%D The token register \type {\MPinitializations} is expanded
%D before all other inclusions, the extensions are expanded
%D only once per run.
-\newtoks \MPinitializations % each graphic
+%D The next hack prevents too long lines:
+
+\long\def\runtimeobeyMPlines
+ {\ifx\rawcharacter\undefined
+ \let\obeyedline\space
+ \else
+ \obeylines
+ \ifx\systemendofline\undefined
+ \def\obeyedline{\rawcharacter{10}}%
+ \else
+ \let\obeyedline\systemendofline
+ \fi
+ \fi}
+
+\long\def\obeyMPlines % anyhow, we end up with ^^M's in the input
+ {\obeylines
+ \let\obeyedline\relax} % delay expansion
+
+\ifx\everydump\undefined
+ % maybe we're not using context
+\else
+ \appendtoks
+ \let\obeyMPlines\runtimeobeyMPlines
+ \to \everydump
+\fi
+
+%D We use two distinguished token registers:
+
\newtoks \MPextensions % once per run (can be multiple graphics)
+\newtoks \MPinitializations % each graphic
+
+\let\stopMPextensions \relax % so that we can use it in \expanded
+\let\stopMPinitializations\relax % so that we can use it in \expanded
+\let\stopMPinclusions \relax % so that we can use it in \expanded
+
+\def\startMPextensions % no text checking done here !
+ {\begingroup
+ \obeyMPlines
+ \dostartMPextensions}
+
+\def\dostartMPextensions#1\stopMPextensions
+ {\endgroup
+ \MPextensions\expandafter{\the\MPextensions#1}}
-\long\def\startMPinclusions#1\stopMPinclusions % document wide
- {\long\def\theMPinclusions
- {% \expanded !
- \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}% new
- \writeMPgraphic{#1}}}
+\def\startMPinitializations % no text checking done here !
+ {\begingroup
+ \obeyMPlines
+ \dostartMPinitializations}
-\long\def\MPinclusions#1%
- {\startMPinclusions#1\stopMPinclusions}
+\def\dostartMPinitializations#1\stopMPinitializations
+ {\endgroup
+ \MPinitializations\expandafter{\the\MPinitializations#1}}
+
+\def\startMPinclusions
+ {\begingroup
+ \dosingleempty\dostartMPinclusions}
+
+\long\def\dostartMPinclusions
+ {\obeyMPlines
+ \dodostartMPinclusions}
+
+\long\def\dodostartMPinclusions[#1]#2\stopMPinclusions % document wide
+ {\endgroup
+ \doifelse{#1}{+}
+ {\@EA\long\@EA\def\@EA\theMPinclusions\@EA
+ {\theMPinclusions
+ \writeMPgraphic{#2}}}
+ {\long\def\theMPinclusions
+ {% \expanded !
+% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}% new
+ \writeMPgraphic{#2}}}}
+
+\def\MPinclusions
+ {\dosingleempty\doMPinclusions}
+
+\long\def\doMPinclusions[#1]#2%
+ {\startMPinclusions[#1]#2\stopMPinclusions}
+
+\def\theMPextensions
+ {\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPextensions;}}}
+
+\def\theMPinitializations
+ {\@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}}
\startMPinclusions \stopMPinclusions
@@ -227,7 +316,7 @@
\newwrite\MPwrite
-\newif\iflongMPlines
+\newif\iflongMPlines \longMPlinestrue % we now have \obeyMPlines
\ifx \overlaywidth \undefined \def \overlaywidth {4cm} \fi
\ifx \overlayheight \undefined \def \overlayheight {3cm} \fi
@@ -327,7 +416,8 @@
\bgroup
\let\par\space
\iflongMPlines
- \immediate\write\MPwrite{#1;}%
+ %\immediate\write\MPwrite{#1;}% oeps, ; invalid
+ \immediate\write\MPwrite{#1}%
\else
\long\edef\ascii{#1}%
\expandafter\flushMPgraphicline\ascii\empty;\relax;%
@@ -394,16 +484,27 @@
% \the\MPTEXgraphicchecks\relax % \relax is end condition!
% \fi}
+% \long\def\writecheckedMPgraphic#1%
+% {\ifforceMPTEXgraphic
+% \global\MPTEXgraphictrue
+% \else
+% \global\MPTEXgraphicfalse
+% \expandafter\convertargument#1\to\MPascii
+% \the\MPTEXgraphicchecks\relax % \relax is end condition!
+% \fi
+% \flushMPTEXgraphic % verbatimtex etc
+% \writeMPgraphic{#1}}
+
\long\def\writecheckedMPgraphic#1%
{\ifforceMPTEXgraphic
\global\MPTEXgraphictrue
\else
\global\MPTEXgraphicfalse
- \expandafter\convertargument#1\to\MPascii
+ \edef\ascii{#1}\convertcommand\ascii\to\MPascii
\the\MPTEXgraphicchecks\relax % \relax is end condition!
\fi
\flushMPTEXgraphic % verbatimtex etc
- \writeMPgraphic{#1}}
+ \writeMPgraphic{#1}} % potential optimization: pass \ascii
%D We could have used a kind of array approach using a
%D counter appended to \type {MPascii}, but this is an
@@ -434,6 +535,18 @@
%D \stopMPcode
%D \stoptyping
+%D A goodie for Mojca (the gnuplot wizzard):
+%D
+%D \starttyping
+%D \startMPcode
+%D draw fullcircle scaled 4cm ;
+%D draw \textext{$\sqrt{\frac{3}{2}^3}$} ;
+%D \stopMPcode
+%D \stoptyping
+
+\long\def\textext#1{\normalunexpanded{textext("#1")}} % or \detokenize
+
+
\def\flushMPTEXgraphic
{\ifMPTEXgraphic
\immediate\write\MPwrite{verbatimtex \the\everyMPTEXgraphic\space etex;}%
@@ -536,6 +649,17 @@
\let \} \letterclosebrace
\to \everyMPgraphic
+%D Not the best place but we need to make sure that no funny
+%D active characters creep in. Some day we will move this code.
+
+\ifx\disablediscretionaries\undefined
+ \let\disablediscretionaries\relax
+\fi
+
+\appendtoks
+ \disablediscretionaries
+\to \everyMPgraphic
+
\def\writeMPgraph
{\immediate\write\MPwrite{mpgraph:=\the\currentMPgraphic;}}
@@ -546,64 +670,6 @@
\fi
\endTEX
-% buggy (at least in collected graphics, lazy expansion)
-%
-% \def\startwritingMPgraphic
-% {\blabelgroup
-% \global\advance\nofMPgraphics 1
-% \ifMPrun \else
-% \allocateMPslot\currentMPgraphic
-% \fi
-% \enableincludeMPgraphics
-% \xdef\MPgraphic{\the\currentMPgraphic}%
-% \the\everyMPgraphic
-% \ifrunMPgraphics
-% \openMPgraphicfile1{runtime}%
-% % no reset here !
-% \theMPinclusions
-% \else
-% \openMPgraphicfile0{collected}%
-% % reset here ! global added (due to adding \blabelgroup)
-% \theMPinclusions
-% \global\let\theMPinclusions\relax
-% \fi
-% \flushMPTEXgraphic
-% \ifMPrun \else
-% \immediate\write\MPwrite{let mprunend = end ;}%
-% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}%
-% \fi
-% \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic
-% \globallet\stopwritingMPgraphic=\dostopwritingMPgraphic}
-
-% \def\startwritingMPgraphic
-% {\blabelgroup
-% \global\advance\nofMPgraphics 1
-% \ifMPrun \else
-% \allocateMPslot\currentMPgraphic
-% \fi
-% \enableincludeMPgraphics
-% \xdef\MPgraphic{\the\currentMPgraphic}%
-% \the\everyMPgraphic
-% \ifrunMPgraphics
-% \openMPgraphicfile1{runtime}%
-% % no reset here !
-% \theMPinclusions
-% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}%
-% \else
-% \openMPgraphicfile0{collected}%
-% % reset here ! global added (due to adding \blabelgroup)
-% \theMPinclusions
-% \global\let\theMPinclusions\relax
-% \fi
-% \flushMPTEXgraphic
-% \ifMPrun \else
-% \immediate\write\MPwrite{let mprunend = end ;}%
-% \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}%
-% \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}%
-% \fi
-% \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic
-% \globallet\stopwritingMPgraphic=\dostopwritingMPgraphic}
-
\def\startwritingMPgraphic
{\blabelgroup
@@ -618,21 +684,26 @@
\ifrunMPgraphics
\openMPgraphicfile1{runtime}%
% no reset here !
+ \theMPextensions
\theMPinclusions
- \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}%
+% \theMPinitializations
\else
\openMPgraphicfile0{collected}%
% reset here ! global added (due to adding \blabelgroup)
+ \theMPextensions
\theMPinclusions
+ \global\let\theMPextensions\relax
\global\let\theMPinclusions\relax
\fi
- %\flushMPTEXgraphic
- \ifMPrun \else
+ \theMPinitializations % always
+ \ifMPrun
+% \theMPinitializations
+ \else
\immediate\write\MPwrite{let mprunend = end ;}%
\immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}%
- \ifrunMPgraphics \else
- \@EA\expanded\@EA{\@EA\writeMPgraphic\@EA{\the\MPinitializations;}}%
- \fi
+% \ifrunMPgraphics \else
+% \theMPinitializations
+% \fi
\fi
\globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic
\globallet\stopwritingMPgraphic\dostopwritingMPgraphic}
@@ -656,7 +727,7 @@
\fi
\@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname
\ifdone
- \immediate\openout\MPwrite=\MPgraphicfile.mp
+ \immediate\openout\MPwrite\MPgraphicfile.mp\relax
\ifx\MPinputtranslation\empty\else
\immediate\write\MPwrite{\MPinputtranslation}%
\immediate\write\MPwrite{verbatimtex \MPinputtranslation etex ;}%
@@ -852,6 +923,18 @@
\newcount\MPobjectcounter
+% \def\douseMPbox#1%
+% {\global\advance\MPobjectcounter\plusone
+% \setobject{MP}{\number\MPobjectcounter}\vbox
+% {\forgetall
+% \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
+% \deallocateMPslot\currentMPgraphic
+% \placeMPgraphic}%
+% \setxvalue{#1}{\noexpand\getobject{MP}{\number\MPobjectcounter}}}
+%
+% The next one saves the boundingbox. This helps positioning reused
+% graphics in layers.
+
\def\douseMPbox#1%
{\global\advance\MPobjectcounter\plusone
\setobject{MP}{\number\MPobjectcounter}\vbox
@@ -859,7 +942,15 @@
\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
\deallocateMPslot\currentMPgraphic
\placeMPgraphic}%
- \setxvalue{#1}{\noexpand\getobject{MP}{\number\MPobjectcounter}}}
+ \setxvalue{#1}%
+ {\noexpand\dodouseMPbox{\number\MPobjectcounter}{\MPllx}{\MPlly}{\MPurx}{\MPury}}}
+
+\def\dodouseMPbox#1#2#3#4#5% space delimiting would save some tokens
+ {\xdef\MPllx{#2}% but it's not worth the effort and looks
+ \xdef\MPlly{#3}% ugly as well
+ \xdef\MPurx{#4}%
+ \xdef\MPury{#5}%
+ \getobject{MP}{#1}}
\def\nouseMPbox#1%
{\setxvalue{#1}%
@@ -899,6 +990,8 @@
\getvalue{\@@MPG#1}%
\elabelgroup}
+\let\stopreusableMPgraphic \relax % so that we can use it in \expanded
+
%D \macros
%D {startuseMPgraphic,useMPgraphic}
%D
@@ -922,18 +1015,29 @@
\deallocateMPslot\currentMPgraphic
\egroup}
-\long\def\startuseMPgraphic#1#2\stopuseMPgraphic
+\long\def\startuseMPgraphic
{\blabelgroup
- \long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}%
+ \obeyMPlines
+ \dostartuseMPgraphic}
+
+\long\def\dostartuseMPgraphic#1#2\stopuseMPgraphic
+ {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}%
\elabelgroup}
-\long\def\startusableMPgraphic#1#2\stopusableMPgraphic % dummy
+\long\def\startusableMPgraphic
{\blabelgroup
- \long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}%
+ \obeyMPlines
+ \dostartusableMPgraphic}
+
+\long\def\dostartusableMPgraphic#1#2\stopusableMPgraphic
+ {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}%
\elabelgroup}
\let\useMPgraphic=\reuseMPgraphic
+\let\stopuseMPgraphic \relax % so that we can use it in \expanded
+\let\stopusableMPgraphic \relax % so that we can use it in \expanded
+
%D \macros
%D {doifMPgraphicelse}
%D
@@ -1014,22 +1118,24 @@
\def\executesystemcommand#1{\immediate\write18{#1}}
\fi
+\ifx\TEXEXECcommand \undefined \def\TEXEXECcommand{texmfstart texexec} \fi
+
\ifx\undefined\executeMetaPost
\ifx\undefined\interactionmode \chardef\interactionmode=255 \fi
\def\MPOSTbatchswitch {-int=batchmode}
\def\MPOSTnonstopswitch {-int=nonstopmode}
- \def\MPOSTformatswitch {-progname=mpost -mem=}
+ \def\MPOSTformatswitch {-progname=metafun -mem=}
\def\MPOSTdriver {dvips}
- \def\executeMPOST#1%
+ \def\executeMPOST#1% direct call
{mpost
\ifcase\interactionmode\MPOSTbatchswitch\or\MPOSTnonstopswitch\fi
\space\ifuseMETAFUNformat \MPOSTformatswitch metafun \fi #1}
- \def\executeMPTEX#1%
- {texexec
+ \def\executeMPTEX#1% slower, due to nested texexec call
+ {\TEXEXECcommand\space
--batch \ifcase\interactionmode --logfile='mptex.log' \fi
--output=\MPOSTdriver\space
\ifuseMETAFUNformat --mpformat=metafun \fi --mptex --nomp --once #1}
@@ -1156,7 +1262,7 @@
\bgroup
\message{[MP fonts #1]}%
%\uncatcodespecials
- \endlinechar=-1
+ \endlinechar\minusone
\setMPspecials
\obeyMPspecials
\setbox\scratchbox\hbox
@@ -1406,18 +1512,18 @@
\endlinechar\minusone
\uncatcodespecials
\donefalse
- \immediate\openout\scratchwrite=\convertMPcolorpath\convertMPcolorfile
+ \immediate\openout\scratchwrite\convertMPcolorpath\convertMPcolorfile\relax
\doprocessfile\scratchread{#1}\handleMPcolor
\immediate\closeout\scratchwrite
\ifdone
- \immediate\openout\scratchwrite=\convertMPcolorpath#1\relax
+ \immediate\openout\scratchwrite\convertMPcolorpath#1\relax
\doprocessfile\scratchread{\convertMPcolorpath \convertMPcolorfile}\handleMPcopy
\immediate\closeout\scratchwrite
\message{done]}%
\else
\message{not needed]}%
\fi
- \immediate\openout\scratchwrite=\convertMPcolorpath\convertMPcolorfile
+ \immediate\openout\scratchwrite\convertMPcolorpath\convertMPcolorfile
\immediate\closeout\scratchwrite
\fi
\egroup}
@@ -1640,7 +1746,7 @@
\def\getMPdrawing
{\ifMPdrawingdone
\expandafter\startMPgraphic\MPdrawingdata\stopMPgraphic
- \loadcurrentMPgraphic\empty
+ \loadcurrentMPgraphic{}%
\deallocateMPslot\currentMPgraphic
\placeMPgraphic
\fi}
@@ -1858,7 +1964,57 @@
%D
%D this automatically places the graphic
-\long\def\startMPcode#1\stopMPcode
- {\startuseMPgraphic{@@}#1\stopuseMPgraphic\useMPgraphic{@@}}
+\long\def\startMPcode
+ {\begingroup
+ \obeyMPlines
+ \dostartMPcode}
+
+\long\def\dostartMPcode#1\stopMPcode
+ {\startuseMPgraphic{@@}#1\stopuseMPgraphic
+ \useMPgraphic{@@}%
+ \endgroup}
+
+\let\stopMPcode \relax % so that we can use it in \expanded
+
+%D \macros
+%D {startstaticMPgraphic}
+%D
+%D Dedicated to Aditya Mahajan. See meta-ini for usage.
+
+\long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic
+ {\bgroup
+ \setMPrandomseedfalse
+ \def\MPgraphicfile{#1}% no \jobname here
+ \let\allocateMPslot \gobbleoneargument
+ \let\deallocateMPslot\gobbleoneargument
+ \let\runMPgraphic \gobbleoneargument
+ \runMPgraphicstrue
+ \enableincludeMPgraphics
+ \currentMPgraphic\plusone % hack, else no close
+ \startMPgraphic#2\stopMPgraphic
+ \executeMPgraphicfile
+ \egroup}
+
+
+\ifx\doifmode\undefined
+ \def\executeMPgraphicfile
+ {\executesystemcommand
+ {texmfstart --ifchanged=\MPgraphicfile.mp
+ texexec --mpgraphic \MPgraphicfile.mp}}
+\else
+ \def\executeMPgraphicfile
+ {\doifmode{*\v!first}{\executesystemcommand
+ {texmfstart --ifchanged=\MPgraphicfile.mp
+ texexec --mpgraphic \MPgraphicfile.mp}}}
+\fi
+
+%D Special for \XETEX\ (problem with newlines). This will go
+%D away once the version supporting \type {--8bit} is
+%D widespread.
+
+\beginXETEX
+ \let\obeyMPlines\relax
+ \longMPlinesfalse % alas
+\endXETEX
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-mrk.tex b/Master/texmf-dist/tex/context/base/supp-mrk.tex
index 0cab213c489..eb03b5251f0 100644
--- a/Master/texmf-dist/tex/context/base/supp-mrk.tex
+++ b/Master/texmf-dist/tex/context/base/supp-mrk.tex
@@ -411,9 +411,11 @@
\normalmarks#1{#2}}
\def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark
- {\scratchtoks{#2}%
+ {\begingroup % don't ask why, but grouping is needed
+ \scratchtoks{#2}% in order to to mess up scratchtoks
\@EA\xdef\csname\@@crk\string#1\endcsname{\the\scratchtoks}%
- \normalmarks#1{\the\scratchtoks}} % one level expansion
+ \normalmarks#1{\the\scratchtoks}% one level expansion
+ \endgroup}
\def\checktopmark#1%
{%\writestatus{marks}{checking \string#1}\wait
diff --git a/Master/texmf-dist/tex/context/base/supp-pdf.tex b/Master/texmf-dist/tex/context/base/supp-pdf.tex
index 5197e564d7f..656a8f6fbce 100644
--- a/Master/texmf-dist/tex/context/base/supp-pdf.tex
+++ b/Master/texmf-dist/tex/context/base/supp-pdf.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=supp-pdf,
-%D version=2006.09.02, % 2004.12.16,
+%D version=2004.12.16,
%D title=\CONTEXT\ Support Macros,
%D subtitle=\METAPOST\ to \PDF\ conversion,
%D author=Hans Hagen \& others (see text),
@@ -11,142 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\ifx\writestatus\undefined
- \immediate\write16{[Loading MPS to PDF converter (version 2006.09.02).]}
-\else
- \writestatus{loading}{Context Support Macros / PDF}
-\fi
-
-%D This module is not optimized because it is used outside
-%D \CONTEXT\ and we cannot forsee what interference will take
-%D place. We no longer load supp-mis. I got too tired of
-%D keeping track of interferences with non \CONTEXT\ usage so
-%D I moved the necessary code in here and use a derived version
-%D in \CONTEXT. When I have the time I will clean up some of the
-%D code that is of no use for non||\CONTEXT\ users.
-
-\ifx\contextversion\undefined
-
- \chardef\mptopdfstoredatcode\catcode`\@
-
- \catcode\string`@=11
-
- \def\unprotect
- {\let\@@mpstopdf@@unprotect \unprotect
- \let\@@mpstopdf@@protect \protect
- \edef\protect
- {\noexpand \let \noexpand \protect \noexpand \@@mpstopdf@@protect
- \noexpand \let \noexpand \unprotect \noexpand \@@mpstopdf@@unprotect
- % context specific
- \catcode\string`\noexpand @=\the\catcode\string`@
- \catcode\string`\noexpand !=\the\catcode\string`!
- \catcode\string`\noexpand ?=\the\catcode\string`?
- % latex specific
- \catcode\string`\noexpand /=\the\catcode\string`/
- \catcode\string`\noexpand -=\the\catcode\string`-
- \catcode\string`\noexpand :=\the\catcode\string`:
- \catcode\string`\noexpand ;=\the\catcode\string`;
- \catcode\string`\noexpand "=\the\catcode\string`"
- \catcode\string`\noexpand <=\the\catcode\string`<
- \catcode\string`\noexpand >=\the\catcode\string`>
- \catcode\string`\noexpand `=\the\catcode\string``}
- \catcode\string`@=11 \catcode\string`!=11 \catcode\string`?=11
- \catcode\string`/=12 \catcode\string`-=12
- \catcode\string`:=12 \catcode\string`;=12
- \catcode\string`>=12 \catcode\string`<=12
- \catcode\string`"=12 \catcode\string``=12 }
-
- \def\defineMPtoPDFfallbacks
- {% shortcuts
- \chardef\@@escape 0
- \chardef\@@begingroup 1
- \chardef\@@endgroup 2
- \chardef\@@endofline 5
- \chardef\@@ignore 9
- \chardef\@@space 10
- \chardef\@@letter 11
- \chardef\@@other 12
- \chardef\@@active 13
- \chardef\@@comment 14
- % placeholders
- \ifx\withoutpt \undefined \let\withoutpt \@@mptopdf@@withoutpt \fi
- \ifx\twodigitrounding \undefined \let\twodigitrounding \@@mptopdf@@twodigitrounding \fi
- \ifx\forgetall \undefined \let\forgetall \@@mptopdf@@forgetall \fi
- \ifx\uncatcodespecials \undefined \let\uncatcodespecials \@@mptopdf@@uncatcodespecials \fi
- \ifx\setnaturalcatcodes\undefined \let\setnaturalcatcodes\@@mptopdf@@setnaturalcatcodes \fi
- \ifx\dospecials \undefined \let\dospecials \@@mptopdf@@dospecials \fi}
-
- \def\@@mptopdf@@forgetall
- {\parskip0pt\leftskip0pt\parindent0pt\everypar{}}
-
- \def\@@mptopdf@@twodigitrounding#1%
- {#1}%
-
- \def\@@mptopdf@@uncatcodespecials
- {\def\do##1{\catcode`##1=\@@other}\dospecials
- \catcode`\ =\@@space
- \catcode`\^^L=\@@ignore
- \catcode`\^^M=\@@endofline
- \catcode`\^^?=\@@ignore}
-
- \def\@@mptopdf@@setnaturalcatcodes
- {\catcode`\!=\@@other \catcode`\?=\@@other \catcode`\@=\@@other
- \catcode`\#=\@@other \catcode`\&=\@@other \catcode`\|=\@@other
- \catcode`\$=\@@other \catcode`\^=\@@other \catcode`\_=\@@other
- \catcode`\*=\@@other \catcode`\/=\@@other
- \catcode`\-=\@@other \catcode`+=\@@other
- \catcode`\==\@@other \catcode`\<=\@@other \catcode`\>=\@@other
- \catcode`\"=\@@other \catcode`\'=\@@other \catcode`\`=\@@other
- \catcode`\:=\@@other \catcode`\;=\@@other
- \catcode`\,=\@@other \catcode`\.=\@@other \catcode`\~=\@@other
- \catcode`\(=\@@other \catcode`\)=\@@other
- \catcode`\{=\@@other \catcode`\}=\@@other
- \catcode`\\=\@@other \catcode`\%=\@@other}
-
- \def\@@mptopdf@@dospecials
- {\do\ \do\\\do\{\do\}\do\$%
- \do\#\do\^\do\_\do\&\do\%%
- \do\~\do\^^A\do\^^K}
-
- {
- \catcode`\.=12
- \catcode`\p=12
- \catcode`\t=12
- \gdef\@@MPTOPDF@@WITHOUTPT#1pt{#1}
- }
-
- \def\@@mptopdf@@withoutpt#1%
- {\expandafter\@@MPTOPDF@@WITHOUTPT#1}
-
-% \def\@@mptopdf@@newabove#1#2% \dimen \name
-% {#1#2%
-% \ifnum\expandafter\gobblesixarguments\meaning#2>20\else
-% \expandafter\@@mptopdf@@newabove\expandafter#1\expandafter#2%
-% \fi}
-
- \def\@@mptopdf@@stripnewabove#1%
- {\ifnum10<9#1 #1\else\expandafter\@@mptopdf@@stripnewabove\fi}%
-
- \def\@@mptopdf@@newabove\csname#1\endcsname#2% \dimen \name
- {\csname#1\endcsname#2%
- \ifnum\expandafter\@@mptopdf@@stripnewabove\meaning#2>20\else
- \@@mptopdf@@newabove\csname#1\endcsname#2%
- \fi}
-
- \@@mptopdf@@newabove \csname newcount\endcsname \scratchcounter
- \@@mptopdf@@newabove \csname newdimen\endcsname \scratchdimen
- \csname newbox\endcsname \scratchbox
-
- \expandafter \newif \csname ifdone\endcsname
-
- \catcode`\@=\mptopdfstoredatcode
-
-\else
-
- \let\defineMPtoPDFfallbacks\relax
-
-\fi
-
%D These macros are written as generic as possible. Some
%D general support macro's are loaded from a small module
%D especially made for non \CONTEXT\ use. In this module I
@@ -161,10 +25,23 @@
%D his initials. (We keep the old code around because it's a
%D nice illustration on how a module like this evolves.)
-%D Beware, we cannot use \zeropoint here since it may be
-%D defined in the range \dimen 0 - 20 which we happen to use
-%D as scratch registers; inside context we may consider
-%D using dedicated registers.
+% Beware, we cannot use \zeropoint here since it may be
+% defined in the range \dimen 0 - 20 which we happen to use
+% as scratch registers; inside context we may consider
+% using dedicated registers.
+
+% fails: ( ) vect10 9.96265 fshow % \040\040\040\040
+%
+% some optimizations are possible, but we need to be generic
+
+%D First we take care of non||\CONTEXT\ use (newlines needed,
+%D expandafter not -).
+
+\ifx \undefined \writestatus \input supp-mis.tex \relax \fi
+
+\ifx \undefined \convertMPtoPDF \else \expandafter \endinput \fi
+
+\ifx \undefined \StartLatexHack \else \StartLatexHack \fi
%D This module handles some \PDF\ conversion and insertions
%D topics. By default, the macros use the \PDFTEX\ primitive
@@ -172,6 +49,8 @@
%D default engine for \TEX\ distributions, we need a more complex
%D test.
+\writestatus{loading}{Context Support Macros / PDF (2004.03.26)}
+
\unprotect
\ifx\PDFcode\undefined
@@ -190,7 +69,7 @@
%D First we define a handy constant:
-\bgroup \defineMPtoPDFfallbacks \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
+\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
%D \macros
%D {pdfimage,pdfimages,pdfclippedimage}
@@ -215,6 +94,12 @@
%D \pdfclippedimage <optional dimensions> {file} {l} {r} {t} {b}
%D \stoptyping
+% \ifx\pdftexversion\undefined % no \m!systems for the sake of latex
+% \writestatus{systems}{Why not use pdf(e)TeX binaries?}
+% \protect
+% \expandafter\endinput
+% \fi
+
\ifx\pdftexversion\undefined \else \ifnum\pdftexversion>13
\def\pdfimage#1#%
@@ -229,8 +114,11 @@
\def\dopdfimages#1#2#3%
{\immediate\pdfximage#1{#2}%
- \immediate\pdfobj{[ << /Image \the\pdflastximage\space0 R /DefaultForPrinting true >> ]}%
- \immediate\pdfximage#1 attr {/Alternates \the\pdflastobj\space0 R}{#3}%
+ \immediate\pdfobj
+ {[ << /Image \the\pdflastximage\space0 R
+ /DefaultForPrinting true >> ]}%
+ \immediate\pdfximage#1
+ attr {/Alternates \the\pdflastobj\space0 R}{#3}%
\pdfrefximage\pdflastximage}
\def\pdfclippedimage#1#% specs {file}{left}{right}{top}{bottom}
@@ -277,12 +165,218 @@
\fi \fi
+%D \macros
+%D {convertPDFtoPDF}
+%D
+%D \PDFTEX\ supports verbatim inclusion of \PDF\ code. The
+%D following macro takes care of inserting externally defined
+%D illustrations in \PDF\ format. According to a suggestion
+%D Tanmoy Bhattacharya posted to the \PDFTEX\ mailing list, we
+%D first skip lines until \type{stream} is reached and then
+%D copy lines until \type{endstream} is encountered. This
+%D scheme only works with vectorized graphics in which no
+%D indirect references to objects are used. Bitmaps also don't
+%D work. Interpreting their specifications is beyond the
+%D current implementation.
+%D
+%D \starttyping
+%D \convertPDFtoPDF
+%D {filename}
+%D {x scale} {y scale}
+%D {x offset } {y offset}
+%D {width} {height}
+%D \stoptyping
+%D
+%D When the scales are set to~1, the last last four values
+%D are the same as the bounding box, e.g.
+%D
+%D \starttyping
+%D \convertPDFtoPDF{mp-pra-1.pdf} {1} {1}{-1bp}{-1bp}{398bp}{398bp}
+%D \convertPDFtoPDF{mp-pra-1.pdf}{.5}{.5} {0bp} {0bp}{199bp}{199bp}
+%D \stoptyping
+%D
+%D Keep in mind, that this kind of copying only works for
+%D pure and valid pdf code (without fonts).
+
+%D The scanning and copying is straightforward and quite fast.
+%D To speed up things we use two constants.
+
+\def\@@PDFstream@@ {stream}
+\def\@@PDFendstream@@ {endstream}
+
+%D \macros
+%D {PDFmediaboxprefered}
+%D
+%D If needed, the macros can scan for the mediabox that
+%D specifies the dimensions and offsets of the graphic. When
+%D we say:
+%D
+%D \starttyping
+%D \PDFmediaboxpreferedtrue
+%D \stoptyping
+%D
+%D the mediabox present in the file superseded the user
+%D specified, already scaled and calculated offset and
+%D dimensions. Beware: the user supplied values are not the
+%D bounding box ones!
+
+%D This code has become obsolete.
+
+% \newif\ifPDFmediaboxprefered
+
+\def\setPDFboundingbox#1#2#3#4#5#6%
+ {\dimen0=#1\dimen0=#5\dimen0
+ \ScaledPointsToBigPoints{\number\dimen0}\PDFxoffset
+ \dimen0=#3\dimen0=#5\dimen0
+ \xdef\PDFwidth{\the\dimen0}%
+ \dimen0=#2\dimen0=#6\dimen0
+ \ScaledPointsToBigPoints{\number\dimen0}\PDFyoffset
+ \dimen0=#4\dimen0=#6\dimen0
+ \xdef\PDFheight{\the\dimen0}%
+ \global\let\PDFxoffset\PDFxoffset
+ \global\let\PDFyoffset\PDFyoffset}
+
+\def\setPDFmediabox#1[#2 #3 #4 #5]#6\done
+ {\dimen2=#2bp\dimen2=-\dimen2 % \dimen2=-#2bp also works since tex handles --
+ \dimen4=#3bp\dimen4=-\dimen4 % \dimen4=-#3bp also works since tex handles --
+ \dimen6=#4bp\advance\dimen6 \dimen2
+ \dimen8=#5bp\advance\dimen8 \dimen4
+ \setPDFboundingbox{\dimen2}{\dimen4}{\dimen6}{\dimen8}\PDFxscale\PDFyscale}
+
+% \def\checkPDFmediabox#1/MediaBox#2#3\done
+% {\ifx#2\relax \else
+% \message{mediabox}%
+% \setPDFmediabox#2#3\done
+% \fi}
+
+%D We use the general macro \type{\doprocessfile} and feed this
+%D with a line handling macro that changes it's behavior when
+%D the stream operators are encountered.
+
+% \def\handlePDFline
+% {\ifx\@@PDFstream@@\fileline
+% \let\doprocessPDFline\copyPDFobject
+% \startPDFtoPDF
+% \else\ifPDFmediaboxprefered
+% \expandafter\checkPDFmediabox\fileline/MediaBox\relax\done
+% \fi\fi}
+
+% \def\copyPDFobject
+% {\ifx\@@PDFendstream@@\fileline
+% \ifPDFmediaboxprefered
+% \let\doprocessPDFline\findPDFmediabox
+% \else
+% \let\doprocessPDFline\relax
+% \fi
+% \else
+% \advance\scratchcounter 1
+% \PDFcode{\fileline}%
+% \fi}
+
+% \def\findPDFmediabox
+% {\expandafter\checkPDFmediabox\fileline/MediaBox\relax\done}
+
%D The main conversion macro wraps the \PDF\ codes in a box
%D that is output as an object. The graphics are embedded
%D in~\type{q} and~\type{Q} and are scaled and positioned using
%D one transform call (\type{cm}). This saves some additional
%D scaling.
+%D \starttyping
+%D \def\startPDFtoPDF%
+%D {\setbox0=\vbox\bgroup
+%D \message{[PDF to PDF \PDFfilename}%
+%D \forgetall
+%D \scratchcounter=0
+%D \let\stopPDFtoPDF=\dostopPDFtoPDF}
+%D
+%D \def\dostopPDFtoPDF%
+%D {\ifnum\scratchcounter<0 \scratchcounter=1 \fi
+%D \message{(\the\scratchcounter\space lines)]}%
+%D \egroup
+%D \wd0=\PDFwidth
+%D \vbox to \PDFheight
+%D {\forgetall
+%D \vfill
+%D \PDFcode{q}%
+%D \PDFcode{1 0 0 1 \PDFxoffset\space \PDFyoffset\space cm}%
+%D \PDFcode{\PDFxscale\space 0 0 \PDFyscale\space 0 0 cm}%
+%D \box0
+%D \PDFcode{Q}}}
+%D
+%D \def\stopPDFtoPDF%
+%D {\message{[PDF to PDF \PDFfilename\space not found]}}
+%D
+%D \def\convertPDFtoPDF#1#2#3#4#5#6#7%
+%D {\bgroup
+%D \def\PDFfilename{#1}%
+%D \def\PDFxscale {#2}%
+%D \def\PDFyscale {#3}%
+%D \setPDFboundingbox{#4}{#5}{#6}{#7}{1}{1}%
+%D \uncatcodespecials
+%D \endlinechar=-1
+%D \let\doprocessPDFline=\handlePDFline
+%D \doprocessfile\scratchread\PDFfilename\doprocessPDFline
+%D \stopPDFtoPDF
+%D \egroup}
+
+\def\convertPDFtoPDF#1#2#3#4#5#6#7%
+ {\message{[PDF to PDF use \string\PDFcode instead]}%
+ \vbox{use the direct method instead}}
+
+%D \macros
+%D {dogetPDFmediabox}
+%D
+%D The next macro can be used to find the mediabox of a \PDF\
+%D illustration.
+%D
+%D \starttyping
+%D \dogetPDFmediabox
+%D {filename}
+%D {new dimen}{new dimen}{new dimen}{new dimen}
+%D \stoptyping
+%D
+%D Beware of dimen clashes: this macro uses the 5~default
+%D scratch registers! When no file or mediabox is found, the
+%D dimensions are zeroed.
+
+\def\dogetPDFmediabox#1#2#3#4#5%
+ {\bgroup
+ \def\PDFxscale{1}%
+ \def\PDFyscale{1}%
+ \uncatcodespecials
+ \endlinechar\minusone
+ \def\checkPDFtypepage##1/Type /Page##2##3\done%
+ {\ifx##2\relax
+ \else\if##2s% accept /Page and /Pages
+ \let\doprocessPDFline\findPDFmediabox
+ \else
+ \let\doprocessPDFline\findPDFmediabox
+ \fi\fi}%
+ \def\findPDFtypepage
+ {\expandafter\checkPDFtypepage\fileline/Type /Page\relax\done}%
+ \def\checkPDFmediabox##1/MediaBox##2##3\done%
+ {\ifx##2\relax \else
+ \setPDFmediabox##2##3\done
+ \fileprocessedtrue
+ \fi}%
+ \def\findPDFmediabox
+ {\expandafter\checkPDFmediabox\fileline/MediaBox\relax\done}%
+ \let\doprocessPDFline\findPDFtypepage
+ \doprocessfile\scratchread{#1}\doprocessPDFline
+ \egroup
+ \ifx\PDFxoffset\undefined
+ #2\zeropoint
+ #3\zeropoint
+ #4\zeropoint
+ #5\zeropoint
+ \else
+ #2=\PDFxoffset\onebasepoint
+ #3=\PDFyoffset\onebasepoint
+ #4=\PDFwidth
+ #5=\PDFheight
+ \fi}
+
%D \macros
%D {convertMPtoPDF}
%D
@@ -411,17 +505,17 @@
\def\@@MP{@@MP}
\def\setMPargument% #1%
- {\advance\nofMParguments 1
+ {\advance\nofMParguments \plusone
\expandafter\def
\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname} % {#1}
\def\letMPargument
- {\advance\nofMParguments 1
+ {\advance\nofMParguments \plusone
\expandafter\let
\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname}
\def\setMPsequence#1 %
- {\advance\nofMParguments 1
+ {\advance\nofMParguments \plusone
\expandafter\def
\csname\@@MP\the\nofMPsegments\the\nofMParguments\endcsname{#1}%
\handleMPsequence}
@@ -433,12 +527,12 @@
{\csname\@@MP\the\nofMPsegments\number#1\endcsname}
\def\dogMPa#1%
- {\expandafter\expandafter\expandafter\do\csname\@@MP0\number#1\endcsname}
+ {\@EAEAEA\do\csname\@@MP0\number#1\endcsname}
\def\setMPkeyword#1 %
{\expandafter\def\csname\@@MP\the\nofMPsegments0\endcsname{#1}%
- \advance\nofMPsegments 1
- \nofMParguments0}
+ \advance\nofMPsegments \plusone
+ \nofMParguments\zerocount}
\def\getMPkeyword% #1%
{\csname\@@MP\the\nofMPsegments0\endcsname} % {\csname\@@MP#10\endcsname}
@@ -455,7 +549,7 @@
%D when dealing with comments.
\def\doresetMPstack
- {\nofMParguments0}
+ {\nofMParguments\zerocount}
\def\resetMPstack
{\let\handleMPgraphic\handleMPendgraphic
@@ -503,7 +597,6 @@
%D when needed we either ignore or obey them
\bgroup
-\defineMPtoPDFfallbacks
\catcode`\|=\@@comment
\catcode`\%=\@@active
\catcode`\[=\@@active
@@ -560,7 +653,6 @@
%D that we cannot change the catcodes in between.
\bgroup
-\defineMPtoPDFfallbacks
\catcode`\%=\@@active
\gdef\startMPscanning{\let%=\startMPconversion}
\egroup
@@ -588,15 +680,17 @@
%D speed up the conversion by handling the \type{path}
%D seperately.
+\def\@EAEAEA{\expandafter\expandafter\expandafter} % to be sure
+
\def\dohandleMPsequence#1%
{\ifdone
\ifcase\lccode`#1\relax
- \expandafter\expandafter\expandafter\dohandleMPsequenceA
+ \@EAEAEA\dohandleMPsequenceA
\else
- \expandafter\expandafter\expandafter\dohandleMPsequenceB
+ \@EAEAEA\dohandleMPsequenceB
\fi
\else
- \expandafter\dohandleMPsequenceC
+ \@EA\dohandleMPsequenceC
\fi#1}
%\def\dohandleMPsequenceA#1 %
@@ -756,20 +850,20 @@
{\ifnum#1>\currentMPboundingbox
\xdef\MPllx{#2}\xdef\MPlly{#3}%
\xdef\MPurx{#4}\xdef\MPury{#5}%
- \dimen0=#2pt
+ \dimen0=#2\onepoint
\dimen0=-\MPxscale\dimen0
- \dimen2=#3pt
+ \dimen2=#3\onepoint
\dimen2=-\MPyscale\dimen2
\xdef\MPxoffset{\withoutpt\the\dimen0}%
\xdef\MPyoffset{\withoutpt\the\dimen2}%
- \dimen0=#2bp
+ \dimen0=#2\onebasepoint
\dimen0=-\dimen0
- \dimen2=#3bp
+ \dimen2=#3\onebasepoint
\dimen2=-\dimen2
- \advance\dimen0 #4bp
+ \advance\dimen0 #4\onebasepoint
\dimen0=\MPxscale\dimen0
\xdef\MPwidth{\the\dimen0}%
- \advance\dimen2 #5bp
+ \advance\dimen2 #5\onebasepoint
\xdef\MPyshift{\the\dimen2}% unscaled
\dimen2=\MPyscale\dimen2
\xdef\MPheight{\the\dimen2}%
@@ -779,7 +873,7 @@
\let\handleMPsequence\dohandleMPsequence
\let\next\handleMPsequence
\ifskipemptyMPgraphic
- \ifdim\MPheight=0pt\relax\ifdim\MPwidth=0pt\relax
+ \ifdim\MPheight=\zeropoint\relax\ifdim\MPwidth=\zeropoint\relax
\def\next{\endinput\finishMPgraphic}%
\fi\fi
\fi
@@ -837,31 +931,31 @@
\let\ \relax % mp breaks long lines and appends a \
\edef\size{\gMPa\nofMParguments}%
\ifx\size\PSnfont % round font size (to pt)
- \advance\nofMParguments -1
- \expandafter\scratchdimen\gMPa\nofMParguments pt\relax
- \ifdim\scratchdimen<1pt
+ \advance\nofMParguments \minusone
+ \expandafter\scratchdimen\gMPa\nofMParguments\onepoint\relax
+ \ifdim\scratchdimen<\onepoint
\def\size{1pt}%
\else
- \advance\scratchdimen .5pt
+ \advance\scratchdimen .5\onepoint
\def\size##1.##2\relax{\def\size{##1pt}}%
\expandafter\size\the\scratchdimen\relax
\fi
\else
\edef\size{\size bp}%
\fi
- \advance\nofMParguments -1
+ \advance\nofMParguments \minusone
%\font\temp=\gMPa\nofMParguments\space at \size
\let\temp\relax % to be sure
\setMPfshowfont{\gMPa\nofMParguments}\size
- \advance\nofMParguments -1
+ \advance\nofMParguments \minusone
\temp
\MPfshowcommand
- {\ifnum\nofMParguments=1
+ {\ifnum\nofMParguments=\plusone
\def\do(##1){##1}%
\dogMPa1%
\else
% we need to catch ( a ) (a a a) (\123 \123 \123) etc
- \scratchcounter1
+ \scratchcounter\plusone
\def\dodo##1% Andreas Fieger's bug: (\304...)
{\edef\!!stringa{##1\empty\empty}% and another one: ( 11) -> \ifx 11
\ifx\!!stringa\MPspacechar\MPspacechar\else\expandafter##1\fi}%
@@ -869,7 +963,7 @@
\dogMPa\scratchcounter\MPspacechar
\let\do\relax
\loop
- \advance\scratchcounter 1
+ \advance\scratchcounter \plusone
\ifnum\scratchcounter<\nofMParguments\relax
\gMPa\scratchcounter\MPspacechar
\repeat
@@ -877,11 +971,25 @@
\dogMPa\scratchcounter
\fi
\unskip}}%
+ %
+ % this fails in some versions of pdftex
+ %
+ % \dimen0=\lastMPmoveY bp
+ % \advance\dimen0 by \ht0
+ % \ScaledPointsToBigPoints{\number\dimen0}\lastMPmoveY
+ % \PDFcode{n q 1 0 0 1 \lastMPmoveX\space\lastMPmoveY\space cm}%
+ % \dimen0=\ht0
+ % \advance\dimen0 by \dp0
+ % \box0
+ % \vskip-\dimen0
+ % \PDFcode{Q}%
+ % \egroup}
+ %
\setbox\scratchbox\hbox
- {\hskip\lastMPmoveX bp\raise\lastMPmoveY bp\box\scratchbox}%
- \ht\scratchbox0pt%
- \dp\scratchbox0pt%
- \wd\scratchbox0pt%
+ {\hskip\lastMPmoveX\onebasepoint\raise\lastMPmoveY\onebasepoint\box\scratchbox}%
+ \ht\scratchbox\zeropoint
+ \dp\scratchbox\zeropoint
+ \wd\scratchbox\zeropoint
\box\scratchbox
\egroup}
@@ -923,11 +1031,11 @@
{\bgroup
\ignoreMPspecials
\def\somestring{[}%
- \scratchcounter1
+ \scratchcounter\plusone
\loop
\ifnum\scratchcounter<\nofMParguments
\edef\somestring{\somestring\space\gMPa\scratchcounter}%
- \advance\scratchcounter 1
+ \advance\scratchcounter \plusone
\repeat
\edef\somestring{\somestring]\gMPa\scratchcounter\space d}%
\PDFcode{\somestring}%
@@ -961,7 +1069,7 @@
%D so we can use this one to trigger setting the linewidth.
\def\handleMPdtransform
- {\ifdim\gMPa1 pt>0pt
+ {\ifdim\gMPa1\onepoint>\zeropoint
\PDFcode{\gMPa1 w}%
\def\next##1 ##2 ##3 ##4 ##5 ##6 {\handleMPsequence}%
\else
@@ -1005,7 +1113,7 @@
\let\closeMPpath\relax
\let\flushMPpath\flushnormalMPpath
\resetMPstack
- \nofMPsegments1
+ \nofMPsegments\plusone
\let\handleMPsequence\dohandleMPpath
\dohandleMPpath}
@@ -1051,19 +1159,19 @@
% \def\flushnormalMPpath
% {\scratchcounter\nofMPsegments
-% \nofMPsegments 1
+% \nofMPsegments\plusone
% \loop
% \flushnormalMPsegment
-% \advance\nofMPsegments 1
+% \advance\nofMPsegments \plusone
% \ifnum\nofMPsegments<\scratchcounter
% \repeat}
%
% \def\flushconcatMPpath
% {\scratchcounter\nofMPsegments
-% \nofMPsegments 1
+% \nofMPsegments\plusone
% \loop
% \flushconcatMPsegment
-% \advance\nofMPsegments 1
+% \advance\nofMPsegments \plusone
% \ifnum\nofMPsegments<\scratchcounter
% \repeat}
%
@@ -1071,14 +1179,14 @@
\def\doflushsomeMPpath
{\dodoflushsomeMPpath
- \advance\nofMPsegments 1
+ \advance\nofMPsegments \plusone
\ifnum\nofMPsegments<\scratchcounter
\expandafter\doflushsomeMPpath
\fi}
\def\flushsomeMPpath
{\scratchcounter\nofMPsegments
- \nofMPsegments 1
+ \nofMPsegments\plusone
\doflushsomeMPpath}
\def\flushnormalMPpath{\let\dodoflushsomeMPpath\flushnormalMPsegment\flushsomeMPpath}
@@ -1116,7 +1224,7 @@
%OLD \def\doMPreducedimen#1
%OLD {\count0\MPconcatfactor
-%OLD \advance\dimen#1 \ifdim\dimen#1>0pt .5\else -.5\fi\count0
+%OLD \advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\count0
%OLD \divide\dimen#1 \count0\relax}
%OLD % too inaccurate (see old pragma logo)
@@ -1126,7 +1234,7 @@
%OLD \divide\dimen#1 \count0\relax}
%OLD \def\doMPreducedimen#1
-%OLD {\advance\dimen#1 \ifdim\dimen#1>0pt .5\else -.5\fi\MPconcatfactor
+%OLD {\advance\dimen#1 \ifdim\dimen#1>\zeropoint .5\else -.5\fi\MPconcatfactor
%OLD \divide\dimen#1 \MPconcatfactor}
%D The transformation code is rewritten by Daniel H. Luecking who
@@ -1150,13 +1258,13 @@
\newdimen\MPscratchDim % will be assigned global
\def\MPadjustdimen % sets \MPscratchDim and \MPscratchCnt
- {\MPscratchCnt0
+ {\MPscratchCnt\zerocount
\doMPadjustdimen}
\def\doMPadjustdimen
- {\ifdim\MPscratchDim>1pt
+ {\ifdim\MPscratchDim>\onepoint
\divide\MPscratchDim 2
- \advance\MPscratchCnt 1
+ \advance\MPscratchCnt \plusone
\expandafter\doMPadjustdimen
\fi}
@@ -1184,14 +1292,14 @@
\def\doMPreadjustdimen
{\ifnum\MPscratchCnt>2
\divide\scratchdimen 2
- \advance\MPscratchCnt -1
+ \advance\MPscratchCnt \minusone
\expandafter\doMPreadjustdimen
\fi}
\def\MPreciprocaldeterminant
{\scratchdimen\withoutpt\the\dimen0 \dimen6 % s_x*s_y
\advance\scratchdimen - \withoutpt\the\dimen2 \dimen4 % s_x*s_y - r_x*r_y
- \ifdim\scratchdimen<0pt % we need a positive dimension
+ \ifdim\scratchdimen<\zeropoint % we need a positive dimension
\scratchdimen-\scratchdimen % for \MPadjustdimen (?)
\doMPreciprocal
\scratchdimen-\scratchdimen
@@ -1205,7 +1313,7 @@
% todo: dimexpr
\def\doMPreciprocal % replace \scratchdimen with its reciprocal
- {\ifdim\scratchdimen=1pt \else
+ {\ifdim\scratchdimen=\onepoint \else
\MPadjustdimen
\scratchcounter\MPnumerator
\divide\scratchcounter\scratchdimen
@@ -1214,20 +1322,20 @@
\fi}
%OLD \def\presetMPconcat
-%OLD {\dimen 0=\gMPs1pt \doMPreducedimen 0 % r_x
-%OLD \dimen 2=\gMPs2pt \doMPreducedimen 2 % s_x
-%OLD \dimen 4=\gMPs3pt \doMPreducedimen 4 % s_y
-%OLD \dimen 6=\gMPs4pt \doMPreducedimen 6 % r_y
-%OLD \dimen 8=\gMPs5pt \doMPreducedimen 8 % t_x
-%OLD \dimen10=\gMPs6pt \doMPreducedimen10 } % t_y
+%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0 % r_x
+%OLD \dimen 2=\gMPs2\onepoint \doMPreducedimen 2 % s_x
+%OLD \dimen 4=\gMPs3\onepoint \doMPreducedimen 4 % s_y
+%OLD \dimen 6=\gMPs4\onepoint \doMPreducedimen 6 % r_y
+%OLD \dimen 8=\gMPs5\onepoint \doMPreducedimen 8 % t_x
+%OLD \dimen10=\gMPs6\onepoint \doMPreducedimen10 } % t_y
%OLD
%OLD \def\presetMPscale
-%OLD {\dimen 0=\gMPs1pt \doMPreducedimen 0
-%OLD \dimen 2=0pt
-%OLD \dimen 4=0pt
-%OLD \dimen 6=\gMPs2pt \doMPreducedimen 6
-%OLD \dimen 8=0pt
-%OLD \dimen10=0pt}
+%OLD {\dimen 0=\gMPs1\onepoint \doMPreducedimen 0
+%OLD \dimen 2 \zeropoint
+%OLD \dimen 4 \zeropoint
+%OLD \dimen 6=\gMPs2\onepoint \doMPreducedimen 6
+%OLD \dimen 8 \zeropoint
+%OLD \dimen10 \zeropoint}
\def\cleanupMPconcat
{\ignoreMPspecials
@@ -1236,24 +1344,24 @@
\keepMPspecials}
\def\presetMPconcat
- {\dimen 0=\gMPs1pt % s_x
- \dimen 2=\gMPs2pt % r_x
- \dimen 4=\gMPs3pt % r_y
- \dimen 6=\gMPs4pt % s_y
- \dimen 8=\gMPs5pt % t_x
- \dimen10=\gMPs6pt} % t_y
+ {\dimen 0=\gMPs1\onepoint % s_x
+ \dimen 2=\gMPs2\onepoint % r_x
+ \dimen 4=\gMPs3\onepoint % r_y
+ \dimen 6=\gMPs4\onepoint % s_y
+ \dimen 8=\gMPs5\onepoint % t_x
+ \dimen10=\gMPs6\onepoint} % t_y
\def\presetMPscale
- {\dimen 0=\gMPs1pt
- \dimen 2=0pt
- \dimen 4=0pt
- \dimen 6=\gMPs2pt
- \dimen 8=0pt
- \dimen10=0pt}
+ {\dimen 0=\gMPs1\onepoint
+ \dimen 2 \zeropoint
+ \dimen 4 \zeropoint
+ \dimen 6=\gMPs2\onepoint
+ \dimen 8 \zeropoint
+ \dimen10 \zeropoint}
\def\noMPtranslate % use this one grouped
- {\dimen 8=0pt % t_x
- \dimen10=0pt} % t_y
+ {\dimen 8 \zeropoint % t_x
+ \dimen10 \zeropoint} % t_y
%D \starttyping
%D \def\doMPconcat#1#2#3#4%
@@ -1429,18 +1537,18 @@
%OLD {\dimen12=#1pt % p_x
%OLD \dimen14=#3pt % p_y
%OLD %
-%OLD \chardef\MPfactor0
+%OLD \chardef\MPfactor\zerocount
%OLD \ifdim\dimen4<\MPcriteriumB\ifdim\dimen4>-\MPcriteriumB
%OLD \ifdim\dimen6<\MPcriteriumB\ifdim\dimen6>-\MPcriteriumB
%OLD \ifdim\dimen8<\MPcriteriumB\ifdim\dimen8>-\MPcriteriumB
%OLD \ifdim\dimen10<\MPcriteriumB\ifdim\dimen10>-\MPcriteriumB
-%OLD \chardef\MPfactor1
+%OLD \chardef\MPfactor\plusone
%OLD \fi\fi
%OLD \fi\fi
%OLD \fi\fi
%OLD \fi\fi
%OLD \ifcase\MPfactor % spurious 0 removed
-%OLD \chardef\MPfactor1
+%OLD \chardef\MPfactor\plusone
%OLD \ifdim\dimen12<\MPcriteriumA\ifdim\dimen12>-\MPcriteriumA
%OLD \ifdim\dimen14<\MPcriteriumA\ifdim\dimen14>-\MPcriteriumA
%OLD \chardef\MPfactor16
@@ -1482,8 +1590,8 @@
%OLD \multiply \dimen20 \dimen10
%OLD \advance \dimen12 -\dimen20
%OLD %
-%OLD \ifdim\dimen16=1pt \else
-%OLD \ifdim\dimen16>\MPconcatfactor 1pt \relax
+%OLD \ifdim\dimen16=\onepoint \else
+%OLD \ifdim\dimen16>\MPconcatfactor \onepoint \relax
%OLD \doMPreducedimen16
%OLD \divide \dimen18 \dimen16 \doMPexpanddimen18
%OLD \divide \dimen12 \dimen16 \doMPexpanddimen12
@@ -1513,8 +1621,8 @@
%D If this should ever cause problems, the scale factors can be reduced.
% \def\doMPconcat#1#2#3#4%
-% {\dimen12=#1pt % p_x % #1pt
-% \dimen14=#3pt % p_y % #3pt
+% {\dimen12=#1pt % p_x % #1\onepoint
+% \dimen14=#3pt % p_y % #3\onepoint
% \advance\dimen12 -\dimen8 % p_x - t_x
% \advance\dimen14 -\dimen10 % p_y - t_y
% \dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x)
@@ -1528,8 +1636,8 @@
% \edef#4{\withoutpt\the\dimen14}} % p_y^\prime
\def\doMPconcat#1#2#3#4%
- {\dimen12=#1pt % p_x % #1pt
- \dimen14=#3pt % p_y % #3pt
+ {\dimen12=#1pt % p_x % #1\onepoint
+ \dimen14=#3pt % p_y % #3\onepoint
\advance\dimen12 -\dimen8 % p_x - t_x
\advance\dimen14 -\dimen10 % p_y - t_y
\dimen18=\withoutpt\the\dimen6 \dimen12 % s_y(p_x - t_x)
@@ -1809,7 +1917,7 @@
\fi
\let\handleMPsequence\dohandleMPsequence
\resetMPstack
- \nofMPsegments0
+ \nofMPsegments\zerocount
\handleMPsequence}
%D The following \METAPOST\ code is quite valid but, when
@@ -1828,7 +1936,7 @@
{\ifcase\finiMPpath
\ifnum\nofMPsegments<3 % n is one ahead
\message{omitting zero clip path}%
- \nofMPsegments0
+ \nofMPsegments\zerocount
\fi
\fi}
@@ -1851,9 +1959,9 @@
\def\dohandleMPpath#1%
{\ifcase\lccode`#1\relax
- \expandafter\dohandleMPpathA
+ \@EA\dohandleMPpathA
\else
- \expandafter\dohandleMPpathB
+ \@EA\dohandleMPpathB
\fi#1}
%\def\dohandleMPpathA#1 %
@@ -1947,11 +2055,10 @@
\def\convertMPtoPDF % #1#2#3%
{\bgroup
- \defineMPtoPDFfallbacks
\ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new
\setbox\scratchbox\vbox\bgroup
- \xdef\MPheight{0pt}%
- \xdef\MPwidth {0pt}%
+ \xdef\MPheight{\zeropoint}%
+ \xdef\MPwidth {\zeropoint}%
\forgetall
\offinterlineskip
\startMPresources
@@ -1967,7 +2074,15 @@
\let\setMPextensions\relax
\def\doprocessMPtoPDFfile#1#2#3% file xscale yscale
- {\setMPspecials
+ {% the following line is needed for latex where onepoint is not
+ % onepoint but a number (maxdimen); some day i'll make a latex
+ % variant of this file so that i no longer have to deal with such
+ % issues; then i'll also speed up this module using a few context
+ % tricks
+ %
+ \let\onepoint\onerealpoint
+ %
+ \setMPspecials
\setMPextensions
\the\everyMPtoPDFconversion
\catcode`\^^M=\@@endofline
@@ -1977,16 +2092,65 @@
\xdef\MPyscale{#3}%
\xdef\MPxoffset{0}%
\xdef\MPyoffset{0}%
- \xdef\MPyshift{0pt}%
+ \xdef\MPyshift{\zeropoint}%
\donefalse
\let\handleMPsequence\dohandleMPsequence
\message{[MP to PDF]}% was: [MP to PDF #1] but there is a (#1) anyway
\input#1\relax}
+% strange rounding/clip in pdftex/viewer
+%
+% \def\finishMPgraphic
+% {\stopMPresources
+% \egroup
+% \ifx\pdftexversion\undefined\else\ifnum\pdftexversion<14 % for the moment
+% \chardef\makeMPintoPDFobject=0
+% \fi\fi
+% \ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
+% \chardef\makeMPintoPDFobject=1
+% \fi\fi
+% \setbox\scratchbox=\vbox
+% {\forgetall
+% \hbox
+% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space \MPxoffset\space \MPyoffset\space cm}%
+% \lower\MPyshift\box\scratchbox % unscaled shift
+% \PDFcode{Q}}}%
+% \ht\scratchbox\MPheight
+% \wd\scratchbox\MPwidth
+% \dp\scratchbox\zeropoint
+% \ifcase\makeMPintoPDFobject
+% \box\scratchbox
+% \or
+% \immediate\pdfxform resources{\currentPDFresources}\scratchbox
+% \xdef\lastPDFMPobject{\the\pdflastxform}%
+% \pdfrefxform\lastPDFMPobject
+% \global\let\currentPDFresources\empty
+% \else
+% \box\scratchbox
+% \fi
+% \egroup}
+%
+% funny clip in viewer
+%
+% \setbox\scratchbox=\vbox
+% {\forgetall
+% \dimen0=\MPllx bp
+% \dimen2=\MPlly bp
+% \setbox\scratchbox=\hbox{\hskip-\dimen0\raise-\dimen2\box\scratchbox}%
+% \ht\scratchbox=\zeropoint
+% \dp\scratchbox=\zeropoint
+% \wd\scratchbox=\zeropoint
+% \hbox
+% {\PDFcode{q \MPxscale\space 0 0 \MPyscale\space 0 0 cm}%
+% \lower\MPshift\box\scratchbox
+% \PDFcode{Q}}}%
+
+% \let\PDFMPformoffset\zeropoint
+
\def\PDFMPformoffset
- {\ifx\objectoffset\undefined0pt\else\objectoffset\fi}
+ {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi}
-\chardef\blackoutMPgraphic0 % in ConTeXt 1
+\chardef\blackoutMPgraphic\zerocount % in ConTeXt \plusone
\def\finishMPgraphic
{\stopMPresources
@@ -2000,7 +2164,7 @@
\PDFcode{Q}}}%
\ht\scratchbox\MPheight
\wd\scratchbox\MPwidth
- \dp\scratchbox0pt\relax
+ \dp\scratchbox\zeropoint\relax
\dopackageMPgraphic\scratchbox
\egroup
\endinput}
@@ -2010,28 +2174,28 @@
\def\dopackageMPgraphic#1% #1 = boxregister
{%\ifx\pdfxform\undefined
- % \chardef\makeMPintoPDFobject0 % no pdftex at all
+ % \chardef\makeMPintoPDFobject\zerocount % no pdftex at all
%\else\ifx\pdftexversion\undefined
- % \chardef\makeMPintoPDFobject0 % no pdftex at all
+ % \chardef\makeMPintoPDFobject\zerocount % no pdftex at all
%\else\ifnum\pdftexversion<14
- % \chardef\makeMPintoPDFobject0 % no resource support
+ % \chardef\makeMPintoPDFobject\zerocount % no resource support
%\else
% % keep the default value
%\fi\fi\fi
\ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
% an existing value of 2 signals object support (set elsewhere)
- \chardef\makeMPintoPDFobject1
+ \chardef\makeMPintoPDFobject\plusone
\fi\fi
\ifcase\makeMPintoPDFobject
\box#1%
\or
\scratchdimen\PDFMPformoffset\relax
- \ifdim\scratchdimen>0pt % compensate for error
+ \ifdim\scratchdimen>\zeropoint % compensate for error
\setbox#1\vbox spread 2\scratchdimen
{\forgetall\vss\hbox spread 2\scratchdimen{\hss\box#1\hss}\vss}%
\fi
\setMPPDFobject{\currentPDFresources}{#1}%
- \ifdim\scratchdimen>0pt % compensate for error
+ \ifdim\scratchdimen>\zeropoint % compensate for error
\vbox to \MPheight
{\forgetall\vss\hbox to \MPwidth{\hss\getMPPDFobject\hss}\vss}%
\else
@@ -2098,4 +2262,6 @@
%D does all the calculations. Converting other \POSTSCRIPT\
%D files would drive both me and \TEX\ crazy.
+\ifx\undefined\StopLatexHack \else \StopLatexHack \fi
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-ran.tex b/Master/texmf-dist/tex/context/base/supp-ran.tex
index 1266c0e0f34..8c76ab443f6 100644
--- a/Master/texmf-dist/tex/context/base/supp-ran.tex
+++ b/Master/texmf-dist/tex/context/base/supp-ran.tex
@@ -52,14 +52,6 @@
{\writestatus{loading}{Donald Arseneau's 'random.tex' (found)}}
{\writestatus{loading}{Donald Arseneau's 'random.tex' (not found)}}
- % avoid scratch dimens 0 and 2 (already recoded in third-ran)
- %
- % \def\setrandim#1#2#3% dimen register, minimum length, maximum length
- % {\scratchdimen#2\edef\!!stringa{\number\scratchdimen}%
- % \scratchdimen#3\edef\!!stringb{\number\scratchdimen}%
- % \setrannum\ranval\!!stringa\!!stringb
- % #1\ranval\s!sp\relax}
-
\fi
\ifx\nextrandom\undefined
@@ -73,18 +65,6 @@
\let\nextrandom\relax
-% \def\getrandomdimen #1#2#3{\scratchdimen #2\relax#1\scratchdimen }
-% \def\getrandomcount #1#2#3{\scratchcounter#2\relax#1\scratchcounter}
-% \def\getrandomnumber#1#2#3{\edef#1{0}}
-% \def\getrandomfloat #1#2#3{\edef#1{0}}
-% \unexpanded\def\setrandomseed #1{}
-% \unexpanded\def\getrandomseed #1{\edef#1{0}}
-
-% \chardef\randomseedfrozen\zerocount
-
-% \def\freezerandomseed {\global\chardef\randomseedfrozen\plusone }
-% \def\defrostrandomseed{\global\chardef\randomseedfrozen\zerocount}
-
\fi
\ifx\nextrandom\undefined \endinput \fi
@@ -165,9 +145,14 @@
\edef#1{\withoutpt\the\scratchdimen}}
\unexpanded \def\setrandomseed#1%
- {\randomi#1\relax}
+ {\global\randomi#1\relax} % global added
\unexpanded \def\getrandomseed#1%
{\edef#1{\number\randomi}}
+\def\getnewrandomseed#1%
+ {\setrandomseed\minusone % signals thrd-ran to auto reseed
+ \nextrandom % this signal is needed for the
+ #1\randomi} % pseudo randomizer (see: third-ran)
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/supp-vis.tex b/Master/texmf-dist/tex/context/base/supp-vis.tex
index 384bcd4401c..efe47751fe2 100644
--- a/Master/texmf-dist/tex/context/base/supp-vis.tex
+++ b/Master/texmf-dist/tex/context/base/supp-vis.tex
@@ -1742,8 +1742,11 @@
%D For those who want to manipulate the visual cues in detail,
%D we have grouped them.
+\newif\ifshowingcomposition % see later why we need this
+
\def\showfils
- {\let\hss \ruledhss
+ {\showingcompositiontrue
+ \let\hss \ruledhss
\let\hfil \ruledhfil
\let\hfill \ruledhfill
\let\hfilneg \ruledhfilneg
@@ -1767,7 +1770,8 @@
\let\vfillneg \normalvfillneg}
\def\showboxes
- {\baselineruletrue
+ {\showingcompositiontrue
+ \baselineruletrue
\let\hbox \ruledhbox
\let\vbox \ruledvbox
\let\vtop \ruledvtop
@@ -1780,7 +1784,8 @@
\let\vcenter \normalvcenter}
\def\showskips
- {\let\hskip \ruledhskip
+ {\showingcompositiontrue
+ \let\hskip \ruledhskip
\let\vskip \ruledvskip
\let\kern \ruledkern
\let\mskip \ruledmskip
@@ -1798,7 +1803,8 @@
\let\vglue \normalvglue}
\def\showpenalties
- {\let\penalty \ruledpenalty}
+ {\showingcompositiontrue
+ \let\penalty \ruledpenalty}
\def\dontshowpenalties
{\let\penalty \normalpenalty}
@@ -1863,10 +1869,10 @@
%D
%D Beware, it's a macro not a \DIMENSION.
-\ifx\korpsgrootte\undefined
+\ifx\bodyfontsize\undefined
\edef\defaulttestrulewidth{\the\testrulewidth}
\else
- \def\defaulttestrulewidth{.02\korpsgrootte} % still dutch
+ \def\defaulttestrulewidth{.02\bodyfontsize} % still dutch
\fi
\def\showmakeup
diff --git a/Master/texmf-dist/tex/context/base/symb-cow.tex b/Master/texmf-dist/tex/context/base/symb-cow.tex
new file mode 100644
index 00000000000..6fd32a53517
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/symb-cow.tex
@@ -0,0 +1,113 @@
+%D \module
+%D [ file=symb-cow,
+%D version=2006.06.23,
+%D title=\CONTEXT\ Symbol Libraries,
+%D subtitle=Cow Symbols,
+%D author=Hans Hagen,
+%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.
+
+\loadmapfile[koeieletters.map]
+
+\definefontsynonym [Cows] [koeielett]
+\definefontsynonym [CowsContour] [koeielett-contour]
+\definefontsynonym [CowsLogo] [koeielogos]
+\definefontsynonym [CowsLogoContour] [koeielogos-contour]
+
+\definecolor [lsky] [r=.6,g=.6,b=1]
+\definecolor [dsky] [r=.1,g=.1,b=1]
+\definecolor [lground] [r=.3,g=.9,b=.3]
+\definecolor [dground] [r=0,g=.5,b=0]
+\definecolor [cspots] [r=.33,g=.1,b=0]
+
+\definecolor [tlsky] [t=.5,a=1,r=.6,g=.6,b=1]
+\definecolor [tdsky] [t=.5,a=1,r=.1,g=.1,b=1]
+\definecolor [tlground] [t=.5,a=1,r=.3,g=.9,b=.3]
+\definecolor [tdground] [t=.5,a=1,r=0,g=.5,b=0]
+\definecolor [tcspots] [t=.5,a=1,r=.33,g=.1,b=0]
+
+\definepalet
+ [cow]
+ [normal=lground,
+ contour=dground,
+ sky=lsky]
+
+\def\CowNormal#1%
+ {\dontleavehmode\hbox{\color[cow:normal]{\getglyph{Cows}{#1}}}}
+
+\def\ScaledCowNormal#1#2%
+ {\dontleavehmode\hbox{\color[cow:normal]{\definedfont[Cows sa #1]#2}}}
+
+\def\ScaledCowOverlay#1#2%
+ {\dontleavehmode\hbox
+ {\color[cow:contour]{\hsmash{\definedfont[CowsContour sa #1]#2}}%
+ \color[cow:normal] {\definedfont[Cows sa #1]#2}}}
+
+\def\CowOverlay#1%
+ {\dontleavehmode\hbox
+ {\color[cow:contour]{\hsmash{\getglyph{CowsContour}{#1}}}%
+ \color[cow:normal] {\getglyph{Cows} {#1}}}}
+
+\def\CowContour#1%
+ {\dontleavehmode\hbox
+ {\color[cow:contour]{\hsmash{\getglyph{CowsLogoContour}{#1}}}%
+ \color[cow:normal] {\getglyph{CowsLogo} {#1}}}}
+
+\def\CowLogo#1%
+ {\getglyph{CowsLogo}{\char#1\relax}}
+
+\startsymbolset[cownormal]
+
+\definesymbol[CowPragma] [\CowLogo{1}]
+\definesymbol[CowConTeXt] [\CowLogo{2}]
+\definesymbol[CowConTeXtComplete][\CowLogo{3}]
+\definesymbol[CowConTeXtShadow] [\CowLogo{4}]
+\definesymbol[CowConTeXtContour] [\CowLogo{5}]
+\definesymbol[CowConTeXtOutline] [\CowLogo{6}]
+\definesymbol[CowConTeXtDots] [\CowLogo{7}]
+\definesymbol[CowMP] [\CowLogo{8}]
+\definesymbol[CowMPComplete] [\CowLogo{9}]
+\definesymbol[CowTeX] [\CowLogo{10}]
+\definesymbol[CowTeXComplete] [\CowLogo{11}]
+\definesymbol[CowBoo] [\CowLogo{12}]
+\definesymbol[CowCow] [\CowLogo{13}]
+\definesymbol[CowExampleComplete][\CowLogo{14}]
+\definesymbol[CowFoxetComplete] [\CowLogo{15}]
+\definesymbol[CowMetafun] [\CowLogo{16}]
+\definesymbol[CowMetafunComplete][\CowLogo{17}]
+\definesymbol[CowTEX] [\CowLogo{18}]
+\definesymbol[CowTeX] [\CowLogo{18}]
+\definesymbol[CowWiki] [\CowLogo{19}]
+
+\stopsymbolset
+
+\startsymbolset[cowcontour]
+
+\definesymbol[CowPragma] [\CowContour{1}]
+\definesymbol[CowConTeXt] [\CowContour{2}]
+\definesymbol[CowConTeXtComplete][\CowContour{3}]
+\definesymbol[CowConTeXtShadow] [\CowContour{4}]
+\definesymbol[CowConTeXtContour] [\CowContour{5}]
+\definesymbol[CowConTeXtOutline] [\CowContour{6}]
+\definesymbol[CowConTeXtDots] [\CowContour{7}]
+\definesymbol[CowMP] [\CowContour{8}]
+\definesymbol[CowMPComplete] [\CowContour{9}]
+\definesymbol[CowTeX] [\CowContour{10}]
+\definesymbol[CowTeXComplete] [\CowContour{11}]
+\definesymbol[CowBoo] [\CowContour{12}]
+\definesymbol[CowCow] [\CowContour{13}]
+\definesymbol[CowExampleComplete][\CowContour{14}]
+\definesymbol[CowFoxetComplete] [\CowContour{15}]
+\definesymbol[CowMetafun] [\CowContour{16}]
+\definesymbol[CowMetafunComplete][\CowContour{17}]
+\definesymbol[CowTEX] [\CowContour{18}]
+\definesymbol[CowTeX] [\CowContour{18}]
+\definesymbol[CowWiki] [\CowContour{19}]
+
+\stopsymbolset
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/symb-glm.tex b/Master/texmf-dist/tex/context/base/symb-glm.tex
index cd7c05dbda2..63ac4ed2664 100644
--- a/Master/texmf-dist/tex/context/base/symb-glm.tex
+++ b/Master/texmf-dist/tex/context/base/symb-glm.tex
@@ -14,6 +14,7 @@
%D Watch the \type {x} before the local symbols.
\loadmapfile [ec-public-lm.map]
+% \loadmapfile [ec-lm.map]
% this used to be:
%
diff --git a/Master/texmf-dist/tex/context/base/symb-ini.tex b/Master/texmf-dist/tex/context/base/symb-ini.tex
index 496292c5799..a3a9048b82b 100644
--- a/Master/texmf-dist/tex/context/base/symb-ini.tex
+++ b/Master/texmf-dist/tex/context/base/symb-ini.tex
@@ -54,6 +54,11 @@
1: se incarca setul de simboluri --
\stopmessages
+\startmessages french library: symbols
+ title: symboles
+ 1: chargement du jeu de symbole --
+\stopmessages
+
%D \macros
%D {definesymbol, symbol}
%D
@@ -135,7 +140,24 @@
% \fi
% \fi}
-\def\dosymbol[#1][#2]%
+% We support both:
+%
+% Test test \symbol[whatever]\ test \symbol[whatever].
+% Test test \symbol{whatever} test \symbol{whatever}.
+
+\def\dosymbol % so we also handle \symbol{name}
+ {\iffirstargument % which is nicer with following spaces
+ \expandafter\donormalsymbol
+ \else
+ \expandafter\dospecialsymbol
+ \fi}
+
+\def\dospecialsymbol[#1][#2]#3%
+ {\firstargumenttrue
+ \secondargumentfalse
+ \donormalsymbol[#3][]}
+
+\def\donormalsymbol[#1][#2]%
{\nosymboltrue
\ifsecondargument
\edef\currentsymbol{#2}%
@@ -291,10 +313,11 @@
%D \showsetup{usesymbols}
\def\dousesymbols#1%
- {\makeshortfilename[\f!symbolprefix#1]%
- \showmessage\m!symbols1{#1}%
+ {\makeshortfilename[\truefilename{\f!symbolprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename\donothing\donothing
+ \readsysfile\shortfilename
+ {\showmessage\m!symbols1{#1}}
+ \donothing
\stopreadingfile}
\def\usesymbols[#1]%
diff --git a/Master/texmf-dist/tex/context/base/symb-was.tex b/Master/texmf-dist/tex/context/base/symb-was.tex
new file mode 100644
index 00000000000..ba261730618
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/symb-was.tex
@@ -0,0 +1,205 @@
+%D \module
+%D [ file=symb-was,
+%D version=2005.10.15,
+%D title=\CONTEXT\ Symbol Libraries,
+%D subtitle=Roland Waldi's Symbols (wasy-2),
+%D author=Henning Hraban Ramm,
+%D date=\currentdate,
+%D copyright={public domain}]
+%C
+%C This module is in the public domain.
+
+%D This module implements the Roland Waldi Symbole font
+%D (wasy). The names are derived from the \LATEX\ package
+%D \type {wasysym} by Axel Kielhorn. The symbols are
+%D available as Type~1 font and are included in \TEX\ distributions.
+%D
+%D This symbol font offers basic sets of astronomical, astrological,
+%D geometrical, musical and general symbols, plus those needed
+%D for the APL programming language and some more.
+%D This module leaves out most of the math stuff, such as operators
+%D and integrals.
+%D
+%D The font was designed by Robert Waldi and is in the public domain.
+%D The PS Type 1 fonts are by Taco Hoekwater, \hyphenatedurl
+%D {taco.hoekwater@wkap.nl}, and also in the public domain.
+%D The wasysym \LATEX\ package is (c) Axel Kielhorn, \hyphenatedurl
+%D {A.Kielhorn@web.de}, under the LaTeX Project Public License.
+%D This stuff lives in \hyphenatedurl {http://dante.ctan.org/CTAN/fonts/wasy2/}.
+%D
+%D This \CONTEXT\ module is by Henning Hraban Ramm, \hyphenatedurl
+%D {hraban@fiee.net}, given to the public domain as far as allowed
+%D (some parts are copied from the \LATEX\ package).
+
+%D Slightly patched by HH.
+
+\loadmapfile[original-wasy.map]
+
+% there are also fonts for 6, 7, 8, 9 pt; how can we access these automatically?
+% how about the bold wasy font?
+
+\definefontsynonym [WaldiSymbol] [wasy10]
+\definefontsynonym [WaldiSymbolBold] [wasyb10]
+
+\def\WaldiSymbol#1{\getglyph{WaldiSymbol}{\char#1}}
+
+\def\wasy@over#1#2{{\setbox0\hbox{$#2$}\hbox to \wd0{\hss$#1$\hss}\kern-\wd0\box0}}
+
+% general symbols
+
+\startsymbolset [wasy general]
+ \definesymbol [male] [\WaldiSymbol {26}]
+ \definesymbol [female] [\WaldiSymbol {25}]
+ \definesymbol [currency] [\WaldiSymbol {27}]
+ \definesymbol [cent] [\WaldiSymbol{103}]
+ \definesymbol [lozenge] [\WaldiSymbol {53}]
+ \definesymbol [kreuz] [\WaldiSymbol {54}]
+ \definesymbol [smiley] [\WaldiSymbol {44}]
+ \definesymbol [blacksmiley] [\WaldiSymbol {45}]
+ \definesymbol [frownie] [\WaldiSymbol {47}]
+ \definesymbol [sun] [\WaldiSymbol {46}]
+ \definesymbol [checked] [\WaldiSymbol {8}]
+ \definesymbol [brokenvert] [\WaldiSymbol{124}]
+ \definesymbol [diameter] [\WaldiSymbol {31}]
+ \definesymbol [invdiameter] [\WaldiSymbol {21}]
+ \definesymbol [phone] [\WaldiSymbol {7}]
+ \definesymbol [recorder] [\WaldiSymbol {6}]
+ \definesymbol [clock] [\WaldiSymbol {28}]
+ \definesymbol [permil] [\WaldiSymbol{104}]
+ \definesymbol [bell] [\WaldiSymbol {10}]
+ \definesymbol [ataribox] [\WaldiSymbol{109}]
+ \definesymbol [pointer] [\WaldiSymbol {9}]
+ \definesymbol [lightning] [\WaldiSymbol {18}]
+ \definesymbol [agemO] [\WaldiSymbol {48}]
+\stopsymbolset
+
+\startsymbolset [wasy music]
+ \definesymbol [eighthnote] [\WaldiSymbol{11}]
+ \definesymbol [quarternote] [\WaldiSymbol{12}]
+ \definesymbol [halfnote] [\WaldiSymbol{13}]
+ \definesymbol [fullnote] [\WaldiSymbol{14}]
+ \definesymbol [twonotes] [\WaldiSymbol{15}]
+\stopsymbolset
+
+\startsymbolset [wasy astronomy]
+ \definesymbol [ascnode] [\WaldiSymbol{19}]
+ \definesymbol [descnode] [\WaldiSymbol{20}]
+ \definesymbol [astrosun] [\mathematics{\odot}]
+ \definesymbol [sun] [\WaldiSymbol{46}] % additional
+ \definesymbol [newmoon] [\WaldiSymbol{32}]
+ \definesymbol [fullmoon] [\WaldiSymbol{35}]
+ \definesymbol [rightmoon] [\WaldiSymbol{37}]
+ \definesymbol [leftmoon] [\WaldiSymbol{36}]
+ \definesymbol [vernal] [\WaldiSymbol{23}]
+ \definesymbol [mercury] [\WaldiSymbol{39}]
+ \definesymbol [mars] [\dontleavehmode\lower.2ex\hbox{\WaldiSymbol{26}}]
+ \definesymbol [saturn] [\WaldiSymbol{89}]
+ \definesymbol [neptune] [\WaldiSymbol{91}]
+ \definesymbol [earth] [\dontleavehmode\lower.3ex\hbox{\WaldiSymbol{38}}]
+ \definesymbol [venus] [\dontleavehmode\raise.2ex\hbox{\WaldiSymbol{25}}]
+ \definesymbol [jupiter] [\WaldiSymbol{88}]
+ \definesymbol [uranus] [\WaldiSymbol{90}]
+ \definesymbol [pluto] [\WaldiSymbol{92}]
+\stopsymbolset
+
+\startsymbolset [wasy astrology]
+ \definesymbol [conjunction] [\WaldiSymbol {86}]
+ \definesymbol [opposition] [\WaldiSymbol {87}]
+ \definesymbol [aries] [\WaldiSymbol {23}]
+ \definesymbol [libra] [\WaldiSymbol {97}]
+ \definesymbol [taurus] [\WaldiSymbol {93}]
+ \definesymbol [scorpio] [\WaldiSymbol {98}]
+ \definesymbol [gemini] [\WaldiSymbol {94}]
+ \definesymbol [sagittarius] [\WaldiSymbol {99}]
+ \definesymbol [cancer] [\WaldiSymbol {95}]
+ \definesymbol [capricornus] [\WaldiSymbol{100}]
+ \definesymbol [leo] [\WaldiSymbol {19}]
+ \definesymbol [aquarius] [\WaldiSymbol{101}]
+ \definesymbol [virgo] [\WaldiSymbol {96}]
+ \definesymbol [pisces] [\WaldiSymbol{102}]
+\stopsymbolset
+
+\startsymbolset [wasy geometry]
+ \definesymbol [fivestar] [\WaldiSymbol {69}] % HHR additional
+ \definesymbol [hexstar] [\WaldiSymbol {65}]
+ \definesymbol [varhexstar] [\WaldiSymbol {66}]
+ \definesymbol [davidsstar] [\WaldiSymbol {67}]
+ \definesymbol [Circle] [\WaldiSymbol {35}]
+ \definesymbol [CIRCLE] [\WaldiSymbol {32}]
+ \definesymbol [Leftcircle] [\WaldiSymbol {73}]
+ \definesymbol [LEFTCIRCLE] [\WaldiSymbol {71}]
+ \definesymbol [Rightcircle] [\WaldiSymbol {74}]
+ \definesymbol [RIGHTCIRCLE] [\WaldiSymbol {72}]
+ \definesymbol [LEFTcircle] [\dontleavehmode\hbox to \zeropoint{\WaldiSymbol{71}\hss}\WaldiSymbol{35}]
+ \definesymbol [RIGHTcircle] [\dontleavehmode\hbox to \zeropoint{\WaldiSymbol{72}\hss}\WaldiSymbol{35}]
+ \definesymbol [LEFTarrow] [\WaldiSymbol {16}]
+ \definesymbol [RIGHTarrow] [\WaldiSymbol {17}]
+ \definesymbol [UParrow] [\WaldiSymbol {75}]
+ \definesymbol [DOWNarrow] [\WaldiSymbol {76}]
+ \definesymbol [Box] [\WaldiSymbol {32}]
+ \definesymbol [APLbox] [\WaldiSymbol{126}]
+ \definesymbol [XBox] [\WaldiSymbol {52}]
+ \definesymbol [Bowtie] [\WaldiSymbol {49}]
+ \definesymbol [Diamond] [\WaldiSymbol {51}]
+ \definesymbol [octagon] [\WaldiSymbol {56}]
+ \definesymbol [hexagon] [\WaldiSymbol {55}]
+ \definesymbol [varhexagon] [\WaldiSymbol {57}]
+ \definesymbol [pentagon] [\WaldiSymbol {68}]
+ \definesymbol [pentastar] [\dontleavehmode\hbox to \zeropoint{\WaldiSymbol{68}\hss}\lower.04em\hbox{\WaldiSymbol{69}}] % HHR additional
+\stopsymbolset
+
+\startsymbolset [wasy physics]
+ \definesymbol [varangle] [\WaldiSymbol{30}]
+ \definesymbol [invneg] [\WaldiSymbol{24}]
+ \definesymbol [leftturn] [\WaldiSymbol{34}]
+ \definesymbol [rightturn] [\WaldiSymbol{33}]
+ \definesymbol [diameter] [\WaldiSymbol{31}]
+ \definesymbol [invdiameter] [\WaldiSymbol{21}] % additional
+ \definesymbol [therefore] [\WaldiSymbol {5}]
+ \definesymbol [AC] [\mbox{\kern.05em\WaldiSymbol{58}\kern.05em}]
+ \definesymbol [HF] [\dontleavehmode
+ \lower.09em\hbox to \zeropoint{\kern.05em\WaldiSymbol{58}\hss}%
+ \raise.09em\hbox{\kern.05em\WaldiSymbol{58}\kern.05em}]
+ \definesymbol [VHF] [\WaldiSymbol{64}]
+ \definesymbol [photon] [\hbox{\WaldiSymbol{58}\WaldiSymbol{58}\WaldiSymbol{58}\WaldiSymbol{58}}]
+ \definesymbol [gluon] [\hbox{\WaldiSymbol{80}\WaldiSymbol{80}\WaldiSymbol{80}\WaldiSymbol{80}\WaldiSymbol{80}\WaldiSymbol{80}}]
+\stopsymbolset
+
+\startsymbolset [wasy apl]
+ \definesymbol [APLup] [\WaldiSymbol{0}]
+ \definesymbol [APLdown] [\WaldiSymbol{70}]
+ \definesymbol [APLbox] [\WaldiSymbol{126}]
+ \definesymbol [APLinv] [\dontleavehmode\hbox to \zeropoint{$\div$\hss}\WaldiSymbol{126}]
+ \definesymbol [APLleftarrowbox] [\WaldiSymbol{112}]
+ \definesymbol [APLrightarrowbox][\WaldiSymbol{113}]
+ \definesymbol [APLuparrowbox] [\WaldiSymbol{110}]
+ \definesymbol [APLdownarrowbox] [\WaldiSymbol{111}]
+ \definesymbol [APLinput] [\WaldiSymbol{125}]
+ \definesymbol [APLminus] [\dontleavehmode\raise.7ex\hbox{$-$}]
+ \definesymbol [APLlog] [\WaldiSymbol{22}]
+ \definesymbol [APLstar] [\WaldiSymbol{69}]
+ \definesymbol [APLcomment] [\WaldiSymbol{127}]
+ \definesymbol [notslash] [\wasy@over{/}{-}]
+ \definesymbol [notbackslash] [\wasy@over{\backslash}{-}]
+ %
+ %definesymbol [APLvert] [\WaldiSymbol{}]
+ %definesymbol [APLnot] [\WaldiSymbol{}]
+ %definesymbol [APLcirc] [\WaldiSymbol{}]
+ %
+ % HH: messy, best define all combinations (todo)
+ %
+ \def\APLnot #1{\wasy@over{\sim }{#1}}
+ \def\APLcirc#1{\wasy@over{\circ}{#1}}
+ \def\APLvert#1{\wasy@over{\vert}{#1}}
+ %
+\stopsymbolset
+
+%D \showsymbolset[wasy general]
+%D \showsymbolset[wasy music]
+%D \showsymbolset[wasy astronomy]
+%D \showsymbolset[wasy astrology]
+%D \showsymbolset[wasy geometry]
+%D \showsymbolset[wasy physics]
+%D \showsymbolset[wasy apl]
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-con.tex b/Master/texmf-dist/tex/context/base/syst-con.tex
index a9e04921f5f..cbef0dedc26 100644
--- a/Master/texmf-dist/tex/context/base/syst-con.tex
+++ b/Master/texmf-dist/tex/context/base/syst-con.tex
@@ -192,7 +192,7 @@
\dorecurse{255}
{\lccode`a=\recurselevel
- \lowercase{\xdef\rawcharacter{\rawcharacter a\or}}}
+ \lowercase{\xdef\rawcharacter{\rawcharacter \string a\or}}} % string is needed for XeTeX
\@EA\gdef\@EA\rawcharacter\@EA#\@EA1\@EA
{\@EA\ifcase\@EA#\@EA1\rawcharacter\fi}
@@ -207,5 +207,54 @@
\def\threedigits#1%
{\ifnum#1<10 00\else\ifnum#1<100 0\fi\fi\number#1}
+%D \macros{modulonumber}
+%D
+%D In the conversion macros described in \type {core-con} we
+%D need a wrap||around method. The following solution is
+%D provided by Taco.
+%D
+%D The \type {modulonumber} macro expands to the mathematical
+%D modulo of a positive integer. It is crucial for it's
+%D application that this macro is fully exandable.
+%D
+%D The expression inside the \type {\numexpr} itself is
+%D somewhat bizarre because \ETEX\ uses a rounding
+%D division instead of truncation. If \ETEX's division
+%D would have behaved like \TEX's normal\type{\divide}, then
+%D the expression could have been somewhat simpler, like
+%D \type {#2-(#2/#1)*#1}. This works just as well, but a bit
+%D more complex.
+
+\beginETEX
+
+\def\modulonumber#1#2%
+ {\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax}
+
+\endETEX
+
+%D \macros{modulatednumber}
+%D
+%D Modulo numbers run from zero to one less than the limit,
+%D but for conversion sets, we need a value between 1 and the
+%D limit. The \type{\modulatednumber} arranges that. This
+%D macro also needs to be fully expandable, resulting in
+%D two \type{\numexpr}s.
+
+\beginETEX
+
+\def\modulatednumber#1#2%
+ {\ifnum\the\numexpr\modulonumber{#1}{#2}\relax=0 #1%
+ \else \the\numexpr\modulonumber{#1}{#2}\relax \fi}
+
+\endETEX
+
+%D When not running \ETEX\ you're left with the maximum:
+
+\beginTEX
+
+\def\modulatednumber#1#2%
+ {\ifnum#2>#1 #1\else#2\fi}
+
+\endTEX
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-etx.tex b/Master/texmf-dist/tex/context/base/syst-etx.tex
index 55837b02ff1..e2770cfe976 100644
--- a/Master/texmf-dist/tex/context/base/syst-etx.tex
+++ b/Master/texmf-dist/tex/context/base/syst-etx.tex
@@ -230,7 +230,7 @@
\chardef\@@insallocation=32
-%D However, there's a bug in \ETEX\ versions smaller that 2.2,
+%D However, there's a bug in \ETEX\ versions smaller than 2.2,
%D so we need to play safe:
\ifnum\etexversion<202 \chardef\@@insallocation=8 \fi
diff --git a/Master/texmf-dist/tex/context/base/syst-ext.tex b/Master/texmf-dist/tex/context/base/syst-ext.tex
index 51376ce78c7..82e6bc2e77c 100644
--- a/Master/texmf-dist/tex/context/base/syst-ext.tex
+++ b/Master/texmf-dist/tex/context/base/syst-ext.tex
@@ -394,9 +394,21 @@
%D \stoptyping
%D
%D This expands to \type{\ifsomething}.
+%D
+%D \starttyping
+%D \def\strippedcsname
+%D {\expandafter\gobbleoneargument\string}
+%D \stoptyping
+%D
+%D Slower but better:
+
+{\catcode`.=\@@escape .catcode`.\ 12 .xdef.letterbackslash{.string\}} % hack
\def\strippedcsname
- {\expandafter\gobbleoneargument\string}
+ {\expandafter\dostrippedcsname\string}
+
+\def\dostrippedcsname#1%
+ {\if\noexpand#1\letterbackslash\else#1\fi}
%D \macros
%D {savenormalmeaning}
@@ -1139,11 +1151,35 @@
\long\def\convertcommand#1\to#2%
{\dodoglobal\edef#2{\convertedcommand#1}}
+\long\def\defconvertedargument#1#2% less sensitive for \to
+ {\long\def#1{#2}% saves a restore
+ \dodoglobal\edef#1{\convertedcommand#1}}
+
+\long\def\defconvertedcommand#1#2% less sensitive for \to
+ {\dodoglobal\edef#1{\convertedcommand#2}}
+
\endTEX
\def\convertvalue#1\to
{\expandafter\convertcommand\csname#1\endcsname\to}
+\def\defconvertvalue#1#2% less sensitive for \to
+ {\@EA\defconvertcommand\@EA#1\csname#2\endcsname}
+
+%D \macros
+%D {convertasciiafter}
+%D
+%D Sometimes we need to convert an argument to a string (letters
+%D only), for instance when we compare it with another string:
+%D
+%D \starttyping
+%D \convertasciiafter\doifinstringelse{em}{\ascii}{...}
+%D \stoptyping
+
+\def\convertasciiafter#1#2%
+ {\convertargument#2\to\asciiafter
+ \@EA#1\@EA{\asciiafter}}
+
%D In \ETEX\ we can use \type {\detokenize} and gain some
%D speed, but in general far less that 1\% for \type
%D {\convertargument} and nil for \type {\convertcommand}.
@@ -1160,7 +1196,13 @@
% {\@EA\dodoglobal\@EA\edef\@EA#2\@EA{\@EA\detokenize\@EA{#1}}}
\long\def\convertcommand#1\to#2%
- {\dodoglobal\edef#2{\@EA\detokenize\@EA{#1}}}
+ {\dodoglobal\edef#2{\@EA\detokenize\@EA{#1}}} % hm, only second is also ok
+
+\long\def\defconvertedargument#1#2% less sensitive for \to
+ {\dodoglobal\edef#1{\detokenize{#2}}}
+
+\long\def\defconvertedcommand#1#2% less sensitive for \to
+ {\dodoglobal\edef#1{\detokenize\@EA{#2}}}
\endETEX
@@ -1619,6 +1661,14 @@
\afterassignment\BeforeGroup
\let\next=}
+\long\def\HandleSimpleGroup#1#2% no inner group (so no kerning interference)
+ {\bgroup
+ \long\def\BeforeGroup{\bgroup#1\aftergroup\AfterGroup}% interferes
+ \long\def\BeforeGroup{\bgroup\aftergroup\AfterGroup#1}%
+ \long\def\AfterGroup {#2\egroup}%
+ \afterassignment\BeforeGroup
+ \let\next=}
+
\long\def\HandleNoGroup#1#2%
{\long\def\AfterGroup{#2\egroup}%
\bgroup\aftergroup\AfterGroup#1}
@@ -1670,6 +1720,10 @@
{\doifnextcharelse\bgroup
{\HandleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}}
+\long\unexpanded\def\simplegroupedcommand#1#2%
+ {\doifnextcharelse\bgroup
+ {\HandleSimpleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}}
+
%D Users should be aware of the fact that grouping can
%D interfere with ones paragraph settings that are executed
%D after the paragraph is closed. One should therefore
@@ -2352,7 +2406,7 @@
\def\resetcounter#1%
{\letgvalue{#1}\zerocountervalue}
-\def\setcounter#1#2%
+\def\setcounter#1#2% or: \setxvalue{#1}{\number#2}
{\scratchcounter#2%
\setxvalue{#1}{\the\scratchcounter}}
@@ -2546,7 +2600,7 @@
%D A first application of the two routines defined above is:
%D
%D \starttyping
-%D \removesubstringtest-\from first-last\to\nothyphenated
+%D \removesubstring-\from first-last\to\nothyphenated
%D \stoptyping
%D
%D Which in terms of \TEX\ looks like:
@@ -2677,6 +2731,19 @@
{\rawdoifinsetelse{#1}#2\resetglobal
{\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}}
+\def\robustdoifinsetelse#1#2%
+ {\expanded{\convertargument#1}\to\!!stringa
+ \expanded{\convertargument#2}\to\!!stringb
+ \rawdoifinsetelse\!!stringa\!!stringb}
+
+\def\robustaddtocommalist#1#2% {item} \cs
+ {\robustdoifinsetelse{#1}#2\resetglobal
+ {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}}
+
+\def\robustpretocommalist#1#2% {item} \cs
+ {\robustdoifinsetelse{#1}#2\resetglobal
+ {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}}
+
\def\xsplitstring#1#2% \cs {str}
{\def\dosplitstring##1,#2,##2,#2,##3\\%
{\edef\!!stringa{\bcleanedupcommalist##1\empty\empty\relax}%
@@ -3428,6 +3495,19 @@
%D As we can see below, spaces following a control sequence are
%D to enclosed in \type{{}}.
+% keep this one:
+%
+% \def\stripcharacter#1\from#2\to#3%
+% {\def\dostripcharacter##1#1##2\end
+% {\edef\!!strippedstring{\!!strippedstring##1}%
+% \doifnotempty{##2}{\dostripcharacter##2\end}}%
+% \let\!!strippedstring\empty
+% \edef\!!stringa{#2}%
+% \@EA\dostripcharacter\!!stringa#1\end
+% \dodoglobal\let#3\!!strippedstring}
+%
+% the following is better (comes from syst-loc):
+
\def\stripcharacter#1\from#2\to#3%
{\def\dostripcharacter##1#1##2\end
{\edef\!!strippedstring{\!!strippedstring##1}%
@@ -3725,18 +3805,16 @@
%D \processlist(){=>}\docommando(a=>b=>c=>d)
%D \stoptyping
-\def\processlist#1#2#3#4%
+\long\def\processlist#1#2#3#4% no blank skipping !
{\def\doprocesslist##1#2%
{\def\dodoprocesslist####1####2#3%
{\ifx#2####1%
\let\dodoprocesslist\relax
\else\ifx#2####2%
\let\dodoprocesslist\relax
- \else\ifx\blankspace####2%
- #4{####1}%
\else
#4{####1####2}%
- \fi\fi\fi
+ \fi\fi
\dodoprocesslist}%
\expandafter\dodoprocesslist\gobbleoneargument##1#3#2#3}%
\def\dodoprocesslist#1%
@@ -3952,6 +4030,15 @@
\setbox\@@dlhbox\hbox{\mathsurround\zeropoint\everymath\emptytoks$ $}\unhbox\@@dlhbox
\fi \fi}
+% Also ok, but more sensitive to lookahead expansion is:
+%
+% \def\dontleavehmode{\ifvmode \indent \fi}
+%
+% which assumes indent is kept unchanged. Protecting the macro is only
+% possible in etex (watch out: \unexpanded in context is eq to \protected).
+%
+% \unexpanded \def\dontleavehmode{\ifvmode \indent \fi} % functional spec TH
+
%D But, if you run a recent version of \TEX, we can use the new
%D primitive:
@@ -4626,65 +4713,71 @@
%D I'll implement this when I'm in \quotation {writing dirty
%D macros mood}.
+\def\dofilterfromstr#1#2% max n
+ {\ifcase#1\or
+ \ifcase#2\or
+ \strippedcsname\firstofoneargument
+ \else
+ \strippedcsname\gobbleoneargument
+ \fi
+ \or
+ \ifcase#2\or
+ \strippedcsname\firstoftwoarguments
+ \or
+ \strippedcsname\secondoftwoarguments
+ \else
+ \strippedcsname\gobbletwoarguments
+ \fi
+ \or
+ \ifcase#2\or
+ \strippedcsname\firstofthreearguments
+ \or
+ \strippedcsname\secondofthreearguments
+ \or
+ \strippedcsname\thirdofthreearguments
+ \else
+ \strippedcsname\gobblethreearguments
+ \fi
+ \or
+ \ifcase#2\or
+ \strippedcsname\firstoffourarguments
+ \or
+ \strippedcsname\secondoffourarguments
+ \or
+ \strippedcsname\thirdoffourarguments
+ \or
+ \strippedcsname\fourthoffourarguments
+ \else
+ \strippedcsname\gobblefourarguments
+ \fi
+ \or
+ \ifcase#2\or
+ \strippedcsname\firstoffivearguments
+ \or
+ \strippedcsname\secondoffivearguments
+ \or
+ \strippedcsname\thirdoffivearguments
+ \or
+ \strippedcsname\fourthoffivearguments
+ \or
+ \strippedcsname\fifthoffivearguments
+ \else
+ \strippedcsname\gobblefivearguments
+ \fi
+ \fi}
+
\def\filterfromvalue#1#2#3% value max n
{\@EA\@EAEAEA\csname % we use the fact that an
\@EA\ifx\csname#1\endcsname\relax % undefined cs has become \relax
\strippedcsname\gobbleoneargument % which we then gobble here
\else
- \ifcase#2\or
- \ifcase#3\or
- \strippedcsname\firstofoneargument
- \else
- \strippedcsname\gobbleoneargument
- \fi
- \or
- \ifcase#3\or
- \strippedcsname\firstoftwoarguments
- \or
- \strippedcsname\secondoftwoarguments
- \else
- \strippedcsname\gobbletwoarguments
- \fi
- \or
- \ifcase#3\or
- \strippedcsname\firstofthreearguments
- \or
- \strippedcsname\secondofthreearguments
- \or
- \strippedcsname\thirdofthreearguments
- \else
- \strippedcsname\gobblethreearguments
- \fi
- \or
- \ifcase#3\or
- \strippedcsname\firstoffourarguments
- \or
- \strippedcsname\secondoffourarguments
- \or
- \strippedcsname\thirdoffourarguments
- \or
- \strippedcsname\fourthoffourarguments
- \else
- \strippedcsname\gobblefourarguments
- \fi
- \or
- \ifcase#3\or
- \strippedcsname\firstoffivearguments
- \or
- \strippedcsname\secondoffivearguments
- \or
- \strippedcsname\thirdoffivearguments
- \or
- \strippedcsname\fourthoffivearguments
- \or
- \strippedcsname\fifthoffivearguments
- \else
- \strippedcsname\gobblefivearguments
- \fi
- \fi
+ \dofilterfromstr{#2}{#3}%
\fi
\endcsname\csname#1\endcsname}
+\def\filterfromnext#1#2% max n {..}{..}{..}{..}
+ {\csname\dofilterfromstr{#1}{#2}\endcsname}
+
%D \macros
%D {definemeasure}
%D
diff --git a/Master/texmf-dist/tex/context/base/syst-gen.tex b/Master/texmf-dist/tex/context/base/syst-gen.tex
index 25e5390afd1..71e156b629b 100644
--- a/Master/texmf-dist/tex/context/base/syst-gen.tex
+++ b/Master/texmf-dist/tex/context/base/syst-gen.tex
@@ -13,6 +13,7 @@
% nagaan : \ifinstringelse in syst-ext.tex
% do => p! dodo pp! dododo ppp!
+% todo: \donetrue etc local maken
%D The following macros are responsible for the interaction
%D with \CONTEXT. These macros have proven their use. These
@@ -345,6 +346,7 @@
\dimendef\!!dimenh=14 %skipdef\!!skipc=4
\dimendef\!!dimeni=16 %skipdef\!!skipd=6
\dimendef\!!dimenj=18 %skipdef\!!skipe=8
+ \dimendef\!!dimenk=20 %skipdef\!!skipf=10
\let\!!stringa=\empty \let\!!stringb=\empty \let\!!stringc=\empty
\let\!!stringd=\empty \let\!!stringe=\empty \let\!!stringf=\empty
@@ -403,7 +405,9 @@
%D \type{\unprotect}, one can use \type{\@EA} as equivalent
%D of \type{\expandafter}.
-\let\@EA =\expandafter
+\let\@NX\noexpand
+\let\@EA\expandafter
+
\def\@EAEA {\expandafter\expandafter}
\def\@EAEAEA{\expandafter\expandafter\expandafter}
@@ -441,7 +445,7 @@
\newtoks\everysafeexpanded
-\long\def\safeexpanded#1%
+\long\def\safeexpanded#1% why the \noexpand
{\begingroup
\the\everysafeexpanded\long\xdef\@@expanded{\noexpand#1}%
\endgroup
@@ -2243,7 +2247,7 @@
{\let\expandedaction\noexpandedaction}
%D \macros
-%D {getfirstcharacter,firstcharacter, doiffirstcharacter}
+%D {getfirstcharacter, firstcharacter, remainingcharacters, doiffirstcharacter}
%D
%D Sometimes the action to be undertaken depends on the
%D next character. This macro get this character and puts it in
@@ -2257,12 +2261,13 @@
%D complicated arguments, for instance arguments that
%D consist of two or more expandable tokens.
-\def\dogetfirstcharacter#1#2\\%
- {\def\firstcharacter{#1}}
+\def\dogetfirstcharacter#1#2\relax
+ {\def\firstcharacter{#1}%
+ \def\remainingcharacters{#2}}
\def\getfirstcharacter#1%
{\edef\!!stringa{#1}%
- \expandafter\dogetfirstcharacter\!!stringa\\}
+ \expandafter\dogetfirstcharacter\!!stringa\relax}
\def\doiffirstcharelse#1#2% char string
% kort (maar onleesbaar)
@@ -2537,7 +2542,7 @@
%D Even more important is that this alternative is fully
%D expandable!
-\long\def\doifnumberelse#1%
+\long\def\doifnumberelse#1% does not accept counters
{\ifcase0\ifcase1#1\or\or\or\or\or\or\or\or\or\else1\fi\space
\expandafter\secondoftwoarguments
\else
@@ -3001,6 +3006,112 @@
\def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\empty\@relax@}
\def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\empty\@relax@}
+%D When someone asked on the mailing list if it's possible to
+%D use the current value of a parameter, Taco posted a small module. His
+%D method had the disadvantage of making all assignments expanded and thereby
+%D fragile. The following alternative uses a prefix.
+
+%D \macros{currentvalue}
+%D
+%D Just in case a \type{\getparameter} argument itself ends up
+%D inside a \type{\write} or other expandable location, our
+%D new macro needs a default value.
+
+\let\currentvalue\empty
+
+\def\p!n!doassign#1#2\@relax@#3=#4=#5#6\@relax@% normal
+ {\ifx#5\empty
+ \@EA\xshowassignerror
+ \else\ifx#5=%
+ \@EAEAEA#1%
+ \else
+ \@EAEAEA\xshowassignerror
+ \fi\fi
+ {#2}{#3}{#4}}
+
+\beginTEX
+
+\def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@
+ {\ifx#5\empty
+ \@EA\xshowassignerror
+ \else\ifx#5=%
+ \@EA\ifx\csname#2#3\endcsname\relax
+ \let\currentvalue\empty
+ \else
+ \@EA\let\@EA\currentvalue\csname#2#3\endcsname
+ \fi
+ \@EAEAEA#1%
+ \else
+ \@EAEAEA\xshowassignerror
+ \fi\fi
+ {#2}{#3}{#4}}
+
+\endTEX
+
+\beginETEX
+
+\def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@
+ {\ifx#5\empty
+ \@EA\xshowassignerror
+ \else\ifx#5=%
+ \ifcsname#2#3\endcsname
+ \@EA\let\@EA\currentvalue\csname#2#3\endcsname
+ \else
+ \let\currentvalue\empty
+ \fi
+ \@EAEAEA#1%
+ \else
+ \@EAEAEA\xshowassignerror
+ \fi\fi
+ {#2}{#3}{#4}}
+
+\endETEX
+
+%D We default to:
+
+\let\p!doassign\p!n!doassign
+
+%D And set:
+
+\let\currentvalue\empty
+
+%D \macros {expandparameters}
+%D
+%D Example usage:
+%D
+%D \startbuffer
+%D \getparameters[taco][name=taco]
+%D \convertcommand\taconame\to\ascii \ascii
+%D \expandparameters \getparameters[taco][name=\currentvalue\space hoekwater]
+%D \convertcommand\taconame\to\ascii \ascii
+%D \getparameters[taco][name=\currentvalue\space hoekwater]
+%D \convertcommand\taconame\to\ascii \ascii
+%D \stopbuffer
+%D
+%D \typebuffer
+%D \startlines
+%D \getbuffer
+%D \stoplines
+
+%D Here we hook in the code (beware, this is the optimized get **):
+
+\def\xdoget@n@parameters#1]%
+ {\xprocesscommaitem#1,],\@relax@}
+
+\def\xdoget@e@parameters#1]%
+ {\let\dosetnvalue\dosetvalue
+ \let\dosetvalue\dosetevalue
+ \let\p!doassign\p!e!doassign
+ \xprocesscommaitem#1,],\@relax@
+ \let\p!doassign\p!n!doassign
+ \let\dosetvalue\dosetnvalue
+ \let\xdogetparameters\xdoget@n@parameters
+ \let\currentvalue\empty}
+
+\let\xdogetparameters\xdoget@n@parameters % **
+
+\def\expandparameters{\let\xdogetparameters\xdoget@e@parameters}
+
%D \macros
%D {getemptyparameters}
%D
@@ -3145,9 +3256,9 @@
\def\p!dogetcommalistsize#1%
{\advance\commalistcounter\plusone}
-\def\getcommalistsize[#1]%
+\def\getcommalistsize#1]% don't loose [{#1}]
{\commalistcounter\zerocount
- \processcommalist[#1]\p!dogetcommalistsize % was [{#1}]
+ \processcommalist#1]\p!dogetcommalistsize % was [{#1}]
\edef\commalistsize{\the\commalistcounter}}
\def\getcommacommandsize[#1]%
@@ -3694,40 +3805,31 @@
%D Now a whole bunch of variables like \type{\@@xxalfavariable}
%D and \type{\@@xxbetavariable} is defined.
-\def\dosingleargumentwithset#1%
- {\def\dodosinglewithset[##1]%
- {\def\dododosinglewithset####1%
- {#1[####1]}%
- \processcommalist[##1]\dododosinglewithset}%
- \dosingleargument\dodosinglewithset}%
+% \def\dosingleargumentwithset#1%
+% {\def\dodosinglewithset[##1]%
+% {\def\dododosinglewithset####1{#1[####1]}%
+% \processcommalist[##1]\dododosinglewithset}%
+% \dosingleargument\dodosinglewithset}%
\def\dodoublewithset#1#2%
{\def\dododoublewithset[##1][##2]%
- {\doifnot{##1}{}
- {\def\dodododoublewithset####1%
- {#2[####1][##2]}%
+ {\doifsomething{##1}
+ {\def\dodododoublewithset####1{#2[####1][##2]}%
\processcommalist[##1]\dodododoublewithset}}%
- #1\dododoublewithset}%
-
-\def\dodoubleemptywithset%
- {\dodoublewithset\dodoubleempty}
+ #1\dododoublewithset}
-\def\dodoubleargumentwithset%
- {\dodoublewithset\dodoubleargument}
+\def\dodoubleemptywithset {\dodoublewithset\dodoubleempty}
+\def\dodoubleargumentwithset{\dodoublewithset\dodoubleargument}
\def\dotriplewithset#1#2%
{\def\dodotriplewithset[##1][##2][##3]%
- {\doifnot{##1}{}
- {\def\dododotriplewithset####1%
- {#2[####1][##2][##3]}%
+ {\doifsomething{##1}
+ {\def\dododotriplewithset####1{#2[####1][##2][##3]}%
\processcommalist[##1]\dododotriplewithset}}%
- #1\dodotriplewithset}%
+ #1\dodotriplewithset}
-\def\dotripleemptywithset%
- {\dotriplewithset\dotripleempty}
-
-\def\dotripleargumentwithset%
- {\dotriplewithset\dotripleargument}
+\def\dotripleemptywithset {\dotriplewithset\dotripleempty}
+\def\dotripleargumentwithset{\dotriplewithset\dotripleargument}
%D \macros
%D {strippedcsname}
@@ -4003,76 +4105,74 @@
%D \type {\if} and friends, in practice we will use a
%D slightly more complicated macro.
-\let\normalif \if
-\let\normalifx \ifx
-\let\normalifnum \ifnum
-\let\normalifdim \ifdim
-\let\normalifcat \ifcat
-\let\normalifcase \ifcase
-\let\normalifcsname \ifcsname
-\let\normalifhmode \ifhmode
-\let\normalifvmode \ifvmode
-\let\normalor \or
-\let\normalelse \else
-\let\normalfi \fi
+\let\normalif \if
+\let\normalifcat \ifcat
+\let\normalifnum \ifnum
+\let\normalifdim \ifdim
+\let\normalifodd \ifodd
+\let\normalifvmode \ifvmode
+\let\normalifhmode \ifhmode
+\let\normalifmmode \ifmmode
+\let\normalifinner \ifinner
+\let\normalifvoid \ifvoid
+\let\normalifhbox \ifhbox
+\let\normalifvbox \ifvbox
+\let\normalifx \ifx
+\let\normalifeof \ifeof
+\let\normaliftrue \iftrue
+\let\normaliffalse \iffalse
+\let\normalifcase \ifcase
+\let\normalifdefined \ifdefined
+\let\normalifcsname \ifcsname
+\let\normaliffontchar \iffontchar
+\let\normalifincsname \ifincsname
+\let\normalifprimitive\ifprimitive
+\let\normalifabsnum \ifabsnum
+\let\normalifabsdim \ifabsdim
+
+\let\normalelse \else
+\let\normalor \or
+\let\normalfi \fi
+
+\newtoks \everyrobusttest
+
+\everyrobusttest
+ {\let\if \relax
+ \let\ifcat \relax
+ \let\ifnum \relax
+ \let\ifdim \relax
+ \let\ifodd \relax
+ \let\ifvmode \relax
+ \let\ifhmode \relax
+ \let\ifmmode \relax
+ \let\ifinner \relax
+ \let\ifvoid \relax
+ \let\ifhbox \relax
+ \let\ifvbox \relax
+ \let\ifx \relax
+ \let\ifeof \relax
+ \let\iftrue \relax
+ \let\iffalse \relax
+ \let\ifcase \relax
+ \let\ifdefined \relax
+ \let\ifcsname \relax
+ \let\iffontchar \relax
+ \let\ifincsname \relax
+ \let\ifprimitive\relax
+ \let\ifabsnum \relax
+ \let\ifabsdim \relax
+ \let\else \relax
+ \let\or \relax
+ \let\fi \relax}
\def\beginrobusttest
{\begingroup
- \let\if \relax
- \let\ifx \relax
- \let\ifnum \relax
- \let\ifdim \relax
- \let\ifcat \relax
- \let\ifcase \relax
- \let\ifcsname\relax
- \let\or \relax
- \let\else \relax
- \let\fi \relax}
+ \the\everyrobusttest}
\let\endrobusttest\endgroup
-% \def\dogetgroupargument#1#2%
-% {\def\nextnextargument%
-% {\normalifx\nextargument\bgroup
-% \endrobusttest
-% \let\expectedarguments\noexpectedarguments
-% \def\nextargument{#1\dodogetargument}%
-% %\normalelse\normalifx\nextargument\lineending % this can be an option
-% % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% %\normalelse\normalifx\nextargument\blankspace % but may never be default
-% % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% \normalelse
-% \endrobusttest
-% \ifnum\expectedarguments>\noexpectedarguments
-% \showargumenterror{\number\expectedarguments}{\number\inputlineno}%
-% \fi
-% \let\expectedarguments\noexpectedarguments
-% \def\nextargument{#2\dodogetargument{}}%
-% \normalfi%\normalfi\normalfi % so let's get rid of it
-% \nextargument}%
-% \beginrobusttest
-% \futurelet\nextargument\nextnextargument}
-
-% \def\dogetgroupargument#1#2%
-% {\def\nextnextargument%
-% {\normalifx\nextargument\bgroup
-% \endrobusttest
-% \noshowargumenterror
-% \def\nextargument{#1\dodogetargument}%
-% %\normalelse\normalifx\nextargument\lineending % this can be an option
-% % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% %\normalelse\normalifx\nextargument\blankspace % but may never be default
-% % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% \normalelse
-% \endrobusttest
-% \doshowargumenterror
-% \def\nextargument{#2\dodogetargument{}}%
-% \normalfi%\normalfi\normalfi % so let's get rid of it
-% \nextargument}%
-% \beginrobusttest
-% \futurelet\nextargument\nextnextargument}
-
-% we need to use an \ifcase in order to honor the \normal...
+%D We can add additional definitions later when we have defined
+%D \type {\appendtoks}.
\def \permitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=0 }
\def\dontpermitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=1 }
@@ -4279,11 +4379,16 @@
\chardef\statuswidth=15
\chardef\statuswrite=16
-\def\writestring
- {\immediate\write\statuswrite}
+\newtoks\everywritestring
+
+\def\writestring#1%
+ {\begingroup
+ \the\everywritestring
+ \immediate\write\statuswrite{#1}%
+ \endgroup}
\def\writeline
- {\writestring{}}
+ {\immediate\write\statuswrite{}}
%D First we present the normal \TEX\ variant, later we will
%D show the \ETEX-way.
@@ -4312,7 +4417,6 @@
\space\space\space\space\space\space\space
\space\space\space\space\space\space\space
\space\space\space\space\space\space\end
- %\expanded{\writestring{\the\scratchtoks\space:\space#2}}%
\@EA\writestring\@EA{\the\scratchtoks\space:\space#2}%
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/syst-new.tex b/Master/texmf-dist/tex/context/base/syst-new.tex
index 0172745bf4b..6112b6f6f83 100644
--- a/Master/texmf-dist/tex/context/base/syst-new.tex
+++ b/Master/texmf-dist/tex/context/base/syst-new.tex
@@ -820,4 +820,63 @@
\ifx\torange\empty\let\torange\fromrange\fi
\dostepwiserecurse\fromrange\torange1{#2{\recurselevel}}}
+%D \macros {uncompresslist}
+%D
+%D When given a list like \type{1,4-7,9} as argument, this macro
+%D will store the expanded commalist in \type{\uncompressedlist}.
+%D
+%D \startbuffer
+%D \def\MojcaHasToDoTheTasks[#1]#2%
+%D {{\uncompresslist[#1]%
+%D \def\processitem##1{I have to do ##1 #2\par}%
+%D \processcommacommand[\uncompressedlist]\processitem}}
+%D
+%D \MojcaHasToDoTheTasks [1-4,7,9-11] {until tomorrow}
+%D \stopbuffer
+%D
+%D Here is an example of how to use \type {\uncompresslist}:
+%D \typebuffer
+%D
+%D The output of this is:
+%D
+%D \getbuffer
+
+\beginETEX \numexpr
+
+\def\uncompresslist[#1]% by TH
+ {\let\uncompressedlist\empty
+ \def\docompressedlistitem##1-##2-%
+ {\@EA\dorecurse\@EA
+ {\the\numexpr1+##2-##1\relax}%
+ {\@EA\appendtocommalist\@EA{\the\numexpr##1-1+####1\relax}\uncompressedlist}}%
+ \def\douncompresslist##1%
+ {\doifinstringelse{-}{##1}
+ {\docompressedlistitem##1-}
+ {\appendtocommalist{##1}\uncompressedlist}}%
+ \processcommalist[#1]\douncompresslist}
+
+\endETEX
+
+\beginTEX
+
+\def\uncompresslist[#1]%
+ {\def\uncompressedlist{#1}}
+
+\endTEX
+
+%D \macros
+%D {ignoreimplicitspaces}
+%D
+%D \startbuffer
+%D \def\whatever[#1]{\expanded{\definedfont[#1 at 12pt]}\ignorespaces}
+%D {a\whatever[Serif]b a\whatever[Serif] b a\whatever[Serif]\space b}
+%D \def\whatever[#1]{\expanded{\definedfont[#1 at 12pt]}\ignoreimplicitspaces}
+%D {a\whatever[Serif]b a\whatever[Serif] b a\whatever[Serif]\space b}
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+\def\ignoreimplicitspaces
+ {\doifnextcharelse\relax\relax\relax}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/syst-pln.tex b/Master/texmf-dist/tex/context/base/syst-pln.tex
index e60a736444d..4259eb04ee2 100644
--- a/Master/texmf-dist/tex/context/base/syst-pln.tex
+++ b/Master/texmf-dist/tex/context/base/syst-pln.tex
@@ -374,21 +374,15 @@
%D Extra dimension parameters.
-\newskip \bigskipamount
-\newdimen \jot
-\newskip \medskipamount
-\newskip \normalbaselineskip
-\newskip \normallineskip
-\newdimen \normallineskiplimit
-\newskip \smallskipamount
-
-\bigskipamount = 12pt plus 4pt minus 4pt
-\jot = 3pt
-\medskipamount = 6pt plus 2pt minus 2pt
-\normalbaselineskip = 12pt
-\normallineskip = 1pt
-\normallineskiplimit = 0pt
-\smallskipamount = 3pt plus 1pt minus 1pt
+\newskip \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt
+\newskip \medskipamount \medskipamount = 6pt plus 2pt minus 2pt
+\newskip \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt
+
+\newskip \normalbaselineskip \normalbaselineskip = 12pt
+\newskip \normallineskip \normallineskip = 1pt
+\newdimen \normallineskiplimit \normallineskiplimit = 0pt
+
+\newdimen \jot \jot = 3pt
%D The following shortcuts are rather standard:
@@ -595,7 +589,7 @@
{\advance\leftskip \parindent
\advance\rightskip\parindent}
-%D Useful, used too, but sometimes dangerous:
+%D Useful, used too, but sometimes dangerous:
\def\leavevmode{\unhbox\voidb@x}
diff --git a/Master/texmf-dist/tex/context/base/syst-xtx.tex b/Master/texmf-dist/tex/context/base/syst-xtx.tex
index 7466725c769..af6d6e8dffd 100644
--- a/Master/texmf-dist/tex/context/base/syst-xtx.tex
+++ b/Master/texmf-dist/tex/context/base/syst-xtx.tex
@@ -24,10 +24,19 @@
\immediate\openin\scratchread=xplain.tex \ifeof\scratchread
% no initialization file
\else
- \input xplain.tex
+ \input xplain.tex\relax
\fi
\else
- \input unicode-letters.tex
+ \input unicode-letters.tex\relax
+ % begin of patch (turkish patterns need this)
+ \begingroup
+ \catcode`\{=1 \catcode`\}=2 \catcode`\#=6
+ \def\C #1 #2 #3 {\global\uccode"#1="#2 \global\lccode"#1="#3 } % case mappings (non-letter)
+ \def\L #1 #2 #3 {\global\catcode"#1=11 \C #1 #2 #3 } % letter with case mappings
+ \L 201C 201C 201C
+ \L 201D 201D 201D
+ \endgroup
+ % end of patch
\fi
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/type-akb.tex b/Master/texmf-dist/tex/context/base/type-akb.tex
index b49a8f25f8f..7c02144d5b2 100644
--- a/Master/texmf-dist/tex/context/base/type-akb.tex
+++ b/Master/texmf-dist/tex/context/base/type-akb.tex
@@ -89,8 +89,9 @@
\stoptypescript
-\starttypescript [adobekb] [ec]
+\starttypescript [adobekb,berry] [ec]
+\loadmapfile[8r-base.map]
\loadmapfile[ec-base.map]
\definefontsynonym [ec-utmr8a] [ptmr8t] [encoding=ec]
@@ -149,7 +150,7 @@
% the following fonts are normally not present on tex live
-\starttypescript [adobekb] [texnansi]
+\starttypescript [adobekb,berry] [texnansi]
\loadmapfile[texnansi-base.map]
@@ -207,6 +208,46 @@
\stoptypescript
+\starttypescript [adobekb,berry] [t5] % there are no adobe metrics
+
+\loadmapfile[t5-base.map]
+
+\definefontsynonym [t5-utmr8a] [utmr8v] [encoding=t5]
+\definefontsynonym [t5-utmri8a] [utmri8v] [encoding=t5]
+\definefontsynonym [t5-utmb8a] [utmb8v] [encoding=t5]
+\definefontsynonym [t5-utmbi8a] [utmbi8v] [encoding=t5]
+
+\definefontsynonym [t5-utmr8a-slanted-167] [utmro8v] [encoding=t5]
+\definefontsynonym [t5-utmb8a-slanted-167] [utmbo8v] [encoding=t5]
+
+\definefontsynonym [t5-uhvr8a] [uhvr8v] [encoding=t5]
+\definefontsynonym [t5-uhvro8a] [uhvro8v] [encoding=t5]
+\definefontsynonym [t5-uhvb8a] [uhvb8v] [encoding=t5]
+\definefontsynonym [t5-uhvbo8a] [uhvbo8v] [encoding=t5]
+
+\definefontsynonym [t5-ucrr8a] [ucrr8v] [encoding=t5]
+\definefontsynonym [t5-ucrb8a] [ucrb8v] [encoding=t5]
+\definefontsynonym [t5-ucrro8a] [ucrro8v] [encoding=t5]
+\definefontsynonym [t5-ucrbo8a] [ucrbo8v] [encoding=t5]
+
+\definefontsynonym [t5-uplr8a] [uplr8v] [encoding=t5]
+\definefontsynonym [t5-uplri8a] [uplri8v] [encoding=t5]
+\definefontsynonym [t5-uplb8a] [uplb8v] [encoding=t5]
+\definefontsynonym [t5-uplbi8a] [uplbi8v] [encoding=t5]
+\definefontsynonym [t5-uplr8a-slanted-167] [uplro8v] [encoding=t5]
+\definefontsynonym [t5-uplb8a-slanted-167] [uplbo8v] [encoding=t5]
+\definefontsynonym [t5-uplr8a-capitalized-800] [uplr8v] [encoding=t5]
+
+\definefontsynonym [t5-ubkl8a] [ubkl8v] [encoding=t5]
+\definefontsynonym [t5-ubkli8a] [ubkli8v] [encoding=t5]
+\definefontsynonym [t5-ubkd8a] [ubkd8v] [encoding=t5]
+\definefontsynonym [t5-ubkdi8a] [ubkdi8v] [encoding=t5]
+\definefontsynonym [t5-ubkl8a-slanted-167] [ubklo8v] [encoding=t5]
+\definefontsynonym [t5-ubkd8a-slanted-167] [ubkdo8v] [encoding=t5]
+\definefontsynonym [t5-ubkl8a-capitalized-800] [ubkl8v] [encoding=t5]
+
+\stoptypescript
+
\stoptypescriptcollection
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-buy.tex b/Master/texmf-dist/tex/context/base/type-buy.tex
index 53a178d6e24..5f10bb95ee6 100644
--- a/Master/texmf-dist/tex/context/base/type-buy.tex
+++ b/Master/texmf-dist/tex/context/base/type-buy.tex
@@ -111,16 +111,16 @@
\definefontsynonym [MathItalic] [LucidaNewMath-AltDemiItalic]
\definefontsynonym [MathSymbol] [LucidaNewMath-Symbol-Demi]
\definefontsynonym [MathAlpha] [LucidaNewMath-Arrows-Demi]
- \definefontsynonym [MathBeta] [LucidaNewMath-DemiBold]
+ \definefontsynonym [MathBeta] [LucidaNewMath-Demi]
\stoptypescript
\starttypescript [bfmath] [lucida] [name]
- \definefontsynonym [MathRomanBold] [LucidaNewMath-Demibold]
+ \definefontsynonym [MathRomanBold] [LucidaNewMath-Demi]
\definefontsynonym [MathExtensionBold] [LucidaNewMath-Extension]
\definefontsynonym [MathItalicBold] [LucidaNewMath-AltDemiItalic]
\definefontsynonym [MathSymbolBold] [LucidaNewMath-Symbol-Demi]
\definefontsynonym [MathAlphaBold] [LucidaNewMath-Arrows-Demi]
- \definefontsynonym [MathBetaBold] [LucidaNewMath-DemiBold] % ??
+ \definefontsynonym [MathBetaBold] [LucidaNewMath-Demi]
\stoptypescript
\starttypescript [handwriting] [lucida] [name]
@@ -172,7 +172,7 @@
\definefontsynonym [LucidaNewMath-AltDemiItalic] [lbmdo]
\definefontsynonym [LucidaNewMath-Arrows-Demi] [lbmad]
\definefontsynonym [LucidaNewMath-Extension] [lbme]
- \definefontsynonym [LucidaNewMath-DemiBold] [lbmd]
+ \definefontsynonym [LucidaNewMath-Demi] [lbmd]
\definefontsynonym [LucidaNewMath-DemiItalic] [lbmdi]
\definefontsynonym [LucidaNewMath-Symbol-Demi] [lbmsd]
\stoptypescript
@@ -887,7 +887,6 @@
\stoptypescript
-
\stoptypescriptcollection
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-cow.tex b/Master/texmf-dist/tex/context/base/type-cow.tex
new file mode 100644
index 00000000000..027f6b6b7bd
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-cow.tex
@@ -0,0 +1,83 @@
+%D \module
+%D [ file=type-cow,
+%D version=2006.06.23,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Cow Fonts,
+%D author=Hans Hagen,
+%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.
+
+%D The cow fonts are a project of Duane Bibby, Hans Hagen and Taco
+%D Hoekwater.
+
+\starttypescriptcollection[cow]
+
+\starttypescript [math,serif] [cow,sheep] [default]
+ \setups[font:fallback:serif]
+ \usemathcollection[cow]
+ \loadmapfile[koeieletters.map]
+ \definefontsynonym [Serif] [Cows] [encoding=\typescriptthree]
+ \definefontsynonym [SerifContour] [CowsContour] [encoding=\typescriptthree]
+ \definefontsynonym [SerifLogo] [CowsLogo] [encoding=\typescriptthree]
+ \definefontsynonym [SerifLogoContour][CowsLogoContour] [encoding=\typescriptthree]
+ \definefontsynonym [MathRoman] [CowsMathRoman] [encoding=\typescriptthree]
+ \definefontsynonym [MathItalic] [CowsMathItalic] [encoding=\typescriptthree]
+ \definefontsynonym [MathSymbol] [CowsMathSymbol] [encoding=\typescriptthree]
+ \definefontsynonym [MathExtension] [CowsMathExtensions][encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [math,serif] [sheep] [default]
+ \setups[font:fallback:serif]
+ \usemathcollection[cow]
+ \loadmapfile[koeieletters.map]
+ \definefontsynonym [Serif] [Sheep] [encoding=\typescriptthree]
+ \definefontsynonym [SerifContour] [SheepContour] [encoding=\typescriptthree]
+ \definefontsynonym [SerifLogo] [SheepLogo] [encoding=\typescriptthree]
+ \definefontsynonym [SerifLogoContour][SheepLogoContour] [encoding=\typescriptthree]
+ \definefontsynonym [MathRoman] [SheepMathRoman] [encoding=\typescriptthree]
+ \definefontsynonym [MathItalic] [SheepMathItalic] [encoding=\typescriptthree]
+ \definefontsynonym [MathSymbol] [SheepMathSymbol] [encoding=\typescriptthree]
+ \definefontsynonym [MathExtension] [SheepMathExtensions][encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [all] [cow,sheep] [default]
+ \definefontsynonym [Cows] [koeielett]
+ \definefontsynonym [CowsContour] [koeielett-contour]
+ \definefontsynonym [CowsLogo] [koeielogos]
+ \definefontsynonym [CowsLogoContour] [koeielogos-contour]
+ \definefontsynonym [CowsMathRoman] [koeielett]
+ \definefontsynonym [CowsMathItalic] [koeieletter-mi]
+ \definefontsynonym [CowsMathSymbol] [koeieletter-sy]
+ \definefontsynonym [CowsMathExtensions][koeieletter-ex]
+\stoptypescript
+
+\starttypescript [all] [sheep] [default]
+ \definefontsynonym [Sheep] [koeielett]
+ \definefontsynonym [SheepContour] [koeielett-contour]
+ \definefontsynonym [SheepLogo] [koeielogos]
+ \definefontsynonym [SheepLogoContour] [koeielogos-contour]
+ \definefontsynonym [SheepMathRoman] [koeielettx]
+ \definefontsynonym [SheepMathItalic] [koeieletter-mi]
+ \definefontsynonym [SheepMathSymbol] [koeieletter-syx]
+ \definefontsynonym [SheepMathExtensions][koeieletter-ex]
+\stoptypescript
+
+\starttypescript [cow] [default]
+ \definetypeface [cow] [ss][serif][cow] [default][encoding=default]
+ \definetypeface [cow] [mm][math] [cow] [default][encoding=default]
+ \definetypeface [cow] [tt][mono] [modern][default][encoding=default,rscale=.85]
+\stoptypescript
+
+\starttypescript [sheep] [default]
+ \definetypeface [sheep][ss][serif][sheep] [default][encoding=default]
+ \definetypeface [sheep][mm][math] [sheep] [default][encoding=default]
+ \definetypeface [sheep][tt][mono] [modern][default][encoding=default,rscale=.85]
+\stoptypescript
+
+\stoptypescriptcollection
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-dis.tex b/Master/texmf-dist/tex/context/base/type-dis.tex
index c4cbd6f96c1..55bee181b12 100644
--- a/Master/texmf-dist/tex/context/base/type-dis.tex
+++ b/Master/texmf-dist/tex/context/base/type-dis.tex
@@ -11,57 +11,14 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D Unfortunately not all latin modern metrics ship the way we like:
-%D
-%D Some day I will replace cmr10 etc by their full names.
+%D The next section is obsolete. Although we prefer the original metrics
+%D it seems that distributions no longer ship the u-variants, which means
+%D that users (if they want) need to fall back to the p-variants. The usual
+%D font mess.
-\starttypescriptcollection[distributed fonts]
-
-\starttypescript[all][modern,latin-modern][all]
-
- % fallbacks, no math in latin modern
-
- \definefontsynonym[lmbsy10] [cmbsy10]
- \definefontsynonym[lmbsy5] [cmbsy5]
- \definefontsynonym[lmbsy6] [cmbsy7]
- \definefontsynonym[lmbsy7] [cmbsy7]
- \definefontsynonym[lmbsy8] [cmbsy7]
- \definefontsynonym[lmbsy9] [cmbsy10]
- \definefontsynonym[lmdunh10][cmdunh10]
- \definefontsynonym[lmex10] [cmex10]
- \definefontsynonym[lmex7] [cmex10]
- \definefontsynonym[lmex8] [cmex10]
- \definefontsynonym[lmex9] [cmex10]
- \definefontsynonym[lmff10] [cmff10]
- \definefontsynonym[lmfi10] [cmfi10]
- \definefontsynonym[lmfib8] [cmfib8]
- \definefontsynonym[lmmi10] [cmmi10]
- \definefontsynonym[lmmi12] [cmmi12]
- \definefontsynonym[lmmi5] [cmmi5]
- \definefontsynonym[lmmi6] [cmmi6]
- \definefontsynonym[lmmi7] [cmmi7]
- \definefontsynonym[lmmi8] [cmmi8]
- \definefontsynonym[lmmi9] [cmmi9]
- \definefontsynonym[lmmib10] [cmmib10]
- \definefontsynonym[lmmib5] [cmmib5]
- \definefontsynonym[lmmib6] [cmmib7]
- \definefontsynonym[lmmib7] [cmmib7]
- \definefontsynonym[lmmib8] [cmmib7]
- \definefontsynonym[lmmib9] [cmmib10]
- \definefontsynonym[lmsy10] [cmsy10]
- \definefontsynonym[lmsy5] [cmsy5]
- \definefontsynonym[lmsy6] [cmsy6]
- \definefontsynonym[lmsy7] [cmsy7]
- \definefontsynonym[lmsy8] [cmsy8]
- \definefontsynonym[lmsy9] [cmsy9]
- \definefontsynonym[lmtex10] [cmtex10]
- \definefontsynonym[lmtex8] [cmtex8]
- \definefontsynonym[lmtex9] [cmtex9]
-
-\stoptypescript
+\endinput
-%D For those who want to use the existing tfm and vf files we
-%D provide:
+\starttypescriptcollection[distributed fonts]
\starttypescript [berry] [8r]
diff --git a/Master/texmf-dist/tex/context/base/type-enc.tex b/Master/texmf-dist/tex/context/base/type-enc.tex
index af6c6974629..435affba740 100644
--- a/Master/texmf-dist/tex/context/base/type-enc.tex
+++ b/Master/texmf-dist/tex/context/base/type-enc.tex
@@ -507,10 +507,10 @@
\starttypescript [sans] [modern,computer-modern,latin-modern] % [default]
\definefontsynonym [ComputerModernSans] [LMSans-Regular]
- \definefontsynonym [ComputerModernSans-Italic] [LMSans-Italic]
+ \definefontsynonym [ComputerModernSans-Italic] [LMSans-Oblique]
\definefontsynonym [ComputerModernSans-Slanted] [LMSans-Oblique]
\definefontsynonym [ComputerModernSans-Bold] [LMSans-Bold]
- \definefontsynonym [ComputerModernSans-BoldItalic] [LMSans-BoldItalic]
+ \definefontsynonym [ComputerModernSans-BoldItalic] [LMSans-BoldOblique]
\definefontsynonym [ComputerModernSans-BoldSlanted] [LMSans-BoldOblique]
\definefontsynonym [ComputerModernSans-Caps] [LMSans-Regular] % [LMSans-CapsRegular]
\definefontsynonym [ComputerModernSans-CapsSlanted] [LMSans-Oblique] % [LMSans-CapsOblique]
@@ -555,6 +555,44 @@
\definefontsynonym [ComputerModernMath-Symbol-Bold] [cmbsy10]
\stoptypescript
+% Till we have cyrilic in lm:
+
+% \usetypescript[modern-base][t2a]
+% \setupbodyfont[modern,10pt]
+
+% \starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2]
+% \definefontsynonym [ComputerModern] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModern-Italic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModern-Slanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModern-Bold] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModern-BoldItalic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModern-BoldSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModern-Caps] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModern-CapsSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \stoptypescript
+
+% \starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2]
+% \definefontsynonym [ComputerModernSans] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernSans-Italic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernSans-Slanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernSans-Bold] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernSans-BoldItalic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernSans-BoldSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernSans-Caps] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernSans-CapsSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \stoptypescript
+
+% \starttypescript [modo] [computer-modern] [t2a,t2b,t2c,x2]
+% \definefontsynonym [ComputerModernMono] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernMono-Italic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernMono-Slanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernMono-Bold] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernMono-BoldItalic] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernMono-BoldSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernMono-Caps] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \definefontsynonym [ComputerModernMono-CapsSlanted] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
+% \stoptypescript
+
% Computer Concrete (AMS)
\starttypescript [serif] [concrete] [default]
@@ -820,30 +858,30 @@
\starttypescript [math] [antykwa-torunska] [default]
\definefontsynonym [AntykwaTorunska-Math-Letters-Regular] [rm-anttr]
- \definefontsynonym [AntykwaTorunska-Math-Letters-RegularItalic] [mi-anttr]
- \definefontsynonym [AntykwaTorunska-Math-Symbols-Regular] [sy-anttr]
+ \definefontsynonym [AntykwaTorunska-Math-Letters-RegularItalic] [mi-anttri]
+ \definefontsynonym [AntykwaTorunska-Math-Symbols-Regular] [sy-anttrz]
\definefontsynonym [AntykwaTorunska-Math-Extension-Regular] [ex-anttr]
\stoptypescript
\starttypescript [math] [antykwa-torunska-light] [default]
\definefontsynonym [AntykwaTorunska-Math-Letters-Light] [rm-anttl]
- \definefontsynonym [AntykwaTorunska-Math-Letters-LightItalic] [mi-anttl]
- \definefontsynonym [AntykwaTorunska-Math-Symbols-Light] [sy-anttl]
- \definefontsynonym [AntykwaTorunska-Math-Extension-Light] [ex-anttr] % [ex-anttl]
+ \definefontsynonym [AntykwaTorunska-Math-Letters-LightItalic] [mi-anttli]
+ \definefontsynonym [AntykwaTorunska-Math-Symbols-Light] [sy-anttlz]
+ \definefontsynonym [AntykwaTorunska-Math-Extension-Light] [ex-anttl]
\stoptypescript
\starttypescript [math] [antykwa-torunska-cond] [default]
\definefontsynonym [AntykwaTorunska-Math-Letters-CondRegular] [rm-anttcr]
- \definefontsynonym [AntykwaTorunska-Math-Letters-CondRegularItalic] [mi-anttcr]
- \definefontsynonym [AntykwaTorunska-Math-Symbols-CondRegular] [sy-anttcr]
- \definefontsynonym [AntykwaTorunska-Math-Extension-CondRegular] [ex-anttr]
+ \definefontsynonym [AntykwaTorunska-Math-Letters-CondRegularItalic] [mi-anttcri]
+ \definefontsynonym [AntykwaTorunska-Math-Symbols-CondRegular] [sy-anttcrz]
+ \definefontsynonym [AntykwaTorunska-Math-Extension-CondRegular] [ex-anttcr]
\stoptypescript
\starttypescript [math] [antykwa-torunska-lightcond] [default]
\definefontsynonym [AntykwaTorunska-Math-Letters-CondLight] [rm-anttcl]
- \definefontsynonym [AntykwaTorunska-Math-Letters-CondLightItalic] [mi-anttcl]
- \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttcl]
- \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttr] % [ex-anttl]
+ \definefontsynonym [AntykwaTorunska-Math-Letters-CondLightItalic] [mi-anttcli]
+ \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttclz]
+ \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttcl]
\stoptypescript
% Antykwa Poltawskiego (GUST)
@@ -859,38 +897,78 @@
% maybe this will change in Iwona-Math-Letters and Iwona-Math-Letters-Italic
-\starttypescript [sans] [iwona,iwona-light,iwona-medium] [texnansi,ec,qx,t5]
- \definefontsynonym[Iwona-Light] [\typescriptthree-iwonal] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Regular] [\typescriptthree-iwonar] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Medium] [\typescriptthree-iwonam] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Bold] [\typescriptthree-iwonab] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Heavy] [\typescriptthree-iwonah] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-LightItalic] [\typescriptthree-iwonali] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-RegularItalic] [\typescriptthree-iwonari] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-MediumItalic] [\typescriptthree-iwonami] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-BoldItalic] [\typescriptthree-iwonabi] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-HeavyItalic] [\typescriptthree-iwonahi] [encoding=\typescriptthree]
+\starttypescript [sans] [iwona-light,iwona,iwona-medium,iwona-heavy,iwona-light-cond,iwona-cond,iwona-medium-cond,iwona-heavy-cond] [texnansi,ec,el,qx,t5]
+ \definefontsynonym[Iwona-Light] [\typescriptthree-iwonal] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-Regular] [\typescriptthree-iwonar] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-Medium] [\typescriptthree-iwonam] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-Bold] [\typescriptthree-iwonab] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-Heavy] [\typescriptthree-iwonah] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-LightItalic] [\typescriptthree-iwonali] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-RegularItalic] [\typescriptthree-iwonari] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-MediumItalic] [\typescriptthree-iwonami] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-BoldItalic] [\typescriptthree-iwonabi] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-HeavyItalic] [\typescriptthree-iwonahi] [encoding=\typescriptthree]
+
+ \definefontsynonym[Iwona-CapsLight] [\typescriptthree-iwonalcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsRegular] [\typescriptthree-iwonarcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsMedium] [\typescriptthree-iwonamcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsBold] [\typescriptthree-iwonabcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsHeavy] [\typescriptthree-iwonahcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsLightItalic] [\typescriptthree-iwonalicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsRegularItalic] [\typescriptthree-iwonaricap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsMediumItalic] [\typescriptthree-iwonamicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsBoldItalic] [\typescriptthree-iwonabicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CapsHeavyItalic] [\typescriptthree-iwonahicap] [encoding=\typescriptthree]
+
+ \definefontsynonym[Iwona-CondLight] [\typescriptthree-iwonacl] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondRegular] [\typescriptthree-iwonacr] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondMedium] [\typescriptthree-iwonacm] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondBold] [\typescriptthree-iwonacb] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondHeavy] [\typescriptthree-iwonach] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondLightItalic] [\typescriptthree-iwonacli] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondRegularItalic] [\typescriptthree-iwonacri] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondMediumItalic] [\typescriptthree-iwonacmi] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondBoldItalic] [\typescriptthree-iwonacbi] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondHeavyItalic] [\typescriptthree-iwonachi] [encoding=\typescriptthree]
+
+ \definefontsynonym[Iwona-CondCapsLight] [\typescriptthree-iwonaclcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsRegular] [\typescriptthree-iwonacrcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsMedium] [\typescriptthree-iwonacmcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsBold] [\typescriptthree-iwonacbcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsHeavy] [\typescriptthree-iwonachcap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsLightItalic] [\typescriptthree-iwonaclicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsRegularItalic] [\typescriptthree-iwonacricap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsMediumItalic] [\typescriptthree-iwonacmicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsBoldItalic] [\typescriptthree-iwonacbicap] [encoding=\typescriptthree]
+ \definefontsynonym[Iwona-CondCapsHeavyItalic] [\typescriptthree-iwonachicap] [encoding=\typescriptthree]
\stoptypescript
\starttypescript [math] [iwona] [default]
\definefontsynonym [Iwona-Math-Letters-Regular] [rm-iwonar]
\definefontsynonym [Iwona-Math-Letters-RegularItalic] [mi-iwonari]
- \definefontsynonym [Iwona-Math-Symbols-Regular] [sy-iwonari]
+ \definefontsynonym [Iwona-Math-Symbols-Regular] [sy-iwonarz]
\definefontsynonym [Iwona-Math-Extension-Regular] [ex-iwonar]
\stoptypescript
\starttypescript [math] [iwona-light] [default]
- \definefontsynonym [Iwona-Math-Letters-Light] [rm-iwonal]
- \definefontsynonym [Iwona-Math-Letters-LightItalic] [mi-iwonali]
- \definefontsynonym [Iwona-Math-Symbols-Light] [sy-iwonali]
- \definefontsynonym [Iwona-Math-Extension-Light] [ex-iwonal]
+ \definefontsynonym [Iwona-Math-Letters-Light] [rm-iwonal]
+ \definefontsynonym [Iwona-Math-Letters-LightItalic] [mi-iwonali]
+ \definefontsynonym [Iwona-Math-Symbols-Light] [sy-iwonalz]
+ \definefontsynonym [Iwona-Math-Extension-Light] [ex-iwonal]
\stoptypescript
\starttypescript [math] [iwona-medium] [default]
- \definefontsynonym [Iwona-Math-Letters-Medium] [rm-iwonam]
- \definefontsynonym [Iwona-Math-Letters-MediumItalic] [mi-iwonami]
- \definefontsynonym [Iwona-Math-Symbols-Medium] [sy-iwonami]
- \definefontsynonym [Iwona-Math-Extension-Medium] [ex-iwonam]
+ \definefontsynonym [Iwona-Math-Letters-Medium] [rm-iwonam]
+ \definefontsynonym [Iwona-Math-Letters-MediumItalic] [mi-iwonami]
+ \definefontsynonym [Iwona-Math-Symbols-Medium] [sy-iwonamz]
+ \definefontsynonym [Iwona-Math-Extension-Medium] [ex-iwonam]
+\stoptypescript
+
+\starttypescript [math] [iwona-heavy] [default]
+ \definefontsynonym [Iwona-Math-Letters-Heavy] [rm-iwonah]
+ \definefontsynonym [Iwona-Math-Letters-HeavyItalic] [mi-iwonahi]
+ \definefontsynonym [Iwona-Math-Symbols-Heavy] [sy-iwonahz]
+ \definefontsynonym [Iwona-Math-Extension-Heavy] [ex-iwonah]
\stoptypescript
% Kurier (JMN)
@@ -911,22 +989,22 @@
\starttypescript [math] [kurier] [default]
\definefontsynonym [Kurier-Math-Letters-Regular] [rm-kurierr]
\definefontsynonym [Kurier-Math-Letters-RegularItalic] [mi-kurierri]
- \definefontsynonym [Kurier-Math-Symbols-Regular] [sy-kurierri]
+ \definefontsynonym [Kurier-Math-Symbols-Regular] [sy-kurierrz]
\definefontsynonym [Kurier-Math-Extension-Regular] [ex-kurierr]
\stoptypescript
\starttypescript [math] [kurier-light] [default]
- \definefontsynonym [Kurier-Math-Letters-Light] [rm-kurierl]
- \definefontsynonym [Kurier-Math-Letters-LightItalic] [mi-kurierli]
- \definefontsynonym [Kurier-Math-Symbols-Light] [sy-kurierli]
- \definefontsynonym [Kurier-Math-Extension-Light] [ex-kurierl]
+ \definefontsynonym [Kurier-Math-Letters-Light] [rm-kurierl]
+ \definefontsynonym [Kurier-Math-Letters-LightItalic] [mi-kurierli]
+ \definefontsynonym [Kurier-Math-Symbols-Light] [sy-kurierlz]
+ \definefontsynonym [Kurier-Math-Extension-Light] [ex-kurierl]
\stoptypescript
\starttypescript [math] [kurier-medium] [default]
- \definefontsynonym [Kurier-Math-Letters-Medium] [rm-kurierm]
- \definefontsynonym [Kurier-Math-Letters-MediumItalic] [mi-kuriermi]
- \definefontsynonym [Kurier-Math-Symbols-Medium] [sy-kuriermi]
- \definefontsynonym [Kurier-Math-Extension-medium] [ex-kurierm]
+ \definefontsynonym [Kurier-Math-Letters-Medium] [rm-kurierm]
+ \definefontsynonym [Kurier-Math-Letters-MediumItalic] [mi-kuriermi]
+ \definefontsynonym [Kurier-Math-Symbols-Medium] [sy-kuriermz]
+ \definefontsynonym [Kurier-Math-Extension-medium] [ex-kurierm]
\stoptypescript
% Palatino (URW)
diff --git a/Master/texmf-dist/tex/context/base/type-exa.tex b/Master/texmf-dist/tex/context/base/type-exa.tex
index d08b565f477..123e2cb4daa 100644
--- a/Master/texmf-dist/tex/context/base/type-exa.tex
+++ b/Master/texmf-dist/tex/context/base/type-exa.tex
@@ -168,40 +168,7 @@
\stoptypescript
-% \starttypescript [serif] [hanging] [pure,normal]
-%
-% \setupfontsynonym [Serif] [handling=\typescriptthree]
-% \setupfontsynonym [SerifBold] [handling=\typescriptthree bold]
-% \setupfontsynonym [SerifSlanted] [handling=\typescriptthree slanted]
-% \setupfontsynonym [SerifItalic] [handling=\typescriptthree italic]
-% \setupfontsynonym [SerifBoldSlanted] [handling=\typescriptthree boldslanted]
-% \setupfontsynonym [SerifBoldItalic] [handling=\typescriptthree bolditalic]
-%
-% \stoptypescript
-%
-% \starttypescript [sans] [hanging] [pure,normal]
-%
-% \setupfontsynonym [Sans] [handling=\typescriptthree]
-% \setupfontsynonym [SansBold] [handling=\typescriptthree bold]
-% \setupfontsynonym [SansSlanted] [handling=\typescriptthree slanted]
-% \setupfontsynonym [SansItalic] [handling=\typescriptthree italic]
-% \setupfontsynonym [SansBoldSlanted] [handling=\typescriptthree boldslanted]
-% \setupfontsynonym [SansBoldItalic] [handling=\typescriptthree bolditalic]
-%
-% \stoptypescript
-%
-% \starttypescript [mono] [hanging] [pure,normal]
-%
-% \setupfontsynonym [Mono] [handling=\typescriptthree]
-% \setupfontsynonym [MonoBold] [handling=\typescriptthree bold]
-% \setupfontsynonym [MonoSlanted] [handling=\typescriptthree slanted]
-% \setupfontsynonym [MonoItalic] [handling=\typescriptthree italic]
-% \setupfontsynonym [MonoBoldSlanted] [handling=\typescriptthree boldslanted]
-% \setupfontsynonym [MonoBoldItalic] [handling=\typescriptthree bolditalic]
-%
-% \stoptypescript
-
-\starttypescript [serif,sans,mono] [handling,hanging,hz] [pure,normal,hz,quality]
+\starttypescript [serif,sans,mono] [handling,hanging] [pure,normal]
\setupfontsynonym [\typescriptprefix\typescriptone ] [handling=\typescriptthree]
\setupfontsynonym [\typescriptprefix\typescriptone Bold] [handling=\typescriptthree bold]
@@ -212,6 +179,29 @@
\stoptypescript
+\starttypescript [serif,sans,mono] [handling,hz] [hz,quality,highquality]
+
+ \setupfontsynonym [\typescriptprefix\typescriptone ] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone Bold] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone Slanted] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone Italic] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone BoldSlanted] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone BoldItalic] [handling=\typescriptthree]
+
+\stoptypescript
+
+
+\starttypescript [serif,sans,mono] [handling] [noligs,prespacing,flexspacing]
+
+ \setupfontsynonym [\typescriptprefix\typescriptone ] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone Bold] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone Slanted] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone Italic] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone BoldSlanted] [handling=\typescriptthree]
+ \setupfontsynonym [\typescriptprefix\typescriptone BoldItalic] [handling=\typescriptthree]
+
+\stoptypescript
+
% handy
\starttypescript [serif] [simple] [name] % bad, will be changed but in sycn with manuals that use it
@@ -239,7 +229,7 @@
\stoptypescript
-\starttypescript [antykwa-torunska] [texnansi,ec,8r,uc]
+\starttypescript [antykwa-torunska] [texnansi,ec,8r,uc,t2a]
\definetypeface[antykwa][rm][serif][antykwa-torunska] [default][encoding=\typescripttwo]
\definetypeface[antykwa][ss][sans] [modern] [default][encoding=\typescripttwo,rscale=1.05]
@@ -248,6 +238,17 @@
\stoptypescript
+\starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium] [texnansi,ec,8r,uc,t2a]
+
+ % todo: rscale
+
+ \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default][encoding=\typescripttwo]
+ \definetypeface[\typescriptone][rm][serif][modern] [default][encoding=\typescripttwo]
+ \definetypeface[\typescriptone][tt][mono] [modern] [default][encoding=\typescripttwo]
+ \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][encoding=\typescripttwo,text=ss]
+
+\stoptypescript
+
\stoptypescriptcollection
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-ghz.tex b/Master/texmf-dist/tex/context/base/type-ghz.tex
index 23f71d58378..318e6d596ed 100644
--- a/Master/texmf-dist/tex/context/base/type-ghz.tex
+++ b/Master/texmf-dist/tex/context/base/type-ghz.tex
@@ -1,8 +1,27 @@
-% run texfont from currentpath with the fonts on subpath fontsite/500
-
-% texfont --en=texnansi --ve=linotype --co=optima type-ghz.dat
-% texfont --en=texnansi --ve=linotype --co=optima-nova type-ghz.dat
-% texfont --en=texnansi --ve=linotype --co=palatino type-ghz.dat
+%D \module
+%D [ file=type-ghz,
+%D version=2005.06.07,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Hermann Zapf's Fonts,
+%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.
+
+% \usetypescriptfile[type-ghz]
+%
+% \definetypeface[optima] [ss][sans] [optima-nova] [default]
+% \definetypeface[palatino][rm][serif][palatino-nova][default]
+% \definetypeface[aldus] [rm][serif][aldus-nova] [default]
+%
+% \starttext
+% \setupbodyfont[optima] \input zapf \blank
+% \setupbodyfont[palatino] \input zapf \blank
+% \setupbodyfont[aldus] \input zapf \blank
+% \stoptext
\starttypescriptcollection[zapf collection]
@@ -66,28 +85,131 @@
% optima nova
+% see antykwa, we could define variants for light and osf
+
+\starttypescript[optima-nova][texnansi,ec] % will change to more narrow tt
+ \definetypeface[optima][ss][sans][optima-nova] [default][encoding=\typescripttwo]
+ \definetypeface[optima][rm][sans][optima-nova] [default][encoding=\typescripttwo]
+ \definetypeface[optima][tt][mono][latin-modern][default][encoding=\typescripttwo,rscale=1.125]
+ \definetypeface[optima][mm][mono][latin-modern][default][encoding=\typescripttwo,rscale=1.125]
+ \quittypescriptscanning
+\stoptypescript
+
\starttypescript [sans] [optima-nova] [name]
\definefontsynonym [Sans] [OptimaNovaLT-Regular]
\definefontsynonym [SansItalic] [OptimaNovaLT-Italic]
- \definefontsynonym [SansBold] [OptimaLT-Bold]
- \definefontsynonym [SansBoldItalic] [OptimaLT-BoldItalic]
- \definefontsynonym [SansSlanted] [SansItalic]
- \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
- \definefontsynonym [SansCaps] [Sans]
+ \definefontsynonym [SansBold] [OptimaNovaLT-Bold]
+ \definefontsynonym [SansBoldItalic] [OptimaNovaLT-BoldItalic]
+ \definefontsynonym [SansSlanted] [OptimaNovaLT-Italic]
+ \definefontsynonym [SansBoldSlanted] [OptimaNovaLT-BoldItalic]
+ \definefontsynonym [SansCaps] [OptimaNovaLT-RegularSC]
+
+ \definefontvariant [Serif][osf][OsF]
+ \definefontvariant [Serif][sc][Caps]
+
+ \definefontsynonym [SansOsF] [OptimaNovaLT-RegularOsF]
+ \definefontsynonym [SansItalicOsF] [OptimaNovaLT-ItalicOsF]
+ \definefontsynonym [SansBoldOsF] [OptimaNovaLT-BoldOsF]
+ \definefontsynonym [SansBoldItalicOsF] [OptimaNovaLT-BoldItalicOsF]
+ \definefontsynonym [SansSlantedOsF] [OptimaNovaLT-ItalicOsF]
+ \definefontsynonym [SansBoldSlantedOsF] [OptimaNovaLT-BoldItalicOsF]
+ \definefontsynonym [SansCapsOsF] [OptimaNovaLT-RegularSC]
+
+ \definefontsynonym [SansCaps] [OptimaNovaLT-RegularSC]
+ \definefontsynonym [SansItalicCaps] [OptimaNovaLT-ItalicSC ]
+ \definefontsynonym [SansBoldCaps] [OptimaNovaLT-BoldSC]
+ \definefontsynonym [SansBoldItalicCaps] [OptimaNovaLT-BoldItalicSC]
+ \definefontsynonym [SansSlantedCaps] [OptimaNovaLT-ItalicSC]
+ \definefontsynonym [SansBoldSlantedCaps] [OptimaNovaLT-BoldItalicSC]
+ \definefontsynonym [SansCapsCaps] [OptimaNovaLT-RegularSC]
+
+\stoptypescript
+
+\starttypescript [sans] [optima-nova-os] [name]
+
+ \definefontsynonym [Sans] [OptimaNovaLT-RegularOsF]
+ \definefontsynonym [SansItalic] [OptimaNovaLT-ItalicOsF]
+ \definefontsynonym [SansBold] [OptimaNovaLT-BoldOsF]
+ \definefontsynonym [SansBoldItalic] [OptimaNovaLT-BoldItalicOsF]
+ \definefontsynonym [SansSlanted] [OptimaNovaLT-ItalicOsF]
+ \definefontsynonym [SansBoldSlanted] [OptimaNovaLT-BoldItalicOsF]
+ \definefontsynonym [SansCaps] [OptimaNovaLT-RegularSC]
+
+\stoptypescript
+
+\starttypescript [sans] [optima-nova-light] [name] % may change
+
+ \definefontsynonym [Sans] [OptimaNovaLT-Light]
+ \definefontsynonym [SansItalic] [OptimaNovaLT-LightItalic]
+ \definefontsynonym [SansBold] [OptimaNovaLT-Medium]
+ \definefontsynonym [SansBoldItalic] [OptimaNovaLT-MediumItalic]
+ \definefontsynonym [SansSlanted] [OptimaNovaLT-LightItalic]
+ \definefontsynonym [SansBoldSlanted] [OptimaNovaLT-MediumItalic]
+ \definefontsynonym [SansCaps] [OptimaNovaLT-LightSC]
+
+\stoptypescript
+
+\starttypescript [sans] [optima-nova-medium] [name] % may change
+
+ \definefontsynonym [Sans] [OptimaNovaLT-Medium]
+ \definefontsynonym [SansItalic] [OptimaNovaLT-MediumItalic]
+ \definefontsynonym [SansBold] [OptimaNovaLT-Heavy]
+ \definefontsynonym [SansBoldItalic] [OptimaNovaLT-HeavyItalic]
+ \definefontsynonym [SansSlanted] [OptimaNovaLT-MediumItalic]
+ \definefontsynonym [SansBoldSlanted] [OptimaNovaLT-HeavyItalic]
+ \definefontsynonym [SansCaps] [OptimaNovaLT-MediumSC]
\stoptypescript
-\starttypescript [sans] [optima-nova] [texnansi,ec,8r]
+\starttypescript [sans] [optima-nova,optima-nova-light,optima-nova-medium,optima-nova-os] [texnansi,ec,8r]
\loadmapfile[\typescriptthree-linotype-optima-nova.map]
- \definefontsynonym [OptimaNovaLT-Regular] [\typescriptthree-lt55483] [encoding=\typescriptthree]
- \definefontsynonym [OptimaNovaLT-Italic] [\typescriptthree-lt55486] [encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Light] [\typescriptthree-lt55476][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-LightSC] [\typescriptthree-lt55477][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-LightOsF] [\typescriptthree-lt55478][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-LightItalic] [\typescriptthree-lt55479][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-LightItalicSC] [\typescriptthree-lt55480][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-LightItalicOsF] [\typescriptthree-lt55481][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-LightCond] [\typescriptthree-lt55482][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Regular] [\typescriptthree-lt55483][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-RegularSC] [\typescriptthree-lt55484][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-RegularOsF] [\typescriptthree-lt55485][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Italic] [\typescriptthree-lt55486][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-ItalicSC] [\typescriptthree-lt55487][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-ItalicOsF] [\typescriptthree-lt55488][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Condensed] [\typescriptthree-lt55489][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Medium] [\typescriptthree-lt55490][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-MediumSC] [\typescriptthree-lt55491][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-MediumOsF] [\typescriptthree-lt55492][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-MediumItalic] [\typescriptthree-lt55493][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-MediumItalicSC] [\typescriptthree-lt55494][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-MediumItalicOsF][\typescriptthree-lt55495][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-MediumCond] [\typescriptthree-lt55496][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-TitlingInitials][\typescriptthree-lt55497][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Demi] [\typescriptthree-lt55498][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-DemiSC] [\typescriptthree-lt55499][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-DemiOsF] [\typescriptthree-lt55500][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-DemiItalic] [\typescriptthree-lt55501][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-DemiItalicSC] [\typescriptthree-lt55502][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-DemiItalicOsF] [\typescriptthree-lt55503][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-DemiCond] [\typescriptthree-lt55504][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Bold] [\typescriptthree-lt55505][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-BoldSC] [\typescriptthree-lt55506][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-BoldOsF] [\typescriptthree-lt55507][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-BoldItalic] [\typescriptthree-lt55508][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-BoldItalicSC] [\typescriptthree-lt55509][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-BoldItalicOsF] [\typescriptthree-lt55510][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-BoldCond] [\typescriptthree-lt55511][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Heavy] [\typescriptthree-lt55512][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-HeavyItalic] [\typescriptthree-lt55513][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-Black] [\typescriptthree-lt55514][encoding=\typescriptthree]
+ \definefontsynonym[OptimaNovaLT-BlackItalic] [\typescriptthree-lt55515][encoding=\typescriptthree]
\stoptypescript
-\starttypescript [map] [optima-nova] [texnansi,ec,8r]
+\starttypescript [map] [optima-nova,optima-nova-light,optima-nova-medium,optima-nova-os] [texnansi,ec,8r]
\loadmapfile[\typescriptthree-linotype-optima-nova.map]
\stoptypescript
@@ -99,11 +221,10 @@
\definefontsynonym [SerifItalic] [PalatinoLT-Italic]
\definefontsynonym [SerifBold] [PalatinoLT-Bold]
\definefontsynonym [SerifBoldItalic] [PalatinoLT-BoldItalic]
-
\definefontsynonym [SerifSlanted] [SerifItalic]
\definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
- \definefontsynonym [SerifCaps] [Palatino-SC]
+ \definefontsynonym [SerifCaps] [PalatinoSC]
\stoptypescript
@@ -126,7 +247,7 @@
\definefontsynonym[Palatino-BoldOsF] [\typescriptthree-pobos] [encoding=\typescriptthree]
\definefontsynonym[Palatino-ItalicOsF] [\typescriptthree-poios] [encoding=\typescriptthree]
- \definefontsynonym[Palatino-SC] [\typescriptthree-posc] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoSC] [\typescriptthree-posc] [encoding=\typescriptthree]
\stoptypescript
@@ -134,7 +255,137 @@
\loadmapfile[\typescriptthree-linotype-palatino.map]
\stoptypescript
-\stoptypescriptcollection
+% palatino nova
+
+\starttypescript [serif] [palatino-nova] [name]
+
+ \definefontsynonym [Serif] [PalatinoNova-Regular]
+ \definefontsynonym [SerifItalic] [PalatinoNova-Italic]
+ \definefontsynonym [SerifBold] [PalatinoNova-Bold]
+ \definefontsynonym [SerifBoldItalic] [PalatinoNova-BoldItalic]
+ \definefontsynonym [SerifSlanted] [PalatinoNova-Italic]
+ \definefontsynonym [SerifBoldSlanted] [PalatinoNova-BoldItalic]
+ \definefontsynonym [SerifCaps] [PalatinoNova-RegularSC]
+
+ \definefontvariant [Serif][sc][Caps]
+
+ \definefontsynonym [SerifCaps] [PalatinoNova-RegularSC]
+ \definefontsynonym [SerifItalicCaps] [PalatinoNova-ItalicSC]
+ \definefontsynonym [SerifBoldCaps] [PalatinoNova-BoldSC]
+ \definefontsynonym [SerifBoldItalicCaps] [PalatinoNova-BoldItalicSC]
+ \definefontsynonym [SerifSlantedCaps] [PalatinoNova-ItalicSC]
+ \definefontsynonym [SerifBoldSlantedCaps] [PalatinoNova-BoldItalicSC]
+ \definefontsynonym [SerifCapsCaps] [PalatinoNova-RegularSC]
+
+\stoptypescript
+
+\starttypescript [serif] [palatino-nova-light] [name] % may change
+
+ \definefontsynonym [Serif] [PalatinoNova-Light]
+ \definefontsynonym [SerifItalic] [PalatinoNova-LightItalic]
+ \definefontsynonym [SerifBold] [PalatinoNova-Regular]
+ \definefontsynonym [SerifBoldItalic] [PalatinoNova-Italic]
+ \definefontsynonym [SerifSlanted] [PalatinoNova-Regular]
+ \definefontsynonym [SerifBoldSlanted] [PalatinoNova-Italic]
+ \definefontsynonym [SerifCaps] [PalatinoNova-LightSC]
+
+\stoptypescript
+
+\starttypescript [serif] [palatino-nova-medium] [name] % may change
+
+ \definefontsynonym [Serif] [PalatinoNova-Medium]
+ \definefontsynonym [SerifItalic] [PalatinoNova-MediumItalic]
+ \definefontsynonym [SerifBold] [PalatinoNova-Bold]
+ \definefontsynonym [SerifBoldItalic] [PalatinoNova-BoldItalic]
+ \definefontsynonym [SerifSlanted] [PalatinoNova-Bold]
+ \definefontsynonym [SerifBoldSlanted] [PalatinoNova-BoldItalic]
+ \definefontsynonym [SerifCaps] [PalatinoNova-MediumSC]
+
+\stoptypescript
+
+\starttypescript [serif] [palatino-nova,palatino-nova-light,palatino-nova-medium] [texnansi,ec,8r]
+
+ \loadmapfile[\typescriptthree-linotype-palatino-nova.map]
+
+ \definefontsynonym[PalatinoNova-Light] [\typescriptthree-PalatinoNova-Light] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-LightItalic] [\typescriptthree-PalatinoNova-LightItalic] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-Regular] [\typescriptthree-PalatinoNova-Regular] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-Italic] [\typescriptthree-PalatinoNova-Italic] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-Medium] [\typescriptthree-PalatinoNova-Medium] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-MediumItalic][\typescriptthree-PalatinoNova-MediumItalic][encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-Bold] [\typescriptthree-PalatinoNova-Bold] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-BoldItalic] [\typescriptthree-PalatinoNova-BoldItalic] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-Imperial] [\typescriptthree-PalatinoNova-Imperial] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-Titling] [\typescriptthree-PalatinoNova-Titling] [encoding=\typescriptthree]
+
+ \loadmapfile[\typescriptthree-sc-linotype-palatino-nova.map]
+
+ \definefontsynonym[PalatinoNova-LightSC] [\typescriptthree-sc-PalatinoNova-Light] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-LightItalicSC] [\typescriptthree-sc-PalatinoNova-LightItalic] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-RegularSC] [\typescriptthree-sc-PalatinoNova-Regular] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-ItalicSC] [\typescriptthree-sc-PalatinoNova-Italic] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-MediumSC] [\typescriptthree-sc-PalatinoNova-Medium] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-MediumItalicSC][\typescriptthree-sc-PalatinoNova-MediumItalic][encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-BoldSC] [\typescriptthree-sc-PalatinoNova-Bold] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-BoldItalicSC] [\typescriptthree-sc-PalatinoNova-BoldItalic] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-ImperialSC] [\typescriptthree-sc-PalatinoNova-Imperial] [encoding=\typescriptthree]
+ \definefontsynonym[PalatinoNova-TitlingSC] [\typescriptthree-sc-PalatinoNova-Titling] [encoding=\typescriptthree]
+
+\stoptypescript
+
+\starttypescript [map] [palatino-nova,palatino-nova-light,palatino-nova-medium] [texnansi,ec,8r]
+ \loadmapfile[\typescriptthree-linotype-palatino-nova.map]
+ \loadmapfile[\typescriptthree-sc-linotype-palatino-nova.map]
+% \loadmapfile[\typescriptthree-os-linotype-palatino-nova.map]
+\stoptypescript
+
+% aldusnova
+
+\starttypescript [serif] [aldus-nova] [name]
+
+ \definefontsynonym [Serif] [AldusNova-Book]
+ \definefontsynonym [SerifItalic] [AldusNova-BookItalic]
+ \definefontsynonym [SerifBold] [AldusNova-Bold]
+ \definefontsynonym [SerifBoldItalic] [AldusNova-BoldItalic]
+ \definefontsynonym [SerifSlanted] [AldusNova-BookItalic]
+ \definefontsynonym [SerifBoldSlanted] [AldusNova-BoldItalic]
+ \definefontsynonym [SerifCaps] [AldusNova-BookSC]
+
+ \definefontvariant [Serif][sc][Caps]
+
+ \definefontsynonym [SerifCaps] [AldusNova-BookSC]
+ \definefontsynonym [SerifItalicCaps] [AldusNova-BookItalicSC]
+ \definefontsynonym [SerifBoldCaps] [AldusNova-BoldSC]
+ \definefontsynonym [SerifBoldItalicCaps] [AldusNova-BoldItalicSC]
+ \definefontsynonym [SerifSlantedCaps] [AldusNova-BookItalicSC]
+ \definefontsynonym [SerifBoldSlantedCaps] [AldusNova-BoldItalicSC]
+ \definefontsynonym [SerifCapsCaps] [AldusNova-BookSC]
+
+\stoptypescript
+
+\starttypescript [serif] [aldus-nova] [texnansi,ec,8r]
+
+ \loadmapfile[\typescriptthree-linotype-aldus-nova.map]
+
+ \definefontsynonym[AldusNova-Book] [\typescriptthree-AldusNova-Book] [encoding=\typescriptthree]
+ \definefontsynonym[AldusNova-BookItalic] [\typescriptthree-AldusNova-BookItalic] [encoding=\typescriptthree]
+ \definefontsynonym[AldusNova-Bold] [\typescriptthree-AldusNova-Bold] [encoding=\typescriptthree]
+ \definefontsynonym[AldusNova-BoldItalic] [\typescriptthree-AldusNova-BoldItalic] [encoding=\typescriptthree]
+
+ \loadmapfile[\typescriptthree-sc-linotype-aldus-nova.map]
+
+ \definefontsynonym[AldusNova-BookSC] [\typescriptthree-sc-AldusNova-Book] [encoding=\typescriptthree]
+ \definefontsynonym[AldusNova-BookItalicSC] [\typescriptthree-sc-AldusNova-BookItalic] [encoding=\typescriptthree]
+ \definefontsynonym[AldusNova-BoldSC] [\typescriptthree-sc-AldusNova-Bold] [encoding=\typescriptthree]
+ \definefontsynonym[AldusNova-BoldItalicSC] [\typescriptthree-sc-AldusNova-BoldItalic] [encoding=\typescriptthree]
+
+\stoptypescript
+
+\starttypescript [map] [aldus-nova] [texnansi,ec,8r]
+ \loadmapfile[\typescriptthree-linotype-aldus-nova.map]
+ \loadmapfile[\typescriptthree-sc-linotype-aldus-nova.map]
+\stoptypescript
+
% melior
@@ -169,5 +420,6 @@
\loadmapfile[\typescriptthree-linotype-melior.map]
\stoptypescript
+\stoptypescriptcollection
\endinput
diff --git a/Master/texmf-dist/tex/context/base/type-gyr.tex b/Master/texmf-dist/tex/context/base/type-gyr.tex
new file mode 100644
index 00000000000..b5063201d1f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/type-gyr.tex
@@ -0,0 +1,36 @@
+%D \module
+%D [ file=type-gyr,
+%D version=2006.06.28,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=TeXGyre Collection,
+%D author=Hans Hagen,
+%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.
+
+\starttypescriptcollection[gyre]
+
+% TeXGyrePagella
+%
+% qplr TeXGyrePagella-Regular
+% qplri TeXGyrePagella-Italic
+% qplb TeXGyrePagella-Bold
+% qplbi TeXGyrePagella-BoldItalic
+
+\starttypescript [serif] [palatino] [texnansi,ec,8r,t5,qx]
+ \loadmapfile[\typescriptthree-qpl.map]
+
+ \definefontsynonym [Palatino] [\typescriptthree-qplr] [encoding=\typescriptthree]
+ \definefontsynonym [Palatino-Italic] [\typescriptthree-qplri] [encoding=\typescriptthree]
+ \definefontsynonym [Palatino-Bold] [\typescriptthree-qplb] [encoding=\typescriptthree]
+ \definefontsynonym [Palatino-BoldItalic] [\typescriptthree-qplbi] [encoding=\typescriptthree]
+
+ \definefontsynonym [Palatino-Slanted] [Palatino-Italic]
+ \definefontsynonym [Palatino-BoldSlanted] [Palatino-BoldItalic]
+ \definefontsynonym [Palatino-Caps] [Palatino]
+\stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/type-ini.tex b/Master/texmf-dist/tex/context/base/type-ini.tex
index f551c886197..16de327411e 100644
--- a/Master/texmf-dist/tex/context/base/type-ini.tex
+++ b/Master/texmf-dist/tex/context/base/type-ini.tex
@@ -84,7 +84,7 @@
\usetypescriptfile[\f!typeprefix exa] % some examples
\usetypescriptfile[\f!typeprefix syn] % font file synonyms
\usetypescriptfile[\f!typeprefix enc] % files and encodings
-\usetypescriptfile[\f!typeprefix dis] % funny name remappings
+%usetypescriptfile[\f!typeprefix dis] % funny name remappings, obsolete
\usetypescriptfile[\f!typeprefix siz] % specific font sizes
\usetypescriptfile[\f!typeprefix map] % pdftex mapping
\usetypescriptfile[\f!typeprefix spe] % special macros
@@ -382,7 +382,7 @@
\def\loadmapfile[#1]%
{\expanded{\processcommalist[#1]}\loadthemapfile}
-% too soon, no driver known, \ifproductionrun \loadallfontmapfiles \fi}
+% too soon, no driver known, \ifproductionrun \loadallfontmapfiles \fi
% temp hack, will become just \addto
@@ -462,6 +462,9 @@
% the map directives need to end up in the right place in the stream
+% hm, the timing of when pdftex needs the map file info keeps changing;
+% it's really time to move to map line support
+
% \appendtoks \loadallfontmapfiles \to \everyPDFximage
% \appendtoks \loadallfontmapfiles \to \everystarttext
% \appendtoks \loadallfontmapfiles \to \everybeforepagebody
@@ -535,48 +538,21 @@
\def\typefaceencoding{\defaultencoding}
-% \def\dodefinetypeface[#1][#2][#3][#4][#5][#6]%
-% {\dododefinetypeface[#1][#2]%
-% \iffifthargument % sixth is optional
-% % \getparameters[\??ts][rscale=1,\s!encoding=\defaultencoding,#6]
-% % we need to expand since in #6 there can be a \typescripttwo
-% \expanded{\getparameters[\??ts][\s!rscale=1,\s!encoding=\defaultencoding,#6]}%
-% % toch niet \expanded{\getparameters[\??ts][\s!rscale=1,\s!encoding=\s!default,#6]}%
-% \pushmacro\relativefontsize
-% \pushmacro\typefaceencoding
-% \pushmacro\fontclass
-% \let\relativefontsize\@@tsrscale
-% \let\typefaceencoding\@@tsencoding
-% \setcurrentfontclass{#1}
-% \saverelativefontsize{#2}{\relativefontsize}% fall back
-% %\writestatus{typeface}{[#1] [#2] [#3] [#4]}
-% \writestatus\m!fonts{[#1] [#2] [#3] [#4] / \typefaceencoding}%
-% %\usetypescript[map][\typefaceencoding]% latest versions of pdftex can load after first page
-% \usetypescript[#3,map][#4][name,default,\typefaceencoding,special]% is default needed
-% \usetypescript[#3][#5][size]%
-% \popmacro\fontclass
-% \popmacro\typefaceencoding
-% \popmacro\relativefontsize
-% \else\iffourthargument
-% \definetypeface[#1][#2][#3][#4][\s!default]%
-% \else\ifthirdargument
-% \getparameters[\??tf#1#2][#3]%
-% \fi\fi\fi}
-
% we can use \rawgetparameters or \rawgeteparameters
\def\dodefinetypeface[#1][#2][#3][#4][#5][#6]%
{\dododefinetypeface[#1][#2]%
\iffifthargument % sixth is optional
% we need to expand since in #6 there can be a \typescripttwo
- \expanded{\getparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,#6]}% \geteparameters
+ \expanded{\getparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,\s!text=,#6]}% \geteparameters
\pushmacro\relativefontsize
\pushmacro\typefaceencoding
\pushmacro\fontclass
\let\relativefontsize\@@tsrscale
\let\typefaceencoding\@@tsencoding
\setcurrentfontclass{#1}%
- \saverelativefontsize{#2}{\relativefontsize}% fall back
+ \saverelativefontsize{#2}\relativefontsize % fall back
+ \savemathtextstyle\@@tstext % math text style (new per 28/4/2006)
\iftracetypescripts\writestatus\m!fonts{define: [#1] [#2] [#3] [#4] / \typefaceencoding}\fi
%\usetypescript[map][\typefaceencoding]% latest versions of pdftex can load after first page
\usetypescript[#3,\t!map][#4][\t!name,\t!default,\typefaceencoding,\t!special]% is default needed
@@ -621,6 +597,30 @@
\def\usetypefile[#1]% recurses on path !
{\readfile{\f!typeprefix#1}\donothing\donothing}
+%D For Taco:
+%D
+%D \starttyping
+%D \inherittypeface[palatino][rm][postscript]
+%D \inherittypeface[palatino][rm][\fontclass]
+%D \inherittypeface[palatino][rm] % == \fontclass
+%D \inherittypeface[palatino] % == [rm,ss,tt,mm]
+%D \starttyping
+
+\def\inherittypeface
+ {\dotripleempty\doinherittypeface}
+
+\def\doinherittypeface[#1][#2][#3]%
+ {\doifelsenothing{#2}
+ {\doinherittypeface[#1][\c!rm,\c!ss,\c!tt,\c!mm][\fontclass]}
+ {\doifnot{#1}{#3}
+ {\def\docommand##1{\setevalue{#1-##1}{#3}}%
+ \processcommalist[#2]\docommand}}}
+
+%D This hook sinto the font mechanism with:
+
+\def\checkfontclass#1%
+ {\edef\fontclass{\executeifdefined{\fontclass-#1}{\fontclass}}}
+
%D For backward compatibility we reimplement the font file
%D loading macro.
diff --git a/Master/texmf-dist/tex/context/base/type-map.tex b/Master/texmf-dist/tex/context/base/type-map.tex
index 2c87d8ad2ba..d6d8e2fcbef 100644
--- a/Master/texmf-dist/tex/context/base/type-map.tex
+++ b/Master/texmf-dist/tex/context/base/type-map.tex
@@ -24,7 +24,7 @@
\loadmapfile[t5-base.map]
\stoptypescript
-\starttypescript [map] [base] [all]
+\starttypescript [map] [base,euler,ams] [all]
\loadmapfile[original-ams-base.map]
% \loadmapfile[original-ams-cmr.map]
\loadmapfile[original-ams-euler.map]
@@ -63,8 +63,13 @@
% in the name; for the moment we ship copies of the map files.
\starttypescript [map] [modern,modern-vari,modern-cond,computer-modern,latin-modern,latin-modern-vari,latin-modern-cond,] [ec,texnansi,qx,t5]
-% \loadmapfile[lm-\typescriptthree.map] % maybe some day
+ % this was what we had at the start and what fits best into our naming scheme
+ % well, all those changes in lm gave too many user problem reports so i revert to:
\loadmapfile[\typescriptthree-public-lm.map]
+ % this one also fits into the naming scheme but has been dropped by the distributers
+ % \loadmapfile[\typescriptthree-lm.map]
+ % this is what the latest distributions provide
+ % \loadmapfile[lm-\typescriptthree.map] % maybe some day
\stoptypescript
% \usetypescript [map] [latin-modern-os] [ec] % lm is loaded under ec regime
@@ -86,36 +91,56 @@
\loadmapfile[\typescriptthree-bitstrea-charter.map]
\stoptypescript
-% \starttypescript [map] [antykwa-torunska] [ec,texnansi,t5,8r]
-% \loadmapfile[\typescriptthree-public-antt.map]
+% \starttypescript [map] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,ec,qx,t5,t2a,t2b,t2c,default]
+% \loadmapfile[\typescriptthree-antt.map]
+% \loadmapfile[rm-antt.map]
+% \loadmapfile[mi-antt.map]
+% \loadmapfile[sy-antt.map]
+% \loadmapfile[ex-antt.map]
% \stoptypescript
\starttypescript [map] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,ec,qx,t5,t2a,t2b,t2c,default]
- \loadmapfile[\typescriptthree-antt.map]
- \loadmapfile[rm-antt.map]
- \loadmapfile[mi-antt.map]
- \loadmapfile[sy-antt.map]
- \loadmapfile[ex-antt.map]
+ \loadmapfile[antt-\typescriptthree.map]
+ \loadmapfile[antt-rm.map]
+ \loadmapfile[antt-mi.map]
+ \loadmapfile[antt-sy.map]
+ \loadmapfile[antt-ex.map]
\stoptypescript
\starttypescript [map] [antykwa-poltawskiego] [ec,texnansi,qx,t5]
\loadmapfile[\typescriptthree-public-antp.map]
\stoptypescript
+% \starttypescript [map] [iwona,iwona-light,iwona-medium,iwona-heavy] [ec,texnansi,qx,t5]
+% \loadmapfile[\typescriptthree-iwona.map]
+% \loadmapfile[rm-iwona.map]
+% \loadmapfile[mi-iwona.map]
+% \loadmapfile[sy-iwona.map]
+% \loadmapfile[ex-iwona.map]
+% \stoptypescript
+
\starttypescript [map] [iwona,iwona-light,iwona-medium,iwona-heavy] [ec,texnansi,qx,t5]
- \loadmapfile[\typescriptthree-iwona.map]
- \loadmapfile[rm-iwona.map]
- \loadmapfile[mi-iwona.map]
- \loadmapfile[sy-iwona.map]
- \loadmapfile[ex-iwona.map]
-\stoptypescript
+ \loadmapfile[iwona-\typescriptthree.map]
+ \loadmapfile[iwona-rm.map]
+ \loadmapfile[iwona-mi.map]
+ \loadmapfile[iwona-sy.map]
+ \loadmapfile[iwona-ex.map]
+\stoptypescript
+
+% \starttypescript [map] [kurier,kurier-light,kurier-medium,kurier-heavy] [ec,texnansi,qx,t5,default]
+% \loadmapfile[\typescriptthree-kurier.map]
+% \loadmapfile[rm-kurier.map]
+% \loadmapfile[mi-kurier.map]
+% \loadmapfile[sy-kurier.map]
+% \loadmapfile[ex-kurier.map]
+% \stoptypescript
\starttypescript [map] [kurier,kurier-light,kurier-medium,kurier-heavy] [ec,texnansi,qx,t5,default]
- \loadmapfile[\typescriptthree-kurier.map]
- \loadmapfile[rm-kurier.map]
- \loadmapfile[mi-kurier.map]
- \loadmapfile[sy-kurier.map]
- \loadmapfile[ex-kurier.map]
+ \loadmapfile[kurier-\typescriptthree.map]
+ \loadmapfile[kurier-rm.map]
+ \loadmapfile[kurier-mi.map]
+ \loadmapfile[kurier-sy.map]
+ \loadmapfile[kurier-ex.map]
\stoptypescript
\starttypescript [map] [bookman] [ec,texnansi,t5,8r]
diff --git a/Master/texmf-dist/tex/context/base/type-pre.tex b/Master/texmf-dist/tex/context/base/type-pre.tex
index dd7feb443b4..ad2109a65ca 100644
--- a/Master/texmf-dist/tex/context/base/type-pre.tex
+++ b/Master/texmf-dist/tex/context/base/type-pre.tex
@@ -244,6 +244,7 @@
\starttypescriptcollection[special scripts]
\starttypescript[chi] \readfile{\f!fontprefix chi}\donothing\donothing \stoptypescript
+ \starttypescript[jap] \readfile{\f!fontprefix jap}\donothing\donothing \stoptypescript
\starttypescript[arb] \readfile{\f!fontprefix arb}\donothing\donothing \stoptypescript
\starttypescript[heb] \readfile{\f!fontprefix heb}\donothing\donothing \stoptypescript
diff --git a/Master/texmf-dist/tex/context/base/type-syn.tex b/Master/texmf-dist/tex/context/base/type-syn.tex
index 3f642e4bffc..0470622fb41 100644
--- a/Master/texmf-dist/tex/context/base/type-syn.tex
+++ b/Master/texmf-dist/tex/context/base/type-syn.tex
@@ -452,26 +452,142 @@
\starttypescript [sans] [iwona-light] [name]
\setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Light] [encoding=\typescriptthree]
- \definefontsynonym [SansItalic] [Iwona-LightItalic] [encoding=\typescriptthree]
- \definefontsynonym [SansBold] [Iwona-Medium] [encoding=\typescriptthree]
- \definefontsynonym [SansBoldItalic] [Iwona-MediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [Sans] [Iwona-Light] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-LightItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-Medium] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-MediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansCaps] [Iwona-CapsLight] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalicCaps] [Iwona-CapsLightItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldCaps] [Iwona-CapsMedium] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsMediumItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-light-caps] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CapsLight] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CapsLightItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CapsMedium] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CapsMediumItalic] [encoding=\typescriptthree]
\stoptypescript
\starttypescript [sans] [iwona] [name]
\setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Regular] [encoding=\typescriptthree]
- \definefontsynonym [SansItalic] [Iwona-RegularItalic] [encoding=\typescriptthree]
- \definefontsynonym [SansBold] [Iwona-Bold] [encoding=\typescriptthree]
- \definefontsynonym [SansBoldItalic] [Iwona-BoldItalic] [encoding=\typescriptthree]
+ \definefontsynonym [Sans] [Iwona-Regular] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-RegularItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-Bold] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-BoldItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansCaps] [Iwona-CapsRegular] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalicCaps] [Iwona-CapsRegularItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldCaps] [Iwona-CapsBold] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsBoldItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-caps] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CapsRegular] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CapsRegularItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CapsBold] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CapsBoldItalic] [encoding=\typescriptthree]
\stoptypescript
\starttypescript [sans] [iwona-medium] [name]
\setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Medium] [encoding=\typescriptthree]
- \definefontsynonym [SansItalic] [Iwona-MediumItalic] [encoding=\typescriptthree]
- \definefontsynonym [SansBold] [Iwona-Heavy] [encoding=\typescriptthree]
- \definefontsynonym [SansBoldItalic] [Iwona-HeavyItalic] [encoding=\typescriptthree]
+ \definefontsynonym [Sans] [Iwona-Medium] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-MediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-Heavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-HeavyItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansCaps] [Iwona-CapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalicCaps] [Iwona-CapsMediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavyItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-medium-caps] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CapsMediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CapsHeavyItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-heavy] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-Heavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-HeavyItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-Heavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-HeavyItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansCaps] [Iwona-CapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavyItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavyItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-heavy-caps] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [SansCaps] [Iwona-CapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavyItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavyItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-light-cond] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CondLight] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CondLightItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CondMedium] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CondMediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansCaps] [Iwona-CondCapsLight] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalicCaps] [Iwona-CondCapsLightItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldCaps] [Iwona-CondCapsMedium] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalicCaps] [Iwona-CondCapsMediumItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-light-cond-caps] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CondCapsLight] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CondCapsLightItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CondCapsMedium] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CondCapsMediumItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-cond] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CondRegular] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CondRegularItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CondBold] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CondBoldItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansCaps] [Iwona-CondCapsRegular] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalicCaps] [Iwona-CondCapsRegularItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldCaps] [Iwona-CondCapsBold] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalicCaps] [Iwona-CondCapsBoldItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-cond-caps] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CondCapsRegular] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CondCapsRegularItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CondCapsBold] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CondCapsBoldItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-medium-cond] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CondMedium] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CondMediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CondHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CondHeavyItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansCaps] [Iwona-CondCapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalicCaps] [Iwona-CondCapsMediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldCaps] [Iwona-CondCapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalicCaps] [Iwona-CondCapsHeavyItalic] [encoding=\typescriptthree]
+\stoptypescript
+
+\starttypescript [sans] [iwona-medium-cond-caps] [name]
+ \setups[font:fallback:sans]
+ \definefontsynonym [Sans] [Iwona-CondCapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansItalic] [Iwona-CondCapsMediumItalic] [encoding=\typescriptthree]
+ \definefontsynonym [SansBold] [Iwona-CondCapsHeavy] [encoding=\typescriptthree]
+ \definefontsynonym [SansBoldItalic] [Iwona-CondCapsHeavyItalic] [encoding=\typescriptthree]
\stoptypescript
\starttypescript [math] [iwona-light] [name]
@@ -495,6 +611,13 @@
\definefontsynonym [MathExtension] [Iwona-Math-Extension-Medium]
\stoptypescript
+\starttypescript [math] [iwona-heavy] [name]
+ \definefontsynonym [MathRoman] [Iwona-Math-Letters-Heavy]
+ \definefontsynonym [MathItalic] [Iwona-Math-Letters-HeavyItalic]
+ \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Heavy]
+ \definefontsynonym [MathExtension] [Iwona-Math-Extension-Heavy]
+\stoptypescript
+
% Kurier
\starttypescript [sans] [kurier-light] [name]
diff --git a/Master/texmf-dist/tex/context/base/unic-002.tex b/Master/texmf-dist/tex/context/base/unic-002.tex
index bd9e3468637..ae7deb12a92 100644
--- a/Master/texmf-dist/tex/context/base/unic-002.tex
+++ b/Master/texmf-dist/tex/context/base/unic-002.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=unic-002,
-%D version=2002.12.03,
+%D version=2006.08.02,
%D title=\CONTEXT\ \UNICODE\ Macros,
%D subtitle=Vector 2,
%D author=Hans Hagen,
@@ -14,18 +14,91 @@
\unprotect
\startunicodevector 2
+ \expandafter\strippedcsname
+ \ifcase\numexpr#1\relax
+ \Adoublegrave \or
+ \adoublegrave \or
+ \Ainvertedbreve \or
+ \ainvertedbreve \or
+ \Edoublegrave \or
+ \edoublegrave \or
+ \Einvertedbreve \or
+ \einvertedbreve \or
+ \Idoublegrave \or
+ \idoublegrave \or
+ \Iinvertedbreve \or
+ \iinvertedbreve \or
+ \Odoublegrave \or
+ \odoublegrave \or
+ \Oinvertedbreve \or
+ \oinvertedbreve \or
+ \Rdoublegrave \or
+ \rdoublegrave \or
+ \Rinvertedbreve \or
+ \rinvertedbreve \or
+ \Udoublegrave \or
+ \udoublegrave \or
+ \Uinvertedbreve \or
+ \uinvertedbreve \or
+ \Scommaaccent \or
+ \scommaaccent \or
+ \Tcommaaccent \or
+ \tcommaaccent \or
+ \unknownchar \or % Yogh
+ \unknownchar \or % yogh
+ \Hcaron \or
+ \hcaron \or
+ \unknownchar \or % n with long right leg
+ \dcurl \or
+ \unknownchar \or % Ou
+ \unknownchar \or % ou
+ \Zhook \or
+ \zhook \or
+ \Adotaccent \or
+ \adotaccent \or
+ \Ecedilla \or
+ \ecedilla \or
+ \Odiaeresismacron \or
+ \odiaeresismacron \or
+ \Otildemacron \or
+ \otildemacron \or
+ \Odotaccent \or
+ \odotaccent \or
+ \Odotaccentmacron \or
+ \odotaccentmacron \or
+ \Ymacron \or
+ \ymacron \or
+ \lcurl \or
+ \ncurl \or
+ \tcurl \or
+ \dotlessj \or
+ \unknownchar \or % db digraph
+ \unknownchar \or % qp digraph
+ \Astroke \or
+ \Cstroke \or
+ \cstroke \or
+ \Lbar \else
+ \ifcase\numexpr#1-83\relax
+ \bhook \or
+ \unknownchar \or % open o
+ \ccurl \or
+ \dtail \or
+ \dhook \or
+ \unknownchar \or % reversed e
+ \schwa \or
+ \schwahook \else
\ifcase\numexpr#1-198\relax
- \strippedcsname \textcircumflex \or
- \strippedcsname \textcaron \else
+ \textcircumflex \or
+ \textcaron \else
\ifcase\numexpr#1-216\relax
- \strippedcsname \textbreve \or
- \strippedcsname \textdotaccent \or
- \strippedcsname \unknownchar \or
- \strippedcsname \textogonek \or
- \strippedcsname \texttilde \or
- \strippedcsname \texthungarumlaut \else
- \strippedcsname \unknownchar
- \fi\fi
+ \textbreve \or
+ \textdotaccent \or
+ \textring \or
+ \textogonek \or
+ \texttilde \or
+ \texthungarumlaut \else
+ \unknownchar
+ \fi\fi\fi\fi
\stopunicodevector
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/unic-032.tex b/Master/texmf-dist/tex/context/base/unic-032.tex
index 42fea9de320..32c25e4e26e 100644
--- a/Master/texmf-dist/tex/context/base/unic-032.tex
+++ b/Master/texmf-dist/tex/context/base/unic-032.tex
@@ -1,9 +1,9 @@
%D \module
%D [ file=unic-032,
-%D version=2002.12.03,
+%D version=2006.03.30,
%D title=\CONTEXT\ \UNICODE\ Macros,
%D subtitle=Vector 32,
-%D author=Hans Hagen,
+%D author={Hans Hagen \& Taco Hoekwater},
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
@@ -13,126 +13,266 @@
\unprotect
-% U+2027 HYPHENATION POINT
-% U+2028 LINE SEPARATOR
-% U+2029 PARAGRAPH SEPARATOR
-% U+202A LEFT-TO-RIGHT EMBEDDING
-% U+202B RIGHT-TO-LEFT EMBEDDING
-% U+202C POP DIRECTIONAL FORMATTING
-% U+202D LEFT-TO-RIGHT OVERRIDE
-% U+202E RIGHT-TO-LEFT OVERRIDE
-% U+202F NARROW NO-BREAK SPACE
-% U+2030 PER MILLE SIGN
-% U+2031 PER TEN THOUSAND SIGN
-% U+2032 PRIME
-% U+2033 DOUBLE PRIME
-% U+2034 TRIPLE PRIME
-% U+2035 REVERSED PRIME
-% U+2036 REVERSED DOUBLE PRIME
-% U+2037 REVERSED TRIPLE PRIME
-% U+2038 CARET
-
-% U+203B REFERENCE MARK
-% U+203C DOUBLE EXCLAMATION MARK
-% U+203D INTERROBANG
-% U+203E OVERLINE
-% U+203F UNDERTIE
-% U+2040 CHARACTER TIE
-% U+2041 CARET INSERTION POINT
-% U+2042 ASTERISM
-% U+2043 HYPHEN BULLET
-% U+2044 FRACTION SLASH
-% U+2045 LEFT SQUARE BRACKET WITH QUILL
-% U+2046 RIGHT SQUARE BRACKET WITH QUILL
-% U+2047 DOUBLE QUESTION MARK
-% U+2048 QUESTION EXCLAMATION MARK
-% U+2049 EXCLAMATION QUESTION MARK
-% U+204A TIRONIAN SIGN ET
-% U+204B REVERSED PILCROW SIGN
-% U+204C BLACK LEFTWARDS BULLET
-% U+204D BLACK RIGHTWARDS BULLET
-% U+204E LOW ASTERISK
-% U+204F REVERSED SEMICOLON
-% U+2050 CLOSE UP
-% U+2051 TWO ASTERISKS ALIGNED VERTICALLY
-% U+2052 COMMERCIAL MINUS SIGN
-% U+2053 SWUNG DASH
-% U+2054 INVERTED UNDERTIE
-% U+2057 QUADRUPLE PRIME
-% U+205F MEDIUM MATHEMATICAL SPACE
-% U+2060 WORD JOINER
-% U+2061 FUNCTION APPLICATION
-% U+2062 INVISIBLE TIMES
-% U+2063 INVISIBLE SEPARATOR
-% U+206A INHIBIT SYMMETRIC SWAPPING
-% U+206B ACTIVATE SYMMETRIC SWAPPING
-% U+206C INHIBIT ARABIC FORM SHAPING
-% U+206D ACTIVATE ARABIC FORM SHAPING
-% U+206E NATIONAL DIGIT SHAPES
-% U+206F NOMINAL DIGIT SHAPES
-
-\ifx\undefined\zerowidthspace \unexpanded\def\zerowidthspace{\kern\zeropoint} \fi
-
\startunicodevector 32
+ \expandafter\strippedcsname
\ifcase\numexpr#1\relax
- \strippedcsname \enspace \or % U+2000 EN QUAD
- \strippedcsname \emspace \or % U+2001 EM QUAD
- \strippedcsname \enspace \or % U+2002 EN SPACE
- \strippedcsname \emspace \or % U+2003 EM SPACE
- \strippedcsname \unknownchar \or % U+2004 THREE-PER-EM SPACE
- \strippedcsname \unknownchar \or % U+2005 FOUR-PER-EM SPACE
- \strippedcsname \unknownchar \or % U+2006 SIX-PER-EM SPACE
- \strippedcsname \unknownchar \or % U+2007 FIGURE SPACE
- \strippedcsname \unknownchar \or % U+2008 PUNCTUATION SPACE
- \strippedcsname \unknownchar \or % U+2009 THIN SPACE
- \strippedcsname \unknownchar \or % U+200A HAIR SPACE
- \strippedcsname \zerowidthspace \or % U+200B ZERO WIDTH SPACE
- \strippedcsname \unknownchar \or % U+200C ZERO WIDTH NON-JOINER
- \strippedcsname \unknownchar \or % U+200D ZERO WIDTH JOINER
- \strippedcsname \unknownchar \or % U+200E LEFT-TO-RIGHT MARK
- \strippedcsname \unknownchar \or % U+200F RIGHT-TO-LEFT MARK
- \strippedcsname \breakinghyphen \or % U+2010 HYPHEN
- \strippedcsname \nonbreakinghyphen\or % U+2011 NON-BREAKING HYPHEN
- \strippedcsname \textminus \or % U+2012 FIGURE DASH
- \strippedcsname \endash \or % U+2013 EN DASH
- \strippedcsname \emdash \or % U+2014 EM DASH
- \strippedcsname \unknownchar \or % U+2015 HORIZONTAL BAR
- \strippedcsname \unknownchar \or % U+2016 DOUBLE VERTICAL LINE
- \strippedcsname \unknownchar \or % U+2017 DOUBLE LOW LINE
- \strippedcsname \quoteleft \or % U+2018 LEFT SINGLE QUOTATION MARK
- \strippedcsname \quoteright \or % U+2019 RIGHT SINGLE QUOTATION MARK
- \strippedcsname \quotesinglebase \or % U+201A SINGLE LOW-9 QUOTATION MARK
- \strippedcsname \unknownchar \or % U+201B SINGLE HIGH-REVERSED-9 QUOTATION MARK
- \strippedcsname \quotedblleft \or % U+201C LEFT DOUBLE QUOTATION MARK
- \strippedcsname \quotedblright \or % U+201D RIGHT DOUBLE QUOTATION MARK
- \strippedcsname \quotedblbase \or % U+201E DOUBLE LOW-9 QUOTATION MARK
- \strippedcsname \unknownchar \or % U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK
- \strippedcsname \textdag \or % U+2020 DAGGER
- \strippedcsname \textddag \or % U+2021 DOUBLE DAGGER
- \strippedcsname \textbullet \or % U+2022 BULLET
- \strippedcsname \unknownchar \or % U+2023 TRIANGULAR BULLET
- \strippedcsname \unknownchar \or % U+2024 ONE DOT LEADER
- \strippedcsname \unknownchar \or % U+2025 TWO DOT LEADER
- \strippedcsname \periods \else % U+2026 HORIZONTAL ELLIPSIS % was: \textellipsis
- \ifcase\numexpr#1-48\relax
- \strippedcsname \perthousand \or % U+2030 PER MILLE SIGN
- \strippedcsname \unknownchar \or % U+2031 PER TEN THOUSAND SIGN
- \strippedcsname \prime \or % U+2032 PRIME
- \strippedcsname \doubleprime \or % U+2033 DOUBLE PRIME
- \strippedcsname \tripleprime \else % U+2034 TRIPLE PRIME
- \ifcase\numexpr#1-57\relax
- \strippedcsname \guilsingleleft \or % U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
- \strippedcsname \guilsingleright \else % U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
- \ifcase\numexpr#1-95\relax
- \strippedcsname \thickspace \or % U+205F MEDIUM MATHEMATICAL SPACE
- \strippedcsname \unknownchar \or %
- \strippedcsname \unknownchar \or % U+2061 FUNCTION APPLICATION
- \strippedcsname \times \or % U+2062 INVISIBLE TIMES
- \strippedcsname \unknownchar \else % U+2063 INVISIBLE COMMA
- \ifcase\numexpr#1-172\relax
- \strippedcsname \texteuro \else
- \strippedcsname \unknownchar
- \fi\fi\fi\fi\fi
+ \enspace \or % U+2000 EN QUAD
+ \emspace \or % U+2001 EM QUAD
+ \enspace \or % U+2002 EN SPACE
+ \emspace \or % U+2003 EM SPACE
+ \unic@threeperemspace \or % U+2004 THREE-PER-EM SPACE
+ \unic@fourperemspace \or % U+2005 FOUR-PER-EM SPACE
+ \unic@sixperemspace \or % U+2006 SIX-PER-EM SPACE
+ \unic@figurespace \or % U+2007 FIGURE SPACE
+ \unmic@punctiationspace \or % U+2008 PUNCTUATION SPACE
+ \thinspace \or % U+2009 THIN SPACE
+ \unic@hairspace \or % U+200A HAIR SPACE
+ \unic@zerowidthspace \or % U+200B ZERO WIDTH SPACE
+ \unic@zerowidthnonjoiner \or % U+200C ZERO WIDTH NON-JOINER
+ \unic@zerowidthjoiner \or % U+200D ZERO WIDTH JOINER
+ \unknownchar \or % U+200E LEFT-TO-RIGHT MARK
+ \unknownchar \or % U+200F RIGHT-TO-LEFT MARK
+ \breakinghyphen \or % U+2010 HYPHEN
+ \nonbreakinghyphen \or % U+2011 NON-BREAKING HYPHEN
+ \endash \or % U+2012 FIGURE DASH
+ \endash \or % U+2013 EN DASH
+ \emdash \or % U+2014 EM DASH
+ \emdash \or % U+2015 HORIZONTAL BAR
+ \unic@doubleverticalline \or % U+2016 DOUBLE VERTICAL LINE
+ \unic@doublelowline \or % U+2017 DOUBLE LOW LINE
+ \quoteleft \or % U+2018 LEFT SINGLE QUOTATION MARK
+ \quoteright \or % U+2019 RIGHT SINGLE QUOTATION MARK
+ \quotesinglebase \or % U+201A SINGLE LOW-9 QUOTATION MARK
+ \unic@quoteleftreversed \or % U+201B SINGLE HIGH-REVERSED-9 QUOTATION MARK
+ \quotedblleft \or % U+201C LEFT DOUBLE QUOTATION MARK
+ \quotedblright \or % U+201D RIGHT DOUBLE QUOTATION MARK
+ \quotedblbase \or % U+201E DOUBLE LOW-9 QUOTATION MARK
+ \unic@quotedblleftreversed \or % U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK
+ \textdag \or % U+2020 DAGGER
+ \textddag \or % U+2021 DOUBLE DAGGER
+ \textbullet \or % U+2022 BULLET
+ \blacktriangleright \or % U+2023 TRIANGULAR BULLET
+ \unic@onedotleader \or % U+2024 ONE DOT LEADER
+ \unic@twodotleader \or % U+2025 TWO DOT LEADER
+ \periods \or % U+2026 HORIZONTAL ELLIPSIS % was: \textellipsis
+ \unic@hyphenationpoint \or % U+2027 HYPHENATION POINT
+ \crlf \or % U+2028 LINE SEPARATOR
+ \endgraf \or % U+2029 PARAGRAPH SEPARATOR
+ \unknownchar \or % U+202A LEFT-TO-RIGHT EMBEDDING
+ \unknownchar \or % U+202B RIGHT-TO-LEFT EMBEDDING
+ \unknownchar \or % U+202C POP DIRECTIONAL FORMATTING
+ \unknownchar \or % U+202D LEFT-TO-RIGHT OVERRIDE
+ \unknownchar \or % U+202E RIGHT-TO-LEFT OVERRIDE
+ \ \or % U+202F NARROW NO-BREAK SPACE
+ \perthousand \or % U+2030 PER MILLE SIGN
+ \unknownchar \or % U+2031 PER TEN THOUSAND SIGN
+ \prime \or % U+2032 PRIME
+ \unic@doubleprime \or % U+2033 DOUBLE PRIME
+ \unic@tripleprime \or % U+2034 TRIPLE PRIME
+ \backprime \or % U+2035 REVERSED PRIME
+ \unic@reverseddoubleprime \or % U+2036 REVERSED DOUBLE PRIME
+ \unic@reversedtripleprime \or % U+2037 REVERSED TRIPLE PRIME
+ \unknownchar \or % U+2038 CARET
+ \guilsingleleft \or % U+2039 SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+ \guilsingleright \or % U+203A SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+ \unknownchar \or % U+203B REFERENCE MARK
+ \unic@doubleexclamationmark \or % U+203C DOUBLE EXCLAMATION MARK
+ \unknownchar \or % U+203D INTERROBANG
+ \unknownchar \or % U+203E OVERLINE
+ \unknownchar \or % U+203F UNDERTIE
+ \unknownchar \or % U+2040 CHARACTER TIE
+ \unknownchar \or % U+2041 CARET INSERTION POINT
+ \unknownchar \or % U+2042 ASTERISM
+ \unknownchar \or % U+2043 HYPHEN BULLET
+ \unic@fractionslash \or % U+2044 FRACTION SLASH
+ \unknownchar \or % U+2045 LEFT SQUARE BRACKET WITH QUILL
+ \unknownchar \or % U+2046 RIGHT SQUARE BRACKET WITH QUILL
+ \unic@doublequestionmark \or % U+2047 DOUBLE QUESTION MARK
+ \unic@exclamationquestionmark\or % U+2048 QUESTION EXCLAMATION MARK
+ \unic@questionexclamationmark\or % U+2049 EXCLAMATION QUESTION MARK
+ \unknownchar \or % U+204A TIRONIAN SIGN ET
+ \unic@reversedpilcrowsign \or % U+204B REVERSED PILCROW SIGN
+ \unknownchar \or % U+204C BLACK LEFTWARDS BULLET
+ \unknownchar \or % U+204D BLACK RIGHTWARDS BULLET
+ \unic@lowasterisk \or % U+204E LOW ASTERISK
+ \unic@reversedsemicolon \or % U+204F REVERSED SEMICOLON
+ \unknownchar \or % U+2050 CLOSE UP
+ \unknownchar \or % U+2051 TWO ASTERISKS ALIGNED VERTICALLY
+ \unknownchar \or % U+2052 COMMERCIAL MINUS SIGN
+ \unknownchar \or % U+2053 SWUNG DASH
+ \unknownchar \or % U+2054 INVERTED UNDERTIE
+ \unknownchar \or % U+2055 FLOWER PUNCTUATION MARK
+ \unknownchar \or % U+2056 THREE DOT PUNCTUATION
+ \unknownchar \or % U+2057 QUADRUPLE PRIME
+ \unknownchar \or % U+2058 FOUR DOT PUNCTUATION
+ \unknownchar \or % U+2059 FIVE DOT PUNCTUATION
+ \unknownchar \or % U+205A TWO DOT PUNCTUATION
+ \unknownchar \or % U+205B FOUR DOT MARK
+ \unknownchar \or % U+205C DOTTED CROSS
+ \unknownchar \or % U+205D TRICOLON
+ \unknownchar \or % U+205E VERTICAL FOUR DOTS
+ \thickspace \or % U+205F MEDIUM MATHEMATICAL SPACE
+ \relax \or % U+2060 WORD JOINER
+ \unic@functionapplication \or % U+2061 FUNCTION APPLICATION
+ \unic@invisibletimes \or % U+2062 INVISIBLE TIMES
+ \unic@invisibleseparator \or % U+2063 INVISIBLE SEPARATOR (COMMA)
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \relax \or % U+206A INHIBIT SYMMETRIC SWAPPING
+ \relax \or % U+206B ACTIVATE SYMMETRIC SWAPPING
+ \relax \or % U+206C INHIBIT ARABIC FORM SHAPING
+ \relax \or % U+206D ACTIVATE ARABIC FORM SHAPING
+ \relax \or % U+206E NATIONAL DIGIT SHAPES
+ \relax \or % U+206F NOMINAL DIGIT SHAPES
+ \unic@superscriptzero \or % U+2070 SUPERSCRIPT ZERO
+ \unic@superscripti \or % U+2071 SUPERSCRIPT LATIN SMALL LETTER I
+ \unknownchar \or % U+2072 <reserved>
+ \unknownchar \or % U+2073 <reserved>
+ \unic@superscriptfour \or % U+2074 SUPERSCRIPT FOUR
+ \unic@superscriptfive \or % U+2075 SUPERSCRIPT FIVE
+ \unic@superscriptsix \or % U+2076 SUPERSCRIPT SIX
+ \unic@superscriptseven \or % U+2077 SUPERSCRIPT SEVEN
+ \unic@superscripteight \or % U+2078 SUPERSCRIPT EIGHT
+ \unic@superscriptnine \or % U+2079 SUPERSCRIPT NINE
+ \unic@superscriptplus \or % U+207A SUPERSCRIPT PLUS SIGN
+ \unic@superscriptminus \or % U+207B SUPERSCRIPT MINUS
+ \unic@superscriptequals \or % U+207C SUPERSCRIPT EQUALS SIGN
+ \unic@superscriptleft \or % U+207D SUPERSCRIPT LEFT PARENTHESIS
+ \unic@superscriptright \or % U+207E SUPERSCRIPT RIGHT PARENTHESIS
+ \unic@superscriptn \or % U+207F SUBSCRIPT LATIN SMALL LETTER N
+ \unic@subscriptzero \or % U+2080 SUBSCRIPT ZERO
+ \unic@subscriptone \or % U+2081 SUBSCRIPT ONE
+ \unic@subscripttwo \or % U+2082 SUBSCRIPT TWO
+ \unic@subscriptthree \or % U+2083 SUBSCRIPT THREE
+ \unic@subscriptfour \or % U+2084 SUBSCRIPT FOUR
+ \unic@subscriptfive \or % U+2085 SUBSCRIPT FIVE
+ \unic@subscriptsix \or % U+2086 SUBSCRIPT SIX
+ \unic@subscriptseven \or % U+2087 SUBSCRIPT SEVEN
+ \unic@subscripteight \or % U+2088 SUBSCRIPT EIGHT
+ \unic@subscriptnine \or % U+2089 SUBSCRIPT NINE
+ \unic@subscriptplus \or % U+208A SUBSCRIPT PLUS SIGN
+ \unic@subscriptminus \or % U+208B SUBSCRIPT MINUS
+ \unic@subscriptequals \or % U+208C SUBSCRIPT EQUALS SIGN
+ \unic@subscriptleft \or % U+208D SUBSCRIPT LEFT PARENTHESIS
+ \unic@subscriptright \or % U+208E SUBSCRIPT RIGHT PARENTHESIS
+ \unknownchar \or %
+ \unic@subscripta \or % U+2090 LATIN SUBSCRIPT SMALL LETTER A
+ \unic@subscripte \or % U+2091 LATIN SUBSCRIPT SMALL LETTER E
+ \unic@subscripto \or % U+2092 LATIN SUBSCRIPT SMALL LETTER O
+ \unic@subscriptx \or % U+2093 LATIN SUBSCRIPT SMALL LETTER X
+ \unic@subscriptschwa \or % U+2094 LATIN SUBSCRIPT SMALL LETTER SCHWA
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or % U+20A0 EURO-CURRENCY SIGN
+ \unknownchar \or % U+20A1 COLON SIGN
+ \unknownchar \or % U+20A2 CRUZEIRO SIGN
+ \unknownchar \or % U+20A3 FRENCH FRANC SIGN
+ \unknownchar \or % U+20A4 LIRA SIGN
+ \unknownchar \or % U+20A5 MILL SIGN
+ \unknownchar \or % U+20A6 NAIRA SIGN
+ \unknownchar \or % U+20A7 PESETA SIGN
+ \unknownchar \or % U+20A8 RUPEE SIGN
+ \unknownchar \or % U+20A9 WON SIGN
+ \unknownchar \or % U+20AA NEW SHEQEL SIGN
+ \textdong \or % U+20AB DONG SIGN
+ \texteuro \or % U+20AC EURO SIGN
+ \unknownchar \or % U+20AD KIP SIGN
+ \unknownchar \or % U+20AE TUGRIK SIGN
+ \unknownchar \or % U+20AF DRACHMA SIGN
+ \unknownchar \or % U+20B0 GERMAN PENNY SIGN
+ \unknownchar \or % U+20B1 PESO SIGN
+ \unknownchar \or % U+20B2 GUARANI SIGN
+ \unknownchar \or % U+20B3 AUSTRAL SIGN
+ \unknownchar \or % U+20B4 HRYVNIA SIGN
+ \unknownchar \or % U+20B5 CEDI SIGN
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or % U+20D0 COMBINING LEFT HARPOON ABOVE
+ \unknownchar \or % U+20D1 COMBINING RIGHT HARPOON ABOVE
+ \unknownchar \or % U+20D2 COMBINING LONG VERTICAL LINE OVERLAY
+ \unknownchar \or % U+20D3 COMBINING SHORT VERTICAL LINE OVERLAY
+ \unknownchar \or % U+20D4 COMBINING ANTICLOCKWISE ARROW ABOVE
+ \unknownchar \or % U+20D5 COMBINING CLOCKWISE ARROW ABOVE
+ \unknownchar \or % U+20D6 COMBINING LEFT ARROW ABOVE
+ \unknownchar \or % U+20D7 COMBINING RIGHT ARROW ABOVE
+ \unknownchar \or % U+20D8 COMBINING RING OVERLAY
+ \unknownchar \or % U+20D9 COMBINING CLOCKWISE RING OVERLAY
+ \unknownchar \or % U+20DA COMBINING ANTICLOCKWISE RING OVERLAY
+ \unknownchar \or % U+20DB COMBINING THREE DOTS ABOVE
+ \unknownchar \or % U+20DC COMBINING FOUR DOTS ABOVE
+ \unknownchar \or % U+20DD COMBINING ENCLOSING CIRCLE
+ \unknownchar \or % U+20DE COMBINING ENCLOSING SQUARE
+ \unknownchar \or % U+20DF COMBINING ENCLOSING DIAMOND
+ \unknownchar \or % U+20E0 COMBINING ENCLOSING CIRCLE BACKSLASH
+ \unknownchar \or % U+20E1 COMBINING LEFT RIGHT ARROW ABOVE
+ \unknownchar \or % U+20E2 COMBINING ENCLOSING SCREEN
+ \unknownchar \or % U+20E3 COMBINING ENCLOSING KEYCAP
+ \unknownchar \or % U+20E4 COMBINING ENCLOSING UPWARD POINTING TRIANGLE
+ \unknownchar \or % U+20E5 COMBINING REVERSE SOLIDUS OVERLAY
+ \unknownchar \or % U+20E6 COMBINING DOUBLE VERTICAL STROKE OVERLAY
+ \unknownchar \or % U+20E7 COMBINING ANNUITY SYMBOL
+ \unknownchar \or % U+20E8 COMBINING TRIPLE UNDERDOT
+ \unknownchar \or % U+20E9 COMBINING WIDE BRIDGE ABOVE
+ \unknownchar \or % U+20EA COMBINING LEFTWARDS ARROW OVERLAY
+ \unknownchar \or % U+20EB COMBINING LONG DOUBLE SOLIDUS OVERLAY
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \or %
+ \unknownchar \else %
+ \unknownchar \fi
\stopunicodevector
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/unic-033.tex b/Master/texmf-dist/tex/context/base/unic-033.tex
index 632285a0e2a..91311a029d1 100644
--- a/Master/texmf-dist/tex/context/base/unic-033.tex
+++ b/Master/texmf-dist/tex/context/base/unic-033.tex
@@ -1,9 +1,9 @@
%D \module
%D [ file=unic-033,
-%D version=2005.06.11,
+%D version=2006.03.29,
%D title=\CONTEXT\ \UNICODE\ Macros,
%D subtitle=Vector 33,
-%D author={Nikolai Weibull \& Hans Hagen},
+%D author={Nikolai Weibull \& Hans Hagen \& Taco Hoekwater},
%D date=\currentdate,
%D copyright={PRAGMA / Nikolai Weibull}]
@@ -11,119 +11,263 @@
\startunicodevector 33
\expandafter\strippedcsname
- \ifcase\numexpr#1-144\relax
- \leftarrow \or % LEFTWARDS ARROW
- \uparrow \or % UPWARDS ARROW
- \rightarrow \or % RIGHTWARDS ARROW
- \downarrow \or % DOWNWARDS ARROW
- \leftrightarrow \or % LEFT RIGHT ARROW
- \updownarrow \or % UP DOWN ARROW
- \nwarrow \or % NORTH WEST ARROW
- \nearrow \or % NORTH EAST ARROW
- \searrow \or % SOUTH EAST ARROW
- \swarrow \or % SOUTH WEST ARROW
- \nleftarrow \or % LEFTWARDS ARROW WITH STROKE
- \nrightarrow \or % RIGHTWARDS ARROW WITH STROKE
- \unknownchar \or % LEFTWARDS WAVE ARROW
- \unknownchar \or % RIGHTWARDS WAVE ARROW
- \twoheadedleftarrow \or % LEFTWARDS TWO HEADED ARROW
- \unknownchar \or % UPWARDS TWO HEADED ARROW
- \twoheadedrightarrow \or % RIGHTWARDS TWO HEADED ARROW
- \unknownchar \or % DOWNWARDS TWO HEADED ARROW
- \leftarrowtail \or % LEFTWARDS ARROW WITH TAIL
- \rightarrowtail \or % RIGHTWARDS ARROW WITH TAIL
- \mapsfrom \or % LEFTWARDS ARROW FROM BAR
- \unknownchar \or % UPWARDS ARROW FROM BAR
- \mapsto \or % RIGHTWARDS ARROW FROM BAR
- \unknownchar \or % DOWNWARDS ARROW FROM BAR
- \unknownchar \or % UP DOWN ARROW WITH BASE
- \hookleftarrow \or % LEFTWARDS ARROW WITH HOOK
- \hookrightarrow \or % RIGHTWARDS ARROW WITH HOOK
- \loopleftarrow \or % LEFTWARDS ARROW WITH LOOP
- \looprightarrow \or % RIGHTWARDS ARROW WITH LOOP
- \unknownchar \or % LEFT RIGHT WAVE ARROW
- \nleftrightarrow \or % LEFT RIGHT ARROW WITH STROKE
- \lightning \or % DOWNWARDS ZIGZAG ARROW
- \Lsh \or % UPWARDS ARROW WITH TIP LEFTWARDS
- \Rsh \or % UPWARDS ARROW WITH TIP RIGHTWARDS
- \unknownchar \or % DOWNWARDS ARROW WITH TIP LEFTWARDS
- \unknownchar \or % DOWNWARDS ARROW WITH TIP RIGHTWARDS
- \unknownchar \or % RIGHTWARDS ARROW WITH CORNER DOWNWARDS
- \unknownchar \or % DOWNWARDS ARROW WITH CORNER LEFTWARDS
- \curveleftarrow \or % ANTICLOCKWISE TOP SEMICIRCLE ARROW
- \curverightarrow \or % CLOCKWISE TOP SEMICIRCLE ARROW
- \unknownchar \or % NORTH WEST ARROW TO LONG BAR
- \unknownchar \or % LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR
- \circlearrowleft \or % ANTICLOCKWISE OPEN CIRCLE ARROW
- \circlearrowright \or % CLOCKWISE OPEN CIRCLE ARROW
- \leftharpoonup \or % LEFTWARDS HARPOON WITH BARB UPWARDS
- \leftharpoondown \or % LEFTWARDS HARPOON WITH BARB DOWNWARDS
- \upharpoonright \or % UPWARDS HARPOON WITH BARB RIGHTWARDS
- \upharpoonleft \or % UPWARDS HARPOON WITH BARB LEFTWARDS
- \rightharpoonup \or % RIGHTWARDS HARPOON WITH BARB UPWARDS
- \rightharpoondown \or % RIGHTWARDS HARPOON WITH BARB DOWNWARDS
- \downharpoonright \or % DOWNWARDS HARPOON WITH BARB RIGHTWARDS
- \downharpoonleft \or % DOWNWARDS HARPOON WITH BARB LEFTWARDS
- \rightleftarrows \or % RIGHTWARDS ARROW OVER LEFTWARDS ARROW
- \unknownchar \or % UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW
- \leftrightarrows \or % LEFTWARDS ARROW OVER RIGHTWARDS ARROW
- \leftleftarrows \or % LEFTWARDS PAIRED ARROWS
- \upuparrows \or % UPWARDS PAIRED ARROWS
- \rightrightarrows \or % RIGHTWARDS PAIRED ARROWS
- \downdownarrows \or % DOWNWARDS PAIRED ARROWS
- \leftrightharpoons \or % LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
- \rightleftharpoons \or % RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
- \nLeftarrow \or % LEFTWARDS DOUBLE ARROW WITH STROKE
- \nLeftrightarrow \or % LEFT RIGHT DOUBLE ARROW WITH STROKE
- \nRightarrow \or % RIGHTWARDS DOUBLE ARROW WITH STROKE
- \Leftarrow \or % LEFTWARDS DOUBLE ARROW
- \Uparrow \or % UPWARDS DOUBLE ARROW
- \Rightarrow \or % RIGHTWARDS DOUBLE ARROW
- \Downarrow \or % DOWNWARDS DOUBLE ARROW
- \Leftrightarrow \or % LEFT RIGHT DOUBLE ARROW
- \Updownarrow \or % UP DOWN DOUBLE ARROW
- \unknownchar \or % NORTH WEST DOUBLE ARROW
- \unknownchar \or % NORTH EAST DOUBLE ARROW
- \unknownchar \or % SOUTH EAST DOUBLE ARROW
- \unknownchar \or % SOUTH WEST DOUBLE ARROW
- \Lleftarrow \or % LEFTWARDS TRIPLE ARROW
- \unknownchar \or % RIGHTWARDS TRIPLE ARROW
- \leftsquidarrow \or % LEFTWARDS SQUIGGLE ARROW
- \rightsquidarrow \or % RIGHTWARDS SQUIGGLE ARROW
- \unknownchar \or % UPWARDS ARROW WITH DOUBLE STROKE
- \unknownchar \or % DOWNWARDS ARROW WITH DOUBLE STROKE
- \dashleftarrow \or % LEFTWARDS DASHED ARROW
- \unknownchar \or % UPWARDS DASHED ARROW
- \dashrightarrow \or % RIGHTWARDS DASHED ARROW
- \unknownchar \or % DOWNWARDS DASHED ARROW
- \unic@leftarrowtobar \or % LEFTWARDS ARROW TO BAR
- \unknownchar \or % RIGHTWARDS ARROW TO BAR
- \unknownchar \or % LEFTWARDS WHITE ARROW
- \unknownchar \or % UPWARDS WHITE ARROW
- \unknownchar \or % RIGHTWARDS WHITE ARROW
- \unknownchar \or % DOWNWARDS WHITE ARROW
- \unknownchar \or % UPWARDS WHITE ARROW FROM BAR
- \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL
- \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR
- \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR
- \unknownchar \or % UPWARDS WHITE DOUBLE ARROW
- \unknownchar \or % UPWARDS WHITE DOUBLE ARROW ON PEDESTAL
- \unknownchar \or % RIGHTWARDS WHITE ARROW FROM WALL
- \unknownchar \or % NORTH WEST ARROW TO CORNER
- \unknownchar \or % SOUTH EAST ARROW TO CORNER
- \unknownchar \or % UP DOWN WHITE ARROW
- \unknownchar \or % RIGHT ARROW WITH SMALL CIRCLE
- \unknownchar \or % DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
- \unknownchar \or % THREE RIGHTWARDS ARROWS
- \unknownchar \or % LEFTWARDS ARROW WITH VERTICAL STROKE
- \unknownchar \or % RIGHTWARDS ARROW WITH VERTICAL STROKE
- \unknownchar \or % LEFT RIGHT ARROW WITH VERTICAL STROKE
- \unknownchar \or % LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
- \unknownchar \or % RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE
- \unknownchar \or % LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE
- \leftarrowtriangle \or % LEFTWARDS OPEN-HEADED ARROW
- \rightarrowtriangle \or % RIGHTWARDS OPEN-HEADED ARROW
- \leftrightarrowtriangle\else % LEFT RIGHT OPEN-HEADED ARROW
+ \ifcase\numexpr#1\relax
+ \unic@accountof \or % 2100 ACCOUNT OF
+ \unic@addressedtothesubject \or % 2101 ADDRESSED TO THE SUBJECT
+ \unic@doublestruckC \or % 2102 DOUBLE-STRUCK CAPITAL C
+ \unic@degreecelsius \or % 2103 DEGREE CELSIUS
+ \unic@centrelinesymbol \or % 2104 CENTRE LINE SYMBOL
+ \unic@careof \or % 2105 CARE OF
+ \unic@cadauna \or % 2106 CADA UNA
+ \unic@eulerconstant \or % 2107 EULER CONSTANT
+ \unic@scruple \or % 2108 SCRUPLE
+ \unic@degreefahrenheit \or % 2109 DEGREE FAHRENHEIT
+ \unic@scriptg \or % 210A SCRIPT SMALL G
+ \unic@scriptH \or % 210B SCRIPT CAPITAL H
+ \unic@blackletterH \or % 210C BLACK-LETTER CAPITAL H
+ \unic@doublestruckH \or % 210D DOUBLE-STRUCK CAPITAL H
+ \unic@planckconstant \or % 210E PLANCK CONSTANT
+ \unic@planckconstantovertwopi \or % 210F PLANCK CONSTANT OVER TWO PI
+ \unic@scriptI \or % 2110 SCRIPT CAPITAL I
+ \unic@blackletterI \or % 2111 BLACK-LETTER CAPITAL I
+ \unic@scriptL \or % 2112 SCRIPT CAPITAL L
+ \unic@scriptl \or % 2113 SCRIPT SMALL L
+ \unic@lbbarsymbol \or % 2114 L B BAR SYMBOL
+ \unic@doublestruckN \or % 2115 DOUBLE-STRUCK CAPITAL N
+ \unic@numerosign \or % 2116 NUMERO SIGN
+ \unic@soundrecordingcopyright \or % 2117 SOUND RECORDING COPYRIGHT
+ \unic@scriptP \or % 2118 SCRIPT CAPITAL P
+ \unic@doublestruckP \or % 2119 DOUBLE-STRUCK CAPITAL P
+ \unic@doublestruckQ \or % 211A DOUBLE-STRUCK CAPITAL Q
+ \unic@scriptR \or % 211B SCRIPT CAPITAL R
+ \unic@blackletterR \or % 211C BLACK-LETTER CAPITAL R
+ \unic@doublestruckR \or % 211D DOUBLE-STRUCK CAPITAL R
+ \unic@prescriptiontake \or % 211E PRESCRIPTION TAKE
+ \unic@response \or % 211F RESPONSE
+ \unic@servicemark \or % 2120 SERVICE MARK
+ \unic@telephonesign \or % 2121 TELEPHONE SIGN
+ \unic@trademarksign \or % 2122 TRADE MARK SIGN
+ \unic@versickle \or % 2123 VERSICLE
+ \unic@doublestruckZ \or % 2124 DOUBLE-STRUCK CAPITAL Z
+ \unic@ouncesign \or % 2125 OUNCE SIGN
+ \unic@ohmsign \or % 2126 OHM SIGN
+ \unic@invertedohmsign \or % 2127 INVERTED OHM SIGN
+ \unic@blackletterZ \or % 2128 BLACK-LETTER CAPITAL Z
+ \unic@turnedgreekletteriota \or % 2129 TURNED GREEK SMALL LETTER IOTA
+ \unic@kelvinsign \or % 212A KELVIN SIGN
+ \unic@angstromsign \or % 212B ANGSTROM SIGN
+ \unic@scriptB \or % 212C SCRIPT CAPITAL B
+ \unic@blackletterC \or % 212D BLACK-LETTER CAPITAL C
+ \unic@estimatedsymbol \or % 212E ESTIMATED SYMBOL
+ \unic@scripte \or % 212F SCRIPT SMALL E
+ \unic@scriptE \or % 2130 SCRIPT CAPITAL E
+ \unic@scriptF \or % 2131 SCRIPT CAPITAL F
+ \unic@turnedF \or % 2132 TURNED CAPITAL F
+ \unic@scriptM \or % 2133 SCRIPT CAPITAL M
+ \unic@scripto \or % 2134 SCRIPT SMALL O
+ \aleph \or % 2135 ALEF SYMBOL
+ \beth \or % 2136 BET SYMBOL
+ \gimel \or % 2137 GIMEL SYMBOL
+ \daleth \or % 2138 DALET SYMBOL
+ \unic@informationsource \or % 2139 INFORMATION SOURCE
+ \unic@rotatedQ \or % 213A ROTATED CAPITAL Q
+ \unic@facsimilesign \or % 213B FACSIMILE SIGN
+ \unic@doublestruckpi \or % 213C DOUBLE-STRUCK SMALL PI
+ \unic@doublestruckgamma \or % 213D DOUBLE-STRUCK SMALL GAMMA
+ \unic@doublestruckGamma \or % 213E DOUBLE-STRUCK CAPITAL GAMMA
+ \unic@doublestruckPi \or % 213F DOUBLE-STRUCK CAPITAL PI
+ \unic@doublestrucknarysummation \or % 2140 DOUBLE-STRUCK N-ARY SUMMATION
+ \unic@turnedsansserifG \or % 2141 TURNED SANS-SERIF CAPITAL G
+ \unic@turnedsansserifL \or % 2142 TURNED SANS-SERIF CAPITAL L
+ \unic@reversedsansserifL \or % 2143 REVERSED SANS-SERIF CAPITAL L
+ \unic@turnedsansserifY \or % 2144 TURNED SANS-SERIF CAPITAL Y
+ \unic@doublestruckitalicD \or % 2145 DOUBLE-STRUCK ITALIC CAPITAL D
+ \unic@doublestruckitalicd \or % 2146 DOUBLE-STRUCK ITALIC SMALL D
+ \unic@doublestruckitalice \or % 2147 DOUBLE-STRUCK ITALIC SMALL E
+ \unic@doublestruckitalici \or % 2148 DOUBLE-STRUCK ITALIC SMALL I
+ \unic@doublestruckitalicj \or % 2149 DOUBLE-STRUCK ITALIC SMALL J
+ \unic@propertyline \or % 214A PROPERTY LINE
+ \unic@turnedampersand \or % 214B TURNED AMPERSAND
+ \unic@persign \or % 214C PER SIGN
+ \unknownchar \or % 214D
+ \unknownchar \or % 214E
+ \unknownchar \or % 214F
+ \unknownchar \or % 2150
+ \unknownchar \or % 2151
+ \unknownchar \or % 2152
+ \unic@fractiononethird \or % 2153 VULGAR FRACTION ONE THIRD
+ \unic@fractiontwothirds \or % 2154 VULGAR FRACTION TWO THIRDS
+ \unic@fractiononefifth \or % 2155 VULGAR FRACTION ONE FIFTH
+ \unic@fractiontwofifths \or % 2156 VULGAR FRACTION TWO FIFTHS
+ \unic@fractionthreefifths \or % 2157 VULGAR FRACTION THREE FIFTHS
+ \unic@fractionfourfifths \or % 2158 VULGAR FRACTION FOUR FIFTHS
+ \unic@fractiononesixth \or % 2159 VULGAR FRACTION ONE SIXTH
+ \unic@fractionfivesixths \or % 215A VULGAR FRACTION FIVE SIXTHS
+ \unic@fractiononeeighth \or % 215B VULGAR FRACTION ONE EIGHTH
+ \unic@fractionthreeeighths \or % 215C VULGAR FRACTION THREE EIGHTHS
+ \unic@fractionfiveeighths \or % 215D VULGAR FRACTION FIVE EIGHTHS
+ \unic@fractionseveneighths \or % 215E VULGAR FRACTION SEVEN EIGHTHS
+ \unic@fractionnumeratorone \or % 215F FRACTION NUMERATOR ONE
+ \unic@romannumeralOne \or % 2160 ROMAN NUMERAL ONE
+ \unic@romannumeralTwo \or % 2161 ROMAN NUMERAL TWO
+ \unic@romannumeralThree \or % 2162 ROMAN NUMERAL THREE
+ \unic@romannumeralFour \or % 2163 ROMAN NUMERAL FOUR
+ \unic@romannumeralFive \or % 2164 ROMAN NUMERAL FIVE
+ \unic@romannumeralSix \or % 2165 ROMAN NUMERAL SIX
+ \unic@romannumeralSeven \or % 2166 ROMAN NUMERAL SEVEN
+ \unic@romannumeralEight \or % 2167 ROMAN NUMERAL EIGHT
+ \unic@romannumeralNine \or % 2168 ROMAN NUMERAL NINE
+ \unic@romannumeralTen \or % 2169 ROMAN NUMERAL TEN
+ \unic@romannumeralEleven \or % 216A ROMAN NUMERAL ELEVEN
+ \unic@romannumeralTwelve \or % 216B ROMAN NUMERAL TWELVE
+ \unic@romannumeralFifty \or % 216C ROMAN NUMERAL FIFTY
+ \unic@romannumeralOnehundred \or % 216D ROMAN NUMERAL ONE HUNDRED
+ \unic@romannumeralFivehundred \or % 216E ROMAN NUMERAL FIVE HUNDRED
+ \unic@romannumeralOnethousand \or % 216F ROMAN NUMERAL ONE THOUSAND
+ \unic@romannumeralone \or % 2170 SMALL ROMAN NUMERAL ONE
+ \unic@romannumeraltwo \or % 2171 SMALL ROMAN NUMERAL TWO
+ \unic@romannumeralthree \or % 2172 SMALL ROMAN NUMERAL THREE
+ \unic@romannumeralfour \or % 2173 SMALL ROMAN NUMERAL FOUR
+ \unic@romannumeralfive \or % 2174 SMALL ROMAN NUMERAL FIVE
+ \unic@romannumeralsix \or % 2175 SMALL ROMAN NUMERAL SIX
+ \unic@romannumeralseven \or % 2176 SMALL ROMAN NUMERAL SEVEN
+ \unic@romannumeraleight \or % 2177 SMALL ROMAN NUMERAL EIGHT
+ \unic@romannumeralnine \or % 2178 SMALL ROMAN NUMERAL NINE
+ \unic@romannumeralten \or % 2179 SMALL ROMAN NUMERAL TEN
+ \unic@romannumeraleleven \or % 217A SMALL ROMAN NUMERAL ELEVEN
+ \unic@romannumeraltwelve \or % 217B SMALL ROMAN NUMERAL TWELVE
+ \unic@romannumeralfifty \or % 217C SMALL ROMAN NUMERAL FIFTY
+ \unic@romannumeralonehundred \or % 217D SMALL ROMAN NUMERAL ONE HUNDRED
+ \unic@romannumeralfivehundred \or % 217E SMALL ROMAN NUMERAL FIVE HUNDRED
+ \unic@romannumeralonethousand \or % 217F SMALL ROMAN NUMERAL ONE THOUSAND
+ \unic@romannumeralonethousandCD \or % 2180 ROMAN NUMERAL ONE THOUSAND C D
+ \unic@romannumeralfivethousand \or % 2181 ROMAN NUMERAL FIVE THOUSAND
+ \unic@romannumeraltenthousand \or % 2182 ROMAN NUMERAL TEN THOUSAND
+ \unic@romannumeralreversedonehundred\or % 2183 ROMAN NUMERAL REVERSED ONE HUNDRED
+ \unknownchar \or % 2184
+ \unknownchar \or % 2185
+ \unknownchar \or % 2186
+ \unknownchar \or % 2187
+ \unknownchar \or % 2188
+ \unknownchar \or % 2189
+ \unknownchar \or % 218A
+ \unknownchar \or % 218B
+ \unknownchar \or % 218C
+ \unknownchar \or % 218D
+ \unknownchar \or % 218E
+ \unknownchar \or % 218F
+ \leftarrow \or % LEFTWARDS ARROW
+ \uparrow \or % UPWARDS ARROW
+ \rightarrow \or % RIGHTWARDS ARROW
+ \downarrow \or % DOWNWARDS ARROW
+ \leftrightarrow \or % LEFT RIGHT ARROW
+ \updownarrow \or % UP DOWN ARROW
+ \nwarrow \or % NORTH WEST ARROW
+ \nearrow \or % NORTH EAST ARROW
+ \searrow \or % SOUTH EAST ARROW
+ \swarrow \or % SOUTH WEST ARROW
+ \nleftarrow \or % LEFTWARDS ARROW WITH STROKE
+ \nrightarrow \or % RIGHTWARDS ARROW WITH STROKE
+ \unknownchar \or % LEFTWARDS WAVE ARROW
+ \unknownchar \or % RIGHTWARDS WAVE ARROW
+ \twoheadedleftarrow \or % LEFTWARDS TWO HEADED ARROW
+ \unknownchar \or % UPWARDS TWO HEADED ARROW
+ \twoheadedrightarrow \or % RIGHTWARDS TWO HEADED ARROW
+ \unknownchar \or % DOWNWARDS TWO HEADED ARROW
+ \leftarrowtail \or % LEFTWARDS ARROW WITH TAIL
+ \rightarrowtail \or % RIGHTWARDS ARROW WITH TAIL
+ \mapsfrom \or % LEFTWARDS ARROW FROM BAR
+ \unknownchar \or % UPWARDS ARROW FROM BAR
+ \mapsto \or % RIGHTWARDS ARROW FROM BAR
+ \unknownchar \or % DOWNWARDS ARROW FROM BAR
+ \unknownchar \or % UP DOWN ARROW WITH BASE
+ \hookleftarrow \or % LEFTWARDS ARROW WITH HOOK
+ \hookrightarrow \or % RIGHTWARDS ARROW WITH HOOK
+ \loopleftarrow \or % LEFTWARDS ARROW WITH LOOP
+ \looprightarrow \or % RIGHTWARDS ARROW WITH LOOP
+ \unknownchar \or % LEFT RIGHT WAVE ARROW
+ \nleftrightarrow \or % LEFT RIGHT ARROW WITH STROKE
+ \lightning \or % DOWNWARDS ZIGZAG ARROW
+ \Lsh \or % UPWARDS ARROW WITH TIP LEFTWARDS
+ \Rsh \or % UPWARDS ARROW WITH TIP RIGHTWARDS
+ \unknownchar \or % DOWNWARDS ARROW WITH TIP LEFTWARDS
+ \unknownchar \or % DOWNWARDS ARROW WITH TIP RIGHTWARDS
+ \unknownchar \or % RIGHTWARDS ARROW WITH CORNER DOWNWARDS
+ \unknownchar \or % DOWNWARDS ARROW WITH CORNER LEFTWARDS
+ \curveleftarrow \or % ANTICLOCKWISE TOP SEMICIRCLE ARROW
+ \curverightarrow \or % CLOCKWISE TOP SEMICIRCLE ARROW
+ \unknownchar \or % NORTH WEST ARROW TO LONG BAR
+ \unknownchar \or % LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR
+ \circlearrowleft \or % ANTICLOCKWISE OPEN CIRCLE ARROW
+ \circlearrowright \or % CLOCKWISE OPEN CIRCLE ARROW
+ \leftharpoonup \or % LEFTWARDS HARPOON WITH BARB UPWARDS
+ \leftharpoondown \or % LEFTWARDS HARPOON WITH BARB DOWNWARDS
+ \upharpoonright \or % UPWARDS HARPOON WITH BARB RIGHTWARDS
+ \upharpoonleft \or % UPWARDS HARPOON WITH BARB LEFTWARDS
+ \rightharpoonup \or % RIGHTWARDS HARPOON WITH BARB UPWARDS
+ \rightharpoondown \or % RIGHTWARDS HARPOON WITH BARB DOWNWARDS
+ \downharpoonright \or % DOWNWARDS HARPOON WITH BARB RIGHTWARDS
+ \downharpoonleft \or % DOWNWARDS HARPOON WITH BARB LEFTWARDS
+ \rightleftarrows \or % RIGHTWARDS ARROW OVER LEFTWARDS ARROW
+ \unknownchar \or % UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW
+ \leftrightarrows \or % LEFTWARDS ARROW OVER RIGHTWARDS ARROW
+ \leftleftarrows \or % LEFTWARDS PAIRED ARROWS
+ \upuparrows \or % UPWARDS PAIRED ARROWS
+ \rightrightarrows \or % RIGHTWARDS PAIRED ARROWS
+ \downdownarrows \or % DOWNWARDS PAIRED ARROWS
+ \leftrightharpoons \or % LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
+ \rightleftharpoons \or % RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
+ \nLeftarrow \or % LEFTWARDS DOUBLE ARROW WITH STROKE
+ \nLeftrightarrow \or % LEFT RIGHT DOUBLE ARROW WITH STROKE
+ \nRightarrow \or % RIGHTWARDS DOUBLE ARROW WITH STROKE
+ \Leftarrow \or % LEFTWARDS DOUBLE ARROW
+ \Uparrow \or % UPWARDS DOUBLE ARROW
+ \Rightarrow \or % RIGHTWARDS DOUBLE ARROW
+ \Downarrow \or % DOWNWARDS DOUBLE ARROW
+ \Leftrightarrow \or % LEFT RIGHT DOUBLE ARROW
+ \Updownarrow \or % UP DOWN DOUBLE ARROW
+ \unknownchar \or % NORTH WEST DOUBLE ARROW
+ \unknownchar \or % NORTH EAST DOUBLE ARROW
+ \unknownchar \or % SOUTH EAST DOUBLE ARROW
+ \unknownchar \or % SOUTH WEST DOUBLE ARROW
+ \Lleftarrow \or % LEFTWARDS TRIPLE ARROW
+ \unknownchar \or % RIGHTWARDS TRIPLE ARROW
+ \leftsquidarrow \or % LEFTWARDS SQUIGGLE ARROW
+ \rightsquidarrow \or % RIGHTWARDS SQUIGGLE ARROW
+ \unknownchar \or % UPWARDS ARROW WITH DOUBLE STROKE
+ \unknownchar \or % DOWNWARDS ARROW WITH DOUBLE STROKE
+ \dashleftarrow \or % LEFTWARDS DASHED ARROW
+ \unknownchar \or % UPWARDS DASHED ARROW
+ \dashrightarrow \or % RIGHTWARDS DASHED ARROW
+ \unknownchar \or % DOWNWARDS DASHED ARROW
+ \unic@leftarrowtobar \or % LEFTWARDS ARROW TO BAR
+ \unknownchar \or % RIGHTWARDS ARROW TO BAR
+ \unknownchar \or % LEFTWARDS WHITE ARROW
+ \unknownchar \or % UPWARDS WHITE ARROW
+ \unknownchar \or % RIGHTWARDS WHITE ARROW
+ \unknownchar \or % DOWNWARDS WHITE ARROW
+ \unknownchar \or % UPWARDS WHITE ARROW FROM BAR
+ \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL
+ \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR
+ \unknownchar \or % UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR
+ \unknownchar \or % UPWARDS WHITE DOUBLE ARROW
+ \unknownchar \or % UPWARDS WHITE DOUBLE ARROW ON PEDESTAL
+ \unknownchar \or % RIGHTWARDS WHITE ARROW FROM WALL
+ \unknownchar \or % NORTH WEST ARROW TO CORNER
+ \unknownchar \or % SOUTH EAST ARROW TO CORNER
+ \unknownchar \or % UP DOWN WHITE ARROW
+ \unknownchar \or % RIGHT ARROW WITH SMALL CIRCLE
+ \unknownchar \or % DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
+ \unknownchar \or % THREE RIGHTWARDS ARROWS
+ \unknownchar \or % LEFTWARDS ARROW WITH VERTICAL STROKE
+ \unknownchar \or % RIGHTWARDS ARROW WITH VERTICAL STROKE
+ \unknownchar \or % LEFT RIGHT ARROW WITH VERTICAL STROKE
+ \unknownchar \or % LEFTWARDS ARROW WITH DOUBLE VERTICAL STROKE
+ \unknownchar \or % RIGHTWARDS ARROW WITH DOUBLE VERTICAL STROKE
+ \unknownchar \or % LEFT RIGHT ARROW WITH DOUBLE VERTICAL STROKE
+ \leftarrowtriangle \or % LEFTWARDS OPEN-HEADED ARROW
+ \rightarrowtriangle \or % RIGHTWARDS OPEN-HEADED ARROW
+ \leftrightarrowtriangle \else % LEFT RIGHT OPEN-HEADED ARROW
\unknowncharacter
\fi
\stopunicodevector
diff --git a/Master/texmf-dist/tex/context/base/unic-037.tex b/Master/texmf-dist/tex/context/base/unic-037.tex
new file mode 100644
index 00000000000..87f655a6810
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/unic-037.tex
@@ -0,0 +1,278 @@
+%D \module
+%D [ file=unic-037,
+%D version=2006.02.13,
+%D title=\CONTEXT\ \UNICODE\ Macros,
+%D subtitle=Vector 37,
+%D author=Luigi Scarso,
+%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
+
+\startunicodevector 37
+ \expandafter\strippedcsname
+ \ifcase\numexpr #1+1\relax\or %%
+ \UnicodeLightHorizontal\or
+ \UnicodeHeavyHorizontal\or
+ \UnicodeLightVertical\or
+ \UnicodeHeavyVertical\or
+ \UnicodeLightTripleDashHorizontal\or
+ \UnicodeHeavyTripleDashHorizontal\or
+ \UnicodeLightTripleDashVertical\or
+ \UnicodeHeavyTripleDashVertical\or
+ \UnicodeLightQuadrupleDashHorizontal\or
+ \UnicodeHeavyQuadrupleDashHorizontal\or
+ \UnicodeLightQuadrupleDashVertical\or
+ \UnicodeHeavyQuadrupleDashVertical\or
+ \UnicodeLightDownAndRight\or
+ \UnicodeDownLightAndRightHeavy\or
+ \UnicodeDownHeavyAndRightLight\or
+ \UnicodeHeavyDownAndRight\or
+ \UnicodeLightDownAndLeft\or
+ \UnicodeDownLightAndLeftHeavy\or
+ \UnicodeDownHeavyAndLeftLight\or
+ \UnicodeHeavyDownAndLeft\or
+ \UnicodeLightUpAndRight\or
+ \UnicodeUpLightAndRightHeavy\or
+ \UnicodeUpHeavyAndRightLight\or
+ \UnicodeHeavyUpAndRight\or
+ \UnicodeLightUpAndLeft\or
+ \UnicodeUpLightAndLeftHeavy\or
+ \UnicodeUpHeavyAndLeftLight\or
+ \UnicodeHeavyUpAndLeft\or
+ \UnicodeLightVerticalAndRight\or
+ \UnicodeVerticalLightAndRightHeavy\or
+ \UnicodeUpHeavyAndRightDownLight\or
+ \UnicodeDownHeavyAndRightUpLight\or
+ \UnicodeVerticalHeavyAndRightLight\or
+ \UnicodeDownLightAndRightUpHeavy\or
+ \UnicodeUpLightAndRightDownHeavy\or
+ \UnicodeHeavyVerticalAndRight\or
+ \UnicodeLightVerticalAndLeft\or
+ \UnicodeVerticalLightAndLeftHeavy\or
+ \UnicodeUpHeavyAndLeftDownLight\or
+ \UnicodeDownHeavyAndLeftUpLight\or
+ \UnicodeVerticalHeavyAndLeftLight\or
+ \UnicodeDownLightAndLeftUpHeavy\or
+ \UnicodeUpLightAndLeftDownHeavy\or
+ \UnicodeHeavyVerticalAndLeft\or
+ \UnicodeLightDownAndHorizontal\or
+ \UnicodeLeftHeavyAndRightDownLight\or
+ \UnicodeRightHeavyAndLeftDownLight\or
+ \UnicodeDownLightAndHorizontalHeavy\or
+ \UnicodeDownHeavyAndHorizontalLight\or
+ \UnicodeRightLightAndLeftDownHeavy\or
+ \UnicodeLeftLightAndRightDownHeavy\or
+ \UnicodeHeavyDownAndHorizontal\or
+ \UnicodeLightUpAndHorizontal\or
+ \UnicodeLeftHeavyAndRightUpLight\or
+ \UnicodeRightHeavyAndLeftUpLight\or
+ \UnicodeUpLightAndHorizontalHeavy\or
+ \UnicodeUpHeavyAndHorizontalLight\or
+ \UnicodeRightLightAndLeftUpHeavy\or
+ \UnicodeLeftLightAndRightUpHeavy\or
+ \UnicodeHeavyUpAndHorizontal\or
+ \UnicodeLightVerticalAndHorizontal\or
+ \UnicodeLeftHeavyAndRightVerticalLight\or
+ \UnicodeRightHeavyAndLeftVerticalLight\or
+ \UnicodeVerticalLightAndHorizontalHeavy\or
+ \UnicodeUpHeavyAndDownHorizontalLight\or
+ \UnicodeDownHeavyAndUpHorizontalLight\or
+ \UnicodeVerticalHeavyAndHorizontalLight\or
+ \UnicodeLeftUpHeavyAndRightDownLight\or
+ \UnicodeRightUpHeavyAndLeftDownLight\or
+ \UnicodeLeftDownHeavyAndRightUpLight\or
+ \UnicodeRightDownHeavyAndLeftUpLight\or
+ \UnicodeDownLightAndUpHorizontalHeavy\or
+ \UnicodeUpLightAndDownHorizontalHeavy\or
+ \UnicodeRightLightAndLeftVerticalHeavy\or
+ \UnicodeLeftLightAndRightVerticalHeavy\or
+ \UnicodeHeavyVerticalAndHorizontal\or
+ \UnicodeLightDoubleDashHorizontal\or
+ \UnicodeHeavyDoubleDashHorizontal\or
+ \UnicodeLightDoubleDashVertical\or
+ \UnicodeHeavyDoubleDashVertical\or
+ \UnicodeDoubleHorizontal\or
+ \UnicodeDoubleVertical\or
+ \UnicodeDownSingleAndRightDouble\or
+ \UnicodeDownDoubleAndRightSingle\or
+ \UnicodeDoubleDownAndRight\or
+ \UnicodeDownSingleAndLeftDouble\or
+ \UnicodeDownDoubleAndLeftSingle\or
+ \UnicodeDoubleDownAndLeft\or
+ \UnicodeUpSingleAndRightDouble\or
+ \UnicodeUpDoubleAndRightSingle\or
+ \UnicodeDoubleUpAndRight\or
+ \UnicodeUpSingleAndLeftDouble\or
+ \UnicodeUpDoubleAndLeftSingle\or
+ \UnicodeDoubleUpAndLeft\or
+ \UnicodeVerticalSingleAndRightDouble\or
+ \UnicodeVerticalDoubleAndRightSingle\or
+ \UnicodeDoubleVerticalAndRight\or
+ \UnicodeVerticalSingleAndLeftDouble\or
+ \UnicodeVerticalDoubleAndLeftSingle\or
+ \UnicodeDoubleVerticalAndLeft\or
+ \UnicodeDownSingleAndHorizontalDouble\or
+ \UnicodeDownDoubleAndHorizontalSingle\or
+ \UnicodeDoubleDownAndHorizontal\or
+ \UnicodeUpSingleAndHorizontalDouble\or
+ \UnicodeUpDoubleAndHorizontalSingle\or
+ \UnicodeDoubleUpAndHorizontal\or
+ \UnicodeVerticalSingleAndHorizontalDouble\or
+ \UnicodeVerticalDoubleAndHorizontalSingle\or
+ \UnicodeDoubleVerticalAndHorizontal\or
+ \UnicodeLightArcDownAndRight\or
+ \UnicodeLightArcDownAndLeft\or
+ \UnicodeLightArcUpAndLeft\or
+ \UnicodeLightArcUpAndRight\or
+ \UnicodeLightDiagonalUpperRightToLowerLeft\or
+ \UnicodeLightDiagonalUpperLeftToLowerRight\or
+ \UnicodeLightDiagonalCross\or
+ \UnicodeLightLeft\or
+ \UnicodeLightUp\or
+ \UnicodeLightRight\or
+ \UnicodeLightDown\or
+ \UnicodeHeavyLeft\or
+ \UnicodeHeavyUp\or
+ \UnicodeHeavyRight\or
+ \UnicodeHeavyDown\or
+ \UnicodeLightLeftAndHeavyRight\or
+ \UnicodeLightUpAndHeavyDown\or
+ \UnicodeHeavyLeftAndLightRight\or
+ \UnicodeHeavyUpAndLightDown\or
+ \UnicodeUpperHalfBlock\or
+ \UnicodeLowerOneEighthBlock\or
+ \UnicodeLowerOneQuarterBlock\or
+ \UnicodeLowerThreeEighthsBlock\or
+ \UnicodeLowerHalfBlock\or
+ \UnicodeLowerFiveEighthsBlock\or
+ \UnicodeLowerThreeQuartersBlock\or
+ \UnicodeLowerSevenEighthsBlock\or
+ \UnicodeFullBlock\or
+ \UnicodeLeftSevenEighthsBlock\or
+ \UnicodeLeftThreeQuartersBlock\or
+ \UnicodeLeftFiveEighthsBlock\or
+ \UnicodeLeftHalfBlock\or
+ \UnicodeLeftThreeEighthsBlock\or
+ \UnicodeLeftOneQuarterBlock\or
+ \UnicodeLeftOneEighthBlock\or
+ \UnicodeRightHalfBlock\or
+ \UnicodeLightShade\or
+ \UnicodeMediumShade\or
+ \UnicodeDarkShade\or
+ \UnicodeUpperOneEighthBlock\or
+ \UnicodeRightOneEighthBlock\or
+ \UnicodeQuadrantLowerLeft\or
+ \UnicodeQuadrantLowerRight\or
+ \UnicodeQuadrantUpperLeft\or
+ \UnicodeQuadrantUpperLeftAndLowerLeftAndLowerRight\or
+ \UnicodeQuadrantUpperLeftAndLowerRight\or
+ \UnicodeQuadrantUpperLeftAndUpperRightandLowerLeft\or
+ \UnicodeQuadrantUpperLeftAndUpperRightAndLowerRight\or
+ \UnicodeQuadrantUpperRight\or
+ \UnicodeQuadrantUpperRightAndLowerLeft\or
+ \UnicodeQuadrantUpperRightAndLowerLeftAndLowerRight\or
+ \UnicodeBlackSquare\or
+ \UnicodeWhiteSquare\or
+ \UnicodeWhiteSquareWithRoundedCorners\or
+ \UnicodeWhiteSquareContainingBlackSmallSquare\or
+ \UnicodeSquareWithHorizontalFill\or
+ \UnicodeSquareWithVerticalFill\or
+ \UnicodeSquareWithOrthogonalCrosshatchFill\or
+ \UnicodeSquareWithUpperLeftToLowerRightFill\or
+ \UnicodeSquareWithUpperRightToLowerLeftFill\or
+ \UnicodeSquareWithDiagonalCrosshatchFill\or
+ \UnicodeBlackSmallSquare\or
+ \UnicodeWhiteSmallSquare\or
+ \UnicodeBlackRectangle\or
+ \UnicodeWhiteRectangle\or
+ \UnicodeBlackVerticalRectangle\or
+ \UnicodeWhiteVerticalRectangle\or
+ \UnicodeBlackParallelogram\or
+ \UnicodeWhiteParallelogram\or
+ \UnicodeBlackUpPointingTriangle\or
+ \UnicodeWhiteUpPointingTriangle\or
+ \UnicodeBlackUpPointingSmallTriangle\or
+ \UnicodeWhiteUpPointingSmallTriangle\or
+ \UnicodeBlackRightPointingTriangle\or
+ \UnicodeWhiteRightPointingTriangle\or
+ \UnicodeBlackRightPointingSmallTriangle\or
+ \UnicodeWhiteRightPointingSmallTriangle\or
+ \UnicodeBlackRightPointingPointer\or
+ \UnicodeWhiteRightPointingPointer\or
+ \UnicodeBlackDownPointingTriangle\or
+ \UnicodeWhiteDownPointingTriangle\or
+ \UnicodeBlackDownPointingSmallTriangle\or
+ \UnicodeWhiteDownPointingSmallTriangle\or
+ \UnicodeBlackLeftPointingTriangle\or
+ \UnicodeWhiteLeftPointingTriangle\or
+ \UnicodeBlackLeftPointingSmallTriangle\or
+ \UnicodeWhiteLeftPointingSmallTriangle\or
+ \UnicodeBlackLeftPointingPointer\or
+ \UnicodeWhiteLeftPointingPointer\or
+ \UnicodeBlackDiamond\or
+ \UnicodeWhiteDiamond\or
+ \UnicodeWhiteDiamondContainingBlackSmallDiamond\or
+ \UnicodeFisheye\or
+ \UnicodeLozenge\or
+ \UnicodeWhiteCircle\or
+ \UnicodeDottedCircle\or
+ \UnicodeCircleWithVerticalFill\or
+ \UnicodeBullseye\or
+ \UnicodeBlackCircle\or
+ \UnicodeCircleWithLeftHalfBlack\or
+ \UnicodeCircleWithRightHalfBlack\or
+ \UnicodeCircleWithLowerHalfBlack\or
+ \UnicodeCircleWithUpperHalfBlack\or
+ \UnicodeCircleWithUpperRightQuadrantBlack\or
+ \UnicodeCircleWithAllButUpperLeftQuadrantBlack\or
+ \UnicodeLeftHalfBlackCircle\or
+ \UnicodeRightHalfBlackCircle\or
+ \UnicodeInverseBullet\or
+ \UnicodeInverseWhiteCircle\or
+ \UnicodeUpperHalfInverseWhiteCircle\or
+ \UnicodeLowerHalfInverseWhiteCircle\or
+ \UnicodeUpperLeftQuadrantCircularArc\or
+ \UnicodeUpperRightQuadrantCircularArc\or
+ \UnicodeLowerRightQuadrantCircularArc\or
+ \UnicodeLowerLeftQuadrantCircularArc\or
+ \UnicodeUpperHalfCircle\or
+ \UnicodeLowerHalfCircle\or
+ \UnicodeBlackLowerRightTriangle\or
+ \UnicodeBlackLowerLeftTriangle\or
+ \UnicodeBlackUpperLeftTriangle\or
+ \UnicodeBlackUpperRightTriangle\or
+ \UnicodeWhiteBullet\or
+ \UnicodeSquareWithLeftHalfBlack\or
+ \UnicodeSquareWithRightHalfBlack\or
+ \UnicodeSquareWithUpperLeftDiagonalHalfBlack\or
+ \UnicodeSquareWithLowerRightDiagonalHalfBlack\or
+ \UnicodeWhiteSquareWithVerticalBisectingLine\or
+ \UnicodeWhiteUpPointingTriangleWithDot\or
+ \UnicodeUpPointingTriangleWithLeftHalfBlack\or
+ \UnicodeUpPointingTriangleWithRightHalfBlack\or
+ \UnicodeLargeCircle\or
+ \UnicodeWhiteSquareWithUpperLeftQuadrant\or
+ \UnicodeWhiteSquareWithLowerLeftQuadrant\or
+ \UnicodeWhiteSquareWithLowerRightQuadrant\or
+ \UnicodeWhiteSquareWithUpperRightQuadrant\or
+ \UnicodeWhiteCircleWithUpperLeftQuadrant\or
+ \UnicodeWhiteCircleWithLowerLeftQuadrant\or
+ \UnicodeWhiteCircleWithLowerRightQuadrant\or
+ \UnicodeWhiteCircleWithUpperRightQuadrant\or
+ \UnicodeUpperLeftTriangle\or
+ \UnicodeUpperRightTriangle\or
+ \UnicodeLowerLeftTriangle\or
+ \UnicodeWhiteMediumSquare\or
+ \UnicodeBlackMediumSquare\or
+ \UnicodeWhiteMediumSmallSquare\or
+ \UnicodeBlackMediumSmallSquare\or
+ \UnicodeLowerRightTriangle\else%
+ \unknownchar\fi
+\stopunicodevector
+\protect \endinput
+
diff --git a/Master/texmf-dist/tex/context/base/unic-251.tex b/Master/texmf-dist/tex/context/base/unic-251.tex
new file mode 100644
index 00000000000..150ade4561f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/unic-251.tex
@@ -0,0 +1,34 @@
+%D \module
+%D [ file=unic-251,
+%D version=2006.04.20,
+%D title=\CONTEXT\ \UNICODE\ Macros,
+%D subtitle=Vector 251,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright=PRAGMA-ADE]
+
+\unprotect
+
+\def\ffligature {ff}
+\def\filigature {fi}
+\def\flligature {fl}
+\def\ffiligature {ffi}
+\def\fflligature {ffl}
+\def\ftligature {ft}
+\def\stligature {st}
+
+\startunicodevector 251
+ \expandafter\strippedcsname
+ \ifcase\numexpr#1\relax
+ \ffligature \or % LATIN SMALL LIGATURE FF
+ \filigature \or % LATIN SMALL LIGATURE FI
+ \flligature \or % LATIN SMALL LIGATURE FL
+ \ffiligature \or % LATIN SMALL LIGATURE FFI
+ \fflligature \or % LATIN SMALL LIGATURE FFL
+ \ftligature \or % LATIN SMALL LIGATURE FT
+ \stligature \else % LATIN SMALL LIGATURE ST
+ \unknownchar
+ \fi
+\stopunicodevector
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/unic-cjk.tex b/Master/texmf-dist/tex/context/base/unic-cjk.tex
new file mode 100644
index 00000000000..2835e6cf147
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/unic-cjk.tex
@@ -0,0 +1,16 @@
+%D \module
+%D [ file=unic-cjk,
+%D version=2005.12.14,
+%D title=\CONTEXT\ \UNICODE\ Macros,
+%D subtitle=CJK Vectors,
+%D author=Hans Hagen,
+%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.
+
+\dostepwiserecurse{40}{159}{1}{\expanded{\defineunicodecommand {\recurselevel}} {\lookaheaduchar}}
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/unic-exp.tex b/Master/texmf-dist/tex/context/base/unic-exp.tex
index 17bdaef0602..6ed2ef38d22 100644
--- a/Master/texmf-dist/tex/context/base/unic-exp.tex
+++ b/Master/texmf-dist/tex/context/base/unic-exp.tex
@@ -51,31 +51,29 @@
%D For this purpose, we need to redefine the resolver.
\def\doutfunihash#1#2%
- {\ifcsname\@@univector\@@univector\number#1\endcsname
- \csname\@@univector\@@univector\number#1\endcsname{\utfmod{#2}}%
- \else\ifcsname\@@univector\number#1\endcsname
- \csname\@@univector#1\endcsname{\utfmod{#2}}%
- \else
- \@@unknownchar
- \fi\fi}
+ {\csname \@@univector
+ \ifcsname\@@univector\@@univector#1\endcsname \@@univector#1\else
+ \ifcsname\@@univector #1\endcsname #1\else
+ \s!unknown\fi\fi
+ \endcsname{\utfmod{#2}}}
+
+\setvalue{\@@univector\s!unknown}#1%
+ {\@@unknownchar}
+
+\def\doutfunihashglyph#1#2#3% div mod raw
+ {\csname utf!\ifnum#3<\utf@i1\else
+ \ifcsname\@@unicommand#1\endcsname2\else
+ \ifcsname\@@univector\@@univector#1\endcsname3\else
+ \ifcsname\@@univector #1\endcsname4\else
+ 5\fi\fi\fi\fi !\endcsname{#1}{#2}}
-% or:
-%
-% \def\doutfunihash#1#2%
-% {\csname
-% \ifcsname\@@univector\@@univector\number#1\endcsname
-% \@@univector\@@univector\number#1%
-% \else\ifcsname\@@univector\number#1\endcsname
-% \@@univector#1%
-% \else
-% \strippedcsname\noutfunihash
-% \fi\fi
-% \endcsname{\utfmod{#2}}}
-%
-% \def\noutfunihash#1%
-% {\unknowncharacter}
+\setvalue{utf!1!}#1{\unicodeasciicharacter} % {#2}
+\setvalue{utf!2!}#1{\csname\@@unicommand#1\endcsname} % {#2}
+\setvalue{utf!3!}#1#2{\csname\csname\@@univector\@@univector#1\endcsname{#2}\endcsname} % watch the nested csname; it's a speed up
+\setvalue{utf!4!}#1#2{\csname\csname\@@univector#1\endcsname{#2}\endcsname} % watch the nested csname; it's a speed up
+\setvalue{utf!5!}#1#2{\unicodeunknowncharacter}
-\let\utfunihash\utfunihashglyph
+% \let\utfunihash\utfunihashglyph
%D Let's use it:
diff --git a/Master/texmf-dist/tex/context/base/unic-ini.tex b/Master/texmf-dist/tex/context/base/unic-ini.tex
index 1881eceb2f4..00651384f57 100644
--- a/Master/texmf-dist/tex/context/base/unic-ini.tex
+++ b/Master/texmf-dist/tex/context/base/unic-ini.tex
@@ -22,6 +22,18 @@
\unprotect
+% ÀÁÂÃÄÅàáâãäå
+% ÆÇæç
+% ÈÉÊËèéêë
+% ÌÍÎÏÞìíîïþ
+% Ðð
+% Ññ
+% ÒÓÔÕÖòóôõö
+% Øø
+% ÙÚÛÜùúû
+% Ýýÿ
+% ß
+
%D This module deals with unicode, and in particular with
%D \UTF-8 conversion. The prelude to this module was \type
%D {xtag-utf}, which is now replaced by a one||liner. The
@@ -218,6 +230,8 @@
%D
%D Less parsing, and therefore faster:
+% beware, this may change: #1 rawchar (=> `#1 and such, saves tokens)
+
\def\utftwouniglph#1#2%
{\@EA\unicodechar\@EA{\the\numexpr\utf@a*(#1-\utf@d)+%
`#2-\utf@g\relax}}
@@ -230,11 +244,29 @@
{\@EA\unicodechar\@EA{\the\numexpr\utf@c*(#1-\utf@f)+%
\utf@b*(`#2-\utf@g)+\utf@a*(`#3-\utf@g)+`#4-\utf@g\relax}}
+% \def\keeputfcharacters
+% {\def\utftwouniglph ##1##2{\rawcharacter{##1}\string##2}%
+% \def\utfthreeuniglph ##1##2##3{\rawcharacter{##1}\string##2\string##3}%
+% \def\utffouruniglph ##1##2##3##4{\rawcharacter{##1}\string##2\string##3\string##4}}
+
+\def\keeputfcharacters
+ {\let\utftwouniglph \rawcharacter
+ \let\utfthreeuniglph\rawcharacter
+ \let\utffouruniglph \rawcharacter}
+
+\appendtoks \keeputfcharacters \to \everywritestring
+
+% \bgroup
+% \keeputfcharacters
+% \expanded{\index{\XMLflush{whatever}}}
+% \egroup
+
%D Now we come to the unicode handler itself. We will use a few
%D constants, which saves us (at least at the time of writing
%D and testing these macros) another 10\%.
\def\@@univector {univ}
+\def\@@unicommand {unic}
\def\@@unknownchar{unknownchar}
%D Now comes the nice part: turning codes into glyphs. The
@@ -401,11 +433,59 @@
\@EA\doutfunihash\@EA{\number\utfdiv{#1}}{#1}\endcsname
\fi}
+%D Well, we also want a plug-in mechanism, so we en dup with
+%D a messy:
+
+\def\utfunihashglyph#1%
+ {\@EA\doutfunihashglyph\@EA{\number\numexpr\utfdiv{#1}\@EA\relax\@EA}\@EA{\number\utfmod{#1}}{#1}}
+
+% \def\doutfunihashglyph#1#2#3% div mod raw
+% {\csname
+% \ifnum#3<\utf@i
+% \strippedcsname\unicodeasciicharacter\endcsname{#2}%
+% \else\ifcsname\@@unicommand#1\endcsname
+% \@@unicommand#1\endcsname{#2}%
+% \else\ifcsname\@@univector#1\endcsname
+% \csname\@@univector#1\endcsname{#2}\endcsname % watch the nested csname; it's a speed up
+% \else
+% \strippedcsname\unicodeunknowncharacter\endcsname{#2}%
+% \fi\fi\fi}
+%
+% \def\unicodeunknowncharacter#1%
+% {\unknownchar}
+%
+% The next one permits lookahead
+
+\def\doutfunihashglyph#1#2#3% div mod raw
+ {\csname utf!\ifnum#3<\utf@i 1\else
+ \ifcsname\@@unicommand#1\endcsname2\else
+ \ifcsname\@@univector #1\endcsname3\else
+ 4\fi\fi\fi !\endcsname{#1}{#2}}
+
+\setvalue{utf!1!}#1{\unicodeasciicharacter} % {#2}
+\setvalue{utf!2!}#1{\csname\@@unicommand#1\endcsname} % {#2}
+\setvalue{utf!3!}#1#2{\csname\csname\@@univector#1\endcsname{#2}\endcsname} % watch the nested csname; it's a speed up
+\setvalue{utf!4!}#1#2{\unicodeunknowncharacter}
+
+\def\unicodeunknowncharacter
+ {\unknownchar}
+
%D With:
\let\unicodeasciicharacter\rawcharacter
-%D Now we can say:
+%D Commands are defined with:
+
+\def\defineunicodecommand #1 #2% #2{range number}{char number}
+ {\setvalue{\@@unicommand#1}##1{#2{#1}{##1}}}
+
+%D For instance:
+%D
+%D \starttyping
+%D \defineutfcommand 81 {\uchar}
+%D \stoptyping
+
+%D Now we can also say:
\let\utfunihash\utfunihashglyph
@@ -455,7 +535,8 @@
\def\douseunicodevector#1%
{\ifundefined{\@@univector#1}%
- \readsysfile{\f!unicprefix\threedigits{#1}}
+ % \readsysfile{\f!unicprefix\threedigits{#1}}
+ \readsysfile{\f!unicprefix\doifnumberelse{#1}{\threedigits{#1}}{#1}}
{\writestatus{unicode}{loading vector #1}}
{\writestatus{unicode}{unknown vector #1}}%
\fi}
@@ -535,7 +616,7 @@
\def\unidiv{0} \def\unimod{0}
-\chardef\utfunihashmode=0 % 0=hash glyph 1=font glyph
+\chardef\utfunihashmode=0 % 0=hash glyph / 1=font glyph
\def\utfunifontglyph#1%
{\xdef\unidiv{\number\utfdiv{#1}}%
@@ -579,7 +660,6 @@
\def\utfunihashcommand
{\ifcase\utfunihashmode
- % \@EA\@EAEAEA\@EA\string\@EA\utfunihashglyph
\@EA\utfunihushcommand
\else
\@EA\utfunifontcommand
@@ -652,6 +732,9 @@
\endTEX
+\def\uchartoutf#1#2%
+ {\expandafter\numbertoutf\expandafter{\the\numexpr#1*256+#2\relax}}
+
%D Goodies:
\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run}
@@ -660,8 +743,14 @@
%D Well, let's at least preload a few familiar ones. Here we
%D also load the \UTF\ regime.
-\useunicodevector[0,1,2,3,4,5,30,32,33,34,39] \useregime[utf]
+\useunicodevector[0,1,2,3,4,5,30,31,32,33,34,37,39,251]
+\useunicodevector[cjk]
+
+\useregime[utf]
% 31, text mem usage first
\protect \endinput
+
+\unprotect
+
diff --git a/Master/texmf-dist/tex/context/base/unic-run.tex b/Master/texmf-dist/tex/context/base/unic-run.tex
index 49b8b6d968d..b8e154fd45d 100644
--- a/Master/texmf-dist/tex/context/base/unic-run.tex
+++ b/Master/texmf-dist/tex/context/base/unic-run.tex
@@ -28,7 +28,7 @@
\dostepwiserecurse{0}{15}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}%
\AR}
-\gdef\showunicodevector#1%
+\gdef\showunicodevector[#1]%
{\starttable[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|]
\NC\NC\dostepwiserecurse{0}{15}{1}{\ttx\uchexnumber\recurselevel\NC}\AR
\DC\DL[16]\DR
@@ -42,17 +42,17 @@
%D \chardef\utfunicodetracer=0
%D \chardef\utfunicodetracer=7
%D
-%D \showunicodevector{000}
-%D \showunicodevector{001}
-%D \showunicodevector{002}
-%D \showunicodevector{003}
-%D \showunicodevector{004}
-%D \showunicodevector{005}
-%D \showunicodevector{030}
-%D \showunicodevector{031}
-%D \showunicodevector{032}
-%D \showunicodevector{033}
-%D \showunicodevector{034}
+%D \showunicodevector[000]
+%D \showunicodevector[001]
+%D \showunicodevector[002]
+%D \showunicodevector[003]
+%D \showunicodevector[004]
+%D \showunicodevector[005]
+%D \showunicodevector[030]
+%D \showunicodevector[031]
+%D \showunicodevector[032]
+%D \showunicodevector[033]
+%D \showunicodevector[034]
%D \stoptyping
%D \macros
@@ -66,7 +66,7 @@
\dostepwiserecurse{0}{15}{1}
{\bTD
\edef\entrypoint{\the\numexpr#1*256+#2+##1*16\relax}%
- \chardef\utfunicodetracer0{\dontleavehmode \strut\unicodechar\entrypoint\endgraf}%
+ \chardef\utfunicodetracer0{\dontleavehmode \strut\unicodechar\entrypoint\endgraf}%
\tt
\chardef\utfunicodetracer7{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}%
\chardef\utfunicodetracer3{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}%
@@ -75,8 +75,9 @@
\bTD\uchexnumber{#2}\eTD
\eTR}
-\gdef\showunicodetable#1%
+\gdef\showunicodetable[#1]%
{\vbox\bgroup
+ \setupcolors[\c!state=\v!start]%
\setupTABLE[\c!background=\v!screen,\c!backgroundscreen=.90,\c!frame=\v!off,\c!frameoffset=0pt,\c!width=8em,\c!height=6em]%
\setupTABLE[c] [\v!each] [\c!align={middle,lohi}]%
\setupTABLE[c] [\v!first][\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]%
diff --git a/Master/texmf-dist/tex/context/base/verb-c.tex b/Master/texmf-dist/tex/context/base/verb-c.tex
new file mode 100644
index 00000000000..d2f708a8d7f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/verb-c.tex
@@ -0,0 +1,484 @@
+%D \module
+%D [ file=verb-c,
+%D version=2006.04.17,
+%D title=\CONTEXT\ Verbatim Macros,
+%D subtitle=Pretty C Verbatim,
+%D author=Nikolai Weibull,
+%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.
+
+\writestatus{loading}{Context Support Macros / Pretty C Verbatim}
+
+% HH:
+%
+% - extra !!pretty definitions moved to verb-ini
+% - added a c!
+% - did a few small cosmetic things
+
+\unprotect
+
+\doglobal\newif\ifinCsingle
+\doglobal\newif\ifinCdouble
+\doglobal\newif\ifinCcomment
+\doglobal\newif\ifinCsinglelinecomment
+\doglobal\newif\ifinCmultilinecomment
+\doglobal\newif\ifcontinueCsinglelinecomment
+
+\gdef\Csetcontrols
+ {\saveprettycontrols
+ \def\obeyedspace
+ {\endCtypesix
+ \oldobeyedspace}%
+ \def\flushrestofverbatimline
+ {\endCtypesix
+ \ifinCsinglelinecomment
+ \ifcontinueCsinglelinecomment
+ \continueCsinglelinecommentfalse
+ \else
+ \tttf
+ \endofpretty
+ \global\inCsinglelinecommentfalse
+ \global\inCcommentfalse
+ \fi
+ \fi}%
+ \def\obeyedline
+ {\oldobeyedline}%
+ \let\obeytabs\ignoretabs}
+
+\gdef\setupprettyCtype
+ {\def\prettyidentifier{C}%
+ \Csetvariables
+ \Csetcontrols
+ \Csethandlers
+ \Csetspecials
+ \Csetdiagnostics}
+
+\gdef\Csetvariables
+ {\global\inCsinglefalse
+ \global\inCdoublefalse
+ \global\inCcommentfalse
+ \global\continueCsinglelinecommentfalse
+ \global\naturaltextexttrue
+ \global\let\Csequence\empty
+ \global\let\Cprefix\empty}
+
+% TODO: should handle -> as well
+
+\gdef\Csetspecials
+ {\setpretty`\{=10 \setpretty`\}=10
+ \setpretty`\$=20 \setpretty`\@=20
+ \setpretty`\[=30 \setpretty`\]=30 \setpretty`\(=30 \setpretty`\)=30
+ \setpretty`\==30 \setpretty`\~=30 \setpretty`\<=30 \setpretty`\>=30
+ \setpretty`\%=30
+ \setpretty`\-=41 \setpretty`\+=41
+ \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41
+ \setpretty`\^=41 \setpretty`\&=41
+ \setpretty`\/=43 \setpretty`\*=44
+ \setpretty`\#=45
+ \setpretty`\\=50
+ \setpretty`\1=61 \setpretty`\2=61 \setpretty`\3=61 \setpretty`\4=61 \setpretty`\5=61
+ \setpretty`\6=61 \setpretty`\7=61 \setpretty`\8=61 \setpretty`\9=61 \setpretty`\0=61
+ \setpretty`\A=62 \setpretty`\B=62 \setpretty`\C=62 \setpretty`\D=62 \setpretty`\E=62
+ \setpretty`\F=62 \setpretty`\G=62 \setpretty`\H=62 \setpretty`\I=62 \setpretty`\J=62
+ \setpretty`\K=62 \setpretty`\L=62 \setpretty`\M=62 \setpretty`\N=62 \setpretty`\O=62
+ \setpretty`\P=62 \setpretty`\Q=62 \setpretty`\R=62 \setpretty`\S=62 \setpretty`\T=62
+ \setpretty`\U=62 \setpretty`\V=62 \setpretty`\W=62 \setpretty`\X=62 \setpretty`\Y=62
+ \setpretty`\Z=62
+ \setpretty`\a=62 \setpretty`\b=62 \setpretty`\c=62 \setpretty`\d=62 \setpretty`\e=62
+ \setpretty`\f=62 \setpretty`\g=62 \setpretty`\h=62 \setpretty`\i=62 \setpretty`\j=62
+ \setpretty`\k=62 \setpretty`\l=62 \setpretty`\m=62 \setpretty`\n=62 \setpretty`\o=62
+ \setpretty`\p=62 \setpretty`\q=62 \setpretty`\r=62 \setpretty`\s=62 \setpretty`\t=62
+ \setpretty`\u=62 \setpretty`\v=62 \setpretty`\w=62 \setpretty`\x=62 \setpretty`\y=62
+ \setpretty`\z=62
+ \setpretty`\_=62
+ \setpretty`\;=70 \setpretty`\:=70 \setpretty`\,=70 \setpretty`\.=70
+ \setpretty`\'=80
+ \setpretty`\"=90 }
+
+\gdef\Csethandlers
+ {\installprettyhandler 10 \Ctypeone
+ \installprettyhandler 20 \Ctypetwo
+ \installprettyhandler 30 \Ctypethree
+ \installprettyhandler 41 \Ctypefourone
+ \installprettyhandler 43 \Ctypefourthree
+ \installprettyhandler 44 \Ctypefourfour
+ \installprettyhandler 45 \Ctypefourfive
+ \installprettyhandler 50 \Ctypefive
+ \installprettyhandler 61 \Ctypesixone
+ \installprettyhandler 62 \Ctypesixtwo
+ \installprettyhandler 70 \Ctypeseven
+ \installprettyhandler 80 \Ctypeeight
+ \installprettyhandler 90 \Ctypenine}
+
+\gdef\Ctypeone#1%
+ {\ifinCdouble
+ \ifinCcomment
+ \endCtypesix
+ \getpretty{#1}%
+ \else\ifx\Cprefix\empty
+ \endCtypesix
+ \getpretty{#1}%
+ \else
+ \endCtypesix
+ \xdef\Cprefix{\getpretty{#1}}%
+ \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
+ \fi\fi
+ \else
+ \endCtypesix
+ \ifinCcomment
+ \getpretty{#1}%
+ \else\ifinCsingle
+ \getpretty{#1}%
+ \else
+ \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
+ \fi\fi
+ \fi}
+
+\gdef\Ctypetwo#1%
+ {\endCtypesix
+ \getpretty{#1}}
+
+\gdef\Ctypethree#1%
+ {\endCtypesix
+ \ifinCcomment
+ \getpretty{#1}%
+ \else\ifinCsingle
+ \getpretty{#1}%
+ \else\ifinCdouble
+ \getprettydata{#1}%
+ \ifx\Cprefix\empty
+ \getpretty{#1}%
+ \else
+ \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
+ \fi
+ \else
+ \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
+ \fi\fi\fi}
+
+\gdef\Ctypefourone#1%
+ {\endCtypesix
+ \ifinCcomment
+ \getpretty{#1}%
+ \else\ifinCsingle
+ \getpretty{#1}%
+ \else\ifinCdouble
+ \getpretty{#1}%
+ \else
+ \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
+ \fi\fi\fi}
+
+\gdef\doCtypefourtwo#1#2%
+ {\getprettydata{#2}%
+ \ifnum\prettytype=62
+ \expandafter\Ctypetwo
+ \else
+ \expandafter\Ctypefourone
+ \fi
+ {#1}#2}
+
+\gdef\Ctypefourtwo
+ {\handlenextnextpretty\doCtypefourtwo\Ctypefourone}
+
+\gdef\Ctypefourthree
+ {\handlenextnextpretty\doCtypefourthree\Ctypefourtwo}
+
+\gdef\doCtypefourthree#1#2%
+ {\getprettydata{#2}%
+ \ifnum\prettytype=43
+ \let\next\dodoCtypefourthree
+ \else\ifnum\prettytype=44
+ \global\inCcommenttrue
+ \global\inCmultilinecommenttrue
+ \let\next\Cstartcomment
+ \else
+ \let\next\Ctypefourtwo
+ \fi\fi
+ \next{#1}#2}
+
+\gdef\Cstartcomment#1#2%
+ {\beginofpretty[\!!prettyfourthree]\ttsl\getpretties{#1}{#2}}
+
+\gdef\dodoCtypefourthree% #1%
+ {\endCtypesix
+ \handlenextnextpretty\dododoCtypefourthree\dodododoCtypefourthree}
+
+\gdef\dododoCtypefourthree
+ {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoCtypefourthree}
+
+\gdef\dodododoCtypefourthree#1#2%
+ {\ifinCcomment
+ \getpretties{#1}{#2}%
+ \else
+ \global\inCcommenttrue
+ \global\inCsinglelinecommenttrue
+ \def\next{\beginofpretty[\!!prettyfourthree]\ttsl\getpretties{#1}{#2}}%
+ \expandafter\next
+ \fi}
+
+\gdef\Ctypefourfour
+ {\handlenextnextpretty\doCtypefourfour\Ctypefourtwo}
+
+\gdef\doCtypefourfour#1#2%
+ {\getprettydata{#2}%
+ \ifnum\prettytype=44
+ % \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
+ \ifinCcomment
+ \getpretty{#1}%
+ \else
+ \endCtypesix
+ \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
+ \fi
+ \expandafter#2%
+ \else\ifnum\prettytype=43
+ \getpretties{#1}{#2}%
+ \tttf
+ \endofpretty
+ \global\inCcommentfalse
+ \global\inCmultilinecommentfalse
+ \else\ifinCcomment
+ \getpretty{#1}%
+ \expandafter#2%
+ \else\ifinCsingle
+ \getpretty{#1}%
+ \expandafter#2%
+ \else\ifinCdouble
+ \getpretty{#1}%
+ \expandafter#2%
+ \else
+ \endCtypesix
+ \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
+ \expandafter#2%
+ \fi\fi\fi\fi\fi}
+
+\gdef\Ctypefourfive#1%
+ {\ifinCcomment
+ \getpretty{#1}%
+ \else\ifinCsingle
+ \getpretty{#1}%
+ \else\ifinCdouble
+ \getpretty{#1}%
+ \else
+ \endCtypesix
+ \global\inCcommenttrue
+ \global\inCsinglelinecommenttrue
+ \def\next{\beginofpretty[\!!prettyfourthree]\ttsl\getpretty{#1}}%
+ \expandafter\next
+ \fi\fi\fi}
+
+\gdef\doCtypefiveA#1#2%
+ {\endCtypesix
+ \ifinCcomment
+ \getpretties{#1}{#2}%
+ \else\ifinCsingle
+ \getprettydata{#2}%
+ \ifnum\prettytype=50
+ \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettyeight]%
+ \else\ifnum\prettytype=80
+ \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettyeight]%
+ \else
+ \getpretties{#1}{#2}%
+ \fi\fi
+ \else\ifinCdouble
+ \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty\beginofpretty[\!!prettynine]%
+ \else
+ \beginofpretty[\!!prettyfive]\getpretties{#1}{#2}\endofpretty
+ \fi\fi\fi}
+
+\gdef\doCtypefiveB#1%
+ {\endCtypesix
+ \ifinCcomment
+ \ifcat#1\relax
+ \continueCsinglelinecommenttrue
+ \getpretty{#1}%
+ \else
+ \getpretty{#1}%
+ \fi
+ \else\ifinCsingle
+ \getpretty{#1}%
+ \else\ifinCdouble
+ \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty\beginofpretty[\!!prettynine]%
+ \else
+ \beginofpretty[\!!prettyfive]\getpretty{#1}\endofpretty
+ \fi\fi\fi}
+
+\gdef\Ctypefive
+ {\expandafter\handlenextnextpretty\expandafter\doCtypefiveA\expandafter\doCtypefiveB}
+
+\gdef\endCtypesix
+ {\ifx\Csequence\empty\else
+ \ifinCcomment
+ \Csequence
+ \else\ifinCsingle
+ \Csequence
+ \else\ifinCdouble
+ \Csequence
+ \else\ifx\Cprefix\empty
+ \doendCtypesix\!!prettytwo
+ \else
+ \doendCtypesixtype\!!prettytwo
+ \fi\fi\fi\fi
+ \global\let\Csequence\empty
+ \global\let\Cprefix\empty
+ \fi}
+
+\gdef\doendCtypesix#1%
+ {\doifprettyidentifierelse{\Csequence}{\Ckeywords}
+ {\beginofpretty[#1]%
+ {\prettyidentifierfont\Csequence}%
+ \endofpretty}
+ {\doifprettyidentifierelse{\Csequence}{\Ctypes}
+ {\beginofpretty[\!!prettytwoone]%
+ {\prettyvariablefont\Csequence}%
+ \endofpretty}
+ {\Csequence}}}
+
+\gdef\doendCtypesixtype#1%
+ {\doifprettyidentifierelse{\Cprefix\Csequence}{\Ctypes}
+ {\beginofpretty[#1]%
+ {\prettyvariablefont\Csequence}%
+ \endofpretty}
+ {\Csequence}}
+
+\gdef\Ctypesixone#1%
+ {\ifinCcomment
+ \def\next{\getpretty{#1}}%
+ \else\ifinCsingle
+ \def\next{\getpretty{#1}}%
+ \else\ifinCdouble
+ \def\next{\getpretty{#1}}%
+ \else\ifx\Csequence\empty
+ \def\next{\beginofpretty[\!!prettyeight]\getpretty{#1}\endofpretty}%
+ \else
+ \def\next{\Ctypesixtwo{#1}}%
+ \fi\fi\fi\fi
+ \expandafter\next}
+
+\gdef\Ctypesixtwo#1%
+ {\ifinCcomment
+ \getpretty{#1}%
+ \else\ifinCsingle
+ \getpretty{#1}%
+ \else\ifinCdouble
+ \ifx\Cprefix\empty
+ \getpretty{#1}%
+ \else
+ \xdef\Csequence{\Csequence\getpretty{#1}}%
+ \fi
+ \else
+ \xdef\Csequence{\Csequence\getpretty{#1}}%
+ \fi\fi\fi}
+
+\gdef\Ctypeseven#1%
+ {\endCtypesix
+ \getpretty{#1}}
+
+\gdef\Ctypeeight#1% single quote
+ {\endCtypesix
+ \ifinCcomment
+ \getpretty{#1}%
+ \else\ifinCdouble
+ \getpretty{#1}%
+ \else\ifinCsingle
+ \global\inCsinglefalse
+ \getpretty{#1}%
+ \endofpretty
+ \else
+ \global\inCsingletrue
+ \beginofpretty[\!!prettyeight]\getpretty{#1}
+ \fi\fi\fi}
+
+\gdef\Ctypenine#1% double quote
+ {\endCtypesix
+ \ifinCcomment
+ \getpretty{#1}%
+ \else\ifinCsingle
+ \getpretty{#1}%
+ \else\ifinCdouble
+ \global\inCdoublefalse
+ \getpretty{#1}%
+ \endofpretty
+ \else
+ \global\inCdoubletrue
+ \beginofpretty[\!!prettynine]\getpretty{#1}
+ \fi\fi\fi}
+
+\gdef\doreportprettyCtype#1#2#3#4%
+ {#1%
+ [C \string#2 typing conflict, use \string#3 instead]
+ \writestatus
+ {C typing}
+ {use \string#3 instead of \string#2 to enable propper visualization}%
+ \global#4%
+ \expandafter\doemptyverbatimline
+ \fi}
+
+\gdef\reportprettyCtype
+ {\doreportprettyCtype\ifinCsingle'\'\inCsinglefalse
+ \doreportprettyCtype\ifinCdouble"\"\inCdoublefalse}
+
+\gdef\Csetdiagnostics
+ {\let\normaldoemptyverbatimline\doemptyverbatimline
+ \def\doemptyverbatimline
+ {\normaldoemptyverbatimline
+ \reportprettyCtype}}
+
+\useprettyidentifiers \Ckeywords \Csetspecials
+ break case continue default do else for goto if return sizeof switch while
+
+\useprettyidentifiers \Ctypes \Csetspecials
+ auto char const double enum extern float int long register restrict short
+ signed static struct typedef union unsigned void volatile bool
+
+\installprettytype [C] [C]
+
+\definetyping[C][\c!option=C]
+
+\definecolor [colorprettyone] [black]
+\definecolor [colorprettytwo] [r=.46, g=.38, b=.13]
+\definecolor [colorprettytwoone] [r=.38, g=.18, b=.5]
+\definecolor [colorprettythree] [black]
+\definecolor [colorprettyfour] [black]
+\definecolor [colorprettyfourthree] [r=.15, g=.45, r=.15]
+\definecolor [colorprettyfive] [r=.94, g=.15, b=.15]
+\definecolor [colorprettyeight] [r=.58, g=.09, b=.09]
+\definecolor [colorprettynine] [r=.58, g=.09, b=.09]
+
+\definecolor [grayprettyone] [s=.30]
+\definecolor [grayprettytwo] [s=.45]
+\definecolor [grayprettythree] [s=.60]
+\definecolor [grayprettyfour] [s=.75]
+\definecolor [grayprettyfourthree] [s=.70]
+
+\definepalet
+ [colorpretty]
+ [ prettyone=colorprettyone,
+ prettytwo=colorprettytwo,
+ prettytwoone=colorprettytwoone,
+ prettythree=colorprettythree,
+ prettyfour=colorprettyfour,
+ prettyfourthree=colorprettyfourthree,
+ prettyfive=colorprettyfive,
+ prettyeight=colorprettyeight,
+ prettynine=colorprettynine]
+
+\definepalet
+ [graypretty]
+ [ prettyone=grayprettyone,
+ prettytwo=grayprettytwo,
+ prettythree=grayprettythree,
+ prettyfour=grayprettyfour,
+ prettyfourthree=grayprettyfourthree]
+
+\definepalet [Ccolorpretty] [colorpretty]
+\definepalet [Cgraypretty] [graypretty]
+
+\setuptyping
+ [C]
+ [\c!icommand=\tttf]
+
+\protect \endinput
+
diff --git a/Master/texmf-dist/tex/context/base/verb-ini.tex b/Master/texmf-dist/tex/context/base/verb-ini.tex
index c38c3f6f4cc..43b563a80cd 100644
--- a/Master/texmf-dist/tex/context/base/verb-ini.tex
+++ b/Master/texmf-dist/tex/context/base/verb-ini.tex
@@ -348,7 +348,7 @@
%D \type{\goodbreaks}. And this is how it's done:
\def\doverbatimnobreak
- {\ifoptimizeverbatim\penalty500\fi}
+ {\ifoptimizeverbatim\penalty500 \fi}
\def\doverbatimgoodbreak
{\ifoptimizeverbatim\penalty\linepenalty\fi}
@@ -374,14 +374,41 @@
{\global\let\savedverbatimline\empty
\global\chardef\verbatimstatus\ifskipfirstverbatimline0 \else1 \fi}
-\let\donextemptyverbatimline\relax
+% \let\donextemptyverbatimline\relax
+
+% \def\presetemptyverbatimline
+% {\ifcase\verbatimstatus
+% \global\chardef\verbatimstatus\plusone
+% \or
+% \or
+% \donextemptyverbatimline
+% \or
+% \doflushverbatimline
+% \global\let\savedverbatimline\empty
+% \doemptyverbatimline
+% \global\chardef\verbatimstatus\plustwo
+% \else
+% \kern\zeropoint
+% \doverbatimnobreak
+% \doflushverbatimline
+% \global\let\savedverbatimline\empty
+% \doemptyverbatimline
+% \global\chardef\verbatimstatus\plustwo
+% \fi}
+
+\chardef\verbatimemptylinemode\zerocount
\def\presetemptyverbatimline
{\ifcase\verbatimstatus
\global\chardef\verbatimstatus\plusone
\or
+ \ifcase\verbatimemptylinemode\or\or
+ \doemptyverbatimline
+ \fi
\or
- \donextemptyverbatimline
+ \ifcase\verbatimemptylinemode\else
+ \doemptyverbatimline
+ \fi
\or
\doflushverbatimline
\global\let\savedverbatimline\empty
@@ -417,13 +444,28 @@
\fi
\global\let\savedverbatimline\verbatimline}
+% \def\presetlastverbatimline
+% {\ifcase\verbatimstatus \or \or \or
+% \doflushverbatimline
+% \else
+% \kern\zeropoint
+% \doverbatimnobreak
+% \doflushverbatimline
+% \fi}
+
\def\presetlastverbatimline
- {\ifcase\verbatimstatus \or \or \or
+ {\ifcase \verbatimstatus
+ \or
+ \or
+ \or
\doflushverbatimline
\else
- \kern\zeropoint
+ \kern \zeropoint
\doverbatimnobreak
\doflushverbatimline
+ \fi
+ \ifcase\verbatimemptylinemode\or\else
+ \kern \zeropoint
\fi}
%D \macros
@@ -830,8 +872,14 @@
{\setbox0\hbox{\the\everyline}}%
\global\linepartrue}
-\def\obeyemptylines
- {\let\donextemptyverbatimline\doemptyverbatimline}
+% \def\obeyemptylines
+% {\let\donextemptyverbatimline\doemptyverbatimline}
+
+\def\obeyemptylines % tricky, only in verbatim (should be token list)!
+ {\chardef\verbatimemptylinemode\plusone}
+
+\def\obeyallemptylines % tricky, only in verbatim (should be token list)!
+ {\chardef\verbatimemptylinemode\plustwo}
%D \TEX\ does not offer \type{\everyline}, which is a direct
%D result of its advanced multi||pass paragraph typesetting
@@ -945,7 +993,7 @@
%
-\def\processverbatimline#1{#1} % remove the fake grouping
+\long\def\processverbatimline#1{#1} % remove the fake grouping
%D \macros
%D {processfileverbatim}
@@ -982,8 +1030,8 @@
\vskip\parskip
\fi
\parskip\zeropoint
- \uncatcodecharacters
\verbatimfont
+ \uncatcodecharacters
\setverbatimspaceskip
\frenchspacing
\obeyspaces
@@ -1097,12 +1145,17 @@
%D Just to keep things consistant and to speed up some macros a
%D but, we define a few private constants.
-\def\!!PRETTY {PRETTY}
+\def\!!PRETTY {PRETTY}
-\def\!!prettyone {prettyone}
-\def\!!prettytwo {prettytwo}
-\def\!!prettythree {prettythree}
-\def\!!prettyfour {prettyfour}
+\def\!!prettyone {prettyone}
+\def\!!prettytwo {prettytwo}
+\def\!!prettythree {prettythree}
+\def\!!prettyfour {prettyfour}
+\def\!!prettyfive {prettyfive}
+\def\!!prettynine {prettynine}
+\def\!!prettyeight {prettyeight}
+\def\!!prettytwoone {prettytwoone}
+\def\!!prettyfourthree {prettyfourthree}
%D The first step in defining a pretty interpreter is to assign
%D each character that needs special attention a number, like:
@@ -1992,8 +2045,42 @@
% \initializeverbatimline
% \copyverbatimline}
+% \def\doprocessdisplayverbatim#1#2%
+% {\par
+% \bgroup
+% \escapechar-1
+% \xdef\verbatimname{\string#2}%
+% \egroup
+% \ifcase#1%
+% \let\endofdisplayverbatim\relax
+% \else
+% \def\endofdisplayverbatim{\csname\verbatimname\endcsname}%
+% \fi
+% \bgroup
+% \parindent\zeropoint
+% \ifdim\lastskip<\parskip
+% \removelastskip
+% \vskip\parskip
+% \fi
+% \parskip\zeropoint
+% \processingverbatimtrue
+% \ifcase#1%
+% \convertargument#2\to\endofverbatimcommand
+% \else
+% \expandafter\let\csname\verbatimname\endcsname=\relax
+% \expandafter\convertargument\csname\verbatimname\endcsname
+% \to\endofverbatimcommand
+% \fi
+% \verbatimfont
+% \setverbatimspaceskip
+% \global\linepartrue % needed for paragraph numbering
+% \setupcopyverbatim
+% \initializeverbatimline
+% \copyverbatimline}
+
\def\doprocessdisplayverbatim#1#2%
{\par
+ \beginofverbatimlines
\bgroup
\escapechar-1
\xdef\verbatimname{\string#2}%
@@ -2001,7 +2088,7 @@
\ifcase#1%
\let\endofdisplayverbatim\relax
\else
- \def\endofdisplayverbatim{\csname\verbatimname\endcsname}%
+ \def\endofdisplayverbatim{\endofverbatimlines\csname\verbatimname\endcsname}%
\fi
\bgroup
\parindent\zeropoint
diff --git a/Master/texmf-dist/tex/context/base/x-chemml.xsd b/Master/texmf-dist/tex/context/base/x-chemml.xsd
new file mode 100644
index 00000000000..b511219115c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-chemml.xsd
@@ -0,0 +1,93 @@
+<?xml version="1.0"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+<xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ <p>This schema covers (basic presentational) Chemical
+ markup. We will extend this schema with names and
+ predefined components.</p>
+ <p>author: Hans Hagen, copyright: PRAGMA-ADE / Hasselt NL</p>
+ </xsd:documentation>
+</xsd:annotation>
+
+<xsd:element type="chemType">
+ <xsd:sequence>
+ <xsd:element ref="chemicalComponentType" />
+ <xsd:choice>
+ <xsd:element ref="chemicalActionType" />
+ <xsd:element ref="chemicalBondType" />
+ </xsd:choice>
+ </xsd:sequence>
+</xsd:element>
+
+<xsd:element name="chem" type="chemType" />
+<xsd:element name="ichem" type="chemType" />
+<xsd:element name="dchem" type="chemType" />
+
+<xsd:element name="molecule">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:choice>
+ <xsd:element name="ion" />
+ <xsd:element name="atom" />
+ </xsd:choice>
+ <xsd:element name="caption" type="chemicalCaptionType" />
+ </xsd:sequence>
+ <xsd:attribute name="n" type="xsd:positiveInteger" />
+ </xsd:complexType>
+</xsd:element>
+
+<xsd:element name="ion">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="atom" />
+ </xsd:sequence>
+ <xsd:attribute name="n" type="xsd:positiveInteger" />
+ <xsd:attribute name="charge" type="xsd:integer" />
+ </xsd:complexType>
+</xsd:element>
+
+<xsd:element name="atom" type="xsd:string">
+ <xsd:complexType>
+ <xsd:attribute name="n" type="xsd:positiveInteger"/>
+ <xsd:attribute name="charge" type="xsd:integer" />
+ <xsd:attribute name="protons" type="xsd:positiveInteger" />
+ <xsd:attribute name="weight" type="xsd:positiveInteger" />
+ </xsd:complexType>
+</xsd:element>
+
+<xsd:complexType name="chemicalActionType">
+ <xsd:choice>
+ <xsd:element name="plus" type="chemicalCaptionType" />
+ <xsd:element name="minus" type="chemicalCaptionType" />
+ <xsd:element name="equal" type="chemicalCaptionType" />
+ <xsd:element name="gives" type="chemicalCaptionType" />
+ <xsd:element name="equilibrium" type="chemicalCaptionType" />
+ <xsd:element name="mesomeric" type="chemicalCaptionType" />
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="chemicalBondType">
+ <xsd:choice>
+ <xsd:element name="singlebond" />
+ <xsd:element name="doublebond" />
+ <xsd:element name="triplebond" />
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="chemicalComponentType">
+ <xsd:choice>
+ <xsd:element ref="molecule" />
+ <xsd:element ref="ion" />
+ <xsd:element ref="atom" />
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="chemicalCaptionType" minOccurs="0" maxOccurs="2">
+ <xsd:sequence>
+ <xsd:element name="caption" type="xsd:string" minOccurs="0" maxOccurs="2" />
+ </xsd:sequence>
+</xsd:complexType>
+
+</xsd:schema>
diff --git a/Master/texmf-dist/tex/context/base/x-contml.tex b/Master/texmf-dist/tex/context/base/x-contml.tex
index 9f3fe6fd2a9..e1dda06c1ec 100644
--- a/Master/texmf-dist/tex/context/base/x-contml.tex
+++ b/Master/texmf-dist/tex/context/base/x-contml.tex
@@ -42,9 +42,18 @@
{\doifsomethingXMLop{name}
{\processaction
[\XMLop{type}]
- [xml=>\readfile{\XMLop{name}}\donothing,
+ [xml=>\readfile{\XMLop{name}}\donothing\donothing,
tex=>{{\disableXML\readfile{\XMLop{name}}\donothing\donothing}},
- txt=>{{\disableXML\typefile{\XMLop{name}}\donothing\donothing}}]}}
+ txt=>{{\disableXML\typefile{\XMLop{name}}}}]}}
+
+% or, nicer:
+%
+% \defineXMLsingular [context:include] [name=unknown,type=txt]
+% {\XMLval{include:type}{\XMLop{type}}{}}
+%
+% \mapXMLvalue {include:type} {xml} {\readfile{\XMLop{name}}\donothing\donothing}
+% \mapXMLvalue {include:type} {tex} {{\disableXML\readfile{\XMLop{name}}\donothing\donothing}}
+% \mapXMLvalue {include:type} {txt} {{\disableXML\typefile{\XMLop{name}}}}
%D \elements {compound}
%D
diff --git a/Master/texmf-dist/tex/context/base/x-contml.xsd b/Master/texmf-dist/tex/context/base/x-contml.xsd
new file mode 100644
index 00000000000..3b71e31e850
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-contml.xsd
@@ -0,0 +1,375 @@
+<?xml version="1.0"?>
+
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+
+<xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ This schema describes a class of presentations. The structure is
+ (normally) reflected in the design.
+
+ author: Hans Hagen, copyright: PRAGMA-ADE / Hasselt NL
+ </xsd:documentation>
+</xsd:annotation>
+
+
+<?context-block begin definitions ?>
+
+ <xsd:complexType name="filename.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value='[a-zA-Z0-9\-\:\.]*' />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:complexType name="filetype.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="tex" />
+ <xsd:enumeration value="xml" />
+ <xsd:enumeration value="txt" />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:complexType name="confirmation.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="yes" />
+ <xsd:enumeration value="no" />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:complexType name="conversion.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value='(a|A|n|g|G|r|R|1|2|3|4)' />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:complexType name="reference.label.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern value='([a-zA-Z0-9\-\:]*' />
+ </xsd:restriction>
+ </xsd:complexType>
+
+<?context-block end definitions ?>
+
+
+<?context-block begin text ?>
+
+ <xsd:element name="presentation" mixed="true" />
+
+<?context-block end text ?>
+
+
+<?context-block begin p ?>
+
+ <xsd:element name="p" mixed="true" />
+
+<?context-block end p ?>
+
+
+<?context-block begin hide ?>
+
+ <xsd:element name="hide" mixed="true" />
+
+<?context-block end hide ?>
+
+
+<?context-block begin em ?>
+
+ <xsd:element name="em" mixed="true" />
+
+<?context-block end em ?>
+
+
+<?context-block begin b ?>
+
+ <xsd:element name="b" mixed="true" />
+
+<?context-block end b ?>
+
+
+<?context-block begin quote ?>
+
+ <xsd:element name="quote" mixed="true" />
+ <xsd:element name="quotation" mixed="true" />
+
+<?context-block end quote ?>
+
+
+<?context-block begin include ?>
+
+ <xsd:attributeGroup name="include.attributes">
+ <xsd:attribute name="file" type="filename.value" use="required" />
+ <xsd:attribute name="type" type="filetype.value" />
+ </xsd:attributeGroup>
+
+ <xsd:complexType type="include.type">
+ <xsd:attributeGroup ref="include.attributes" />
+ </xsd:complexType>
+
+ <xsd:element name="include" type="include.type" />
+
+<?context-block end include ?>
+
+
+<?context-block begin compound ?>
+
+ <xsd:attributeGroup name="compound.attributes">
+ <xsd:attribute name="token" type="xsd:string" />
+ </xsd:attributeGroup>
+
+ <xsd:complexType type="compound.type">
+ <xsd:attributeGroup ref="compound.attributes" />
+ </xsd:complexType>
+
+ <xsd:element name="compound" type="compound.type" />
+
+<?context-block end compound ?>
+
+
+<?context-block begin references ?>
+
+ <xsd:attributeGroup name="reference.attributes">
+ <xsd:attribute name="label" type="reference.label.value" />
+ </xsd:attributeGroup>
+
+ <xsd:complexType type="reference.type">
+ <xsd:attributeGroup ref="reference.attributes" />
+ </xsd:complexType>
+
+ <xsd:element name="lineref" type="reference.type" />
+ <xsd:element name="pageref" type="reference.type" />
+ <xsd:element name="textref" type="reference.type" />
+
+<?context-block end references ?>
+
+
+<?context-block begin unknown ?>
+
+ <xsd:element name="unknown"/>
+
+<?context-block end unknown ?>
+
+
+<?context-block begin verbatim ?> <!-- string or anyType -->
+
+ <xsd:complexType name="verbatim.verbatim">
+ <xsd:sequence maxOccurs="unbounded" >
+ <xsd:element name="line" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="verbatim" type="verbatim.verbatim" />
+ <xsd:element name="typing" type="verbatim.verbatim" />
+
+ <xsd:element name="verb" type="xsd:string" />
+ <xsd:element name="type" type="xsd:string" />
+
+<?context-block end verbatim ?>
+
+
+<?context-block begin itemize ?>
+
+ <xsd:attributeGroup name="itemize.attributes">
+ <xsd:attribute name="type" type="conversion.value" />
+ <xsd:attribute name="packed" type="confirmation.value" />
+ <xsd:attribute name="label" type="reference.label.value" />
+ </xsd:attributeGroup>
+
+ <xsd:attributeGroup name="item.attributes">
+ <xsd:attribute name="label" type="reference.label.value" />
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="item.type" mixed="true">
+ <xsd:attributeGroup ref="item.attributes" />
+ </xsd:complexType>
+
+ <xsd:complexType name="itemize.type">
+ <xsd:sequence minOccurs="1" maxOccurs="unbounded">
+ <xml:element name="item" type="item.type" />
+ </xsd:sequence>
+ <xsd:attributeGroup ref="itemize.attributes" />
+ </xsd:complexType>
+
+ <xsd:element name="itemize" type="itemize.type" />
+
+<?context-block end itemize ?>
+
+
+<?context-block begin fixed ?>
+
+ <xsd:complexType name="fixed.type.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="figure" />
+ <xsd:enumeration value="table" />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:complexType name="fixed.location.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="high" />
+ <xsd:enumeration value="low" />
+ <xsd:enumeration value="lohi" />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:attributeGroup name="fixed.attributes">
+ <xsd:attribute name="type" type="fixed.type.value" />
+ <xsd:attribute name="location" type="fixed.location.value" />
+ <xsd:attribute name="label" type="reference.label.value" />
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="fixed.type">
+ <xsd:all>
+ <xsd:element name="caption" mixed="true" />
+ <xsd:element name="content" mixed="true" />
+ </xsd:all>
+ <xsd:attributeGroup ref="fixed.attributes" />
+ </xsd:complexType>
+
+ <xsd:element name="fixed" type="fixed.type" />
+
+<?context-block end fixed ?>
+
+
+<?context-block begin float ?>
+
+ <xsd:complexType name="float.type.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="figure" />
+ <xsd:enumeration value="table" />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:complexType name="float.location.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="high" />
+ <xsd:enumeration value="low" />
+ <xsd:enumeration value="lohi" />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:attributeGroup name="float.attributes">
+ <xsd:attribute name="type" type="float.type.value" />
+ <xsd:attribute name="location" type="float.location.value" />
+ <xsd:attribute name="label" type="reference.label.value" />
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="float.type">
+ <xsd:all>
+ <xsd:element name="caption" mixed="true" />
+ <xsd:element name="content" mixed="true" />
+ </xsd:all>
+ <xsd:attributeGroup ref="float.attributes" />
+ </xsd:complexType>
+
+ <xsd:element name="float" type="float.type" />
+
+<?context-block end float ?>
+
+
+<?context-block begin externalfigure ?>
+
+ <xsd:attributeGroup name="externalfigure.attributes">
+ <xsd:extension base="context.kernel.externalfigure.attributes">
+ <xsd:attribute name="base" type="filename.value"/>
+ <xsd:attribute name="file" type="filename.value"/>
+ <xsd:attribute name="label" type="reference.label.value"/>
+ </xsd:extension>
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="externalfigure.type">
+ <xsd:attributeGroup ref="externalfigure.attributes" />
+ </xsd:complexType>
+
+ <xsd:element name="externalfigure" type="externalfigure.type" />
+
+<?context-block end externalfigure ?>
+
+
+<?context-block begin table ?>
+
+ <xsd:attributeGroup name="table.attributes">
+ <!-- these elements inherit ConTeXt TABLE parameters -->
+ <xsd:extension base="context.kernel.table.attributes" />
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="table.td.type" mixed="true">
+ <xsd:attributeGroup name="table.attributes" />
+ </xsd:complexType>
+
+ <xsd:complexType name="table.tr.type">
+ <xsd:sequence maxOccurs="unbounded">
+ <xsd:element name="td" type="table.td.type" />
+ </xsd:sequence>
+ <xsd:attributeGroup name="table.attributes" />
+ </xsd:complexType>
+
+ <xsd:complexType name="table.type">
+ <xsd:sequence maxOccurs="unbounded">
+ <xsd:element name="tr" type="table.tr.type" />
+ </xsd:sequence>
+ <xsd:attributeGroup name="table.attributes" />
+ </xsd:complexType>
+
+ <xsd:element name="table" type="table.type" />
+
+<?context-block end table ?>
+
+
+<?context-block begin tabulate ?>
+
+ <xsd:complexType name="tabulate.td.type" mixed="true">
+ </xsd:complexType>
+
+ <xsd:complexType name="tabulate.tr.type">
+ <xsd:sequence maxOccurs="unbounded">
+ <xsd:element name="td" type="tabulate.td.type" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="tabulate.base.type">
+ <xsd:sequence maxOccurs="unbounded">
+ <xsd:element name="tr" type="tabulate.tr.type" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="tabulate.align.value">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="high" />
+ <xsd:enumeration value="low" />
+ <xsd:enumeration value="lohi" />
+ </xsd:restriction>
+ </xsd:complexType>
+
+ <xsd:attributeGroup name="tabulate.tcell.attributes">
+ <xsd:attribute name="align" type="tabulate.align.value" />
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="tabulate.tcell.type" mixed="true">
+ <xsd:attributeGroup ref="tabulate.tcell.attributes" />
+ </xsd:complexType>
+
+ <xsd:complexType name="tabulate.tcell.type">
+ </xsd:complexType>
+
+ <xsd:complexType name="tabulate.tcells.type">
+ <xsd:sequence maxOccurs="unbounded">
+ <xsd:element name="tcell" type="tabulate.tcell.type" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="tabulate.type">
+ <xsd:sequence>
+ <xsd:element name="tcells" type="tabulate.tcells.type" />
+ <xsd:element name="thead" type="tabulate.base.type" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="ttail" type="tabulate.base.type" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="tbody" type="tabulate.base.type" minOccurs="1" maxOccurs="unbounded" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:element name="tabulate" type="tabulate.type" />
+
+<?context-block end tabulate ?>
+
+
+</xsd:schema>
diff --git a/Master/texmf-dist/tex/context/base/x-corres.rng b/Master/texmf-dist/tex/context/base/x-corres.rng
new file mode 100644
index 00000000000..09de5d26718
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-corres.rng
@@ -0,0 +1,170 @@
+<?xml version="1.0" ?>
+
+<?context-block begin grammar ?>
+
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+
+ <?context-block end grammar ?>
+
+ <?context-block begin contacts ?>
+
+ <start>
+ <ref name="contacts"/>
+ </start>
+
+ <define name="contacts">
+ <element name="contacts">
+ <zeroOrMore>
+ <choice>
+ <ref name="contacts.contact"/>
+ <ref name="contacts.contactgroup"/>
+ <ref name="contacts.contactfile"/>
+ </choice>
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <?context-block end contacts ?>
+
+ <?context-block begin contact ?>
+
+ <define name="contacts.contact">
+ <element name="contact">
+ <interleave>
+ <optional> <ref name="contact.initials"/> </optional>
+ <optional> <ref name="contact.formalname"/> </optional>
+ <optional> <ref name="contact.informalname"/> </optional>
+ <optional> <ref name="contact.title"/> </optional>
+ <optional> <ref name="contact.prefix"/> </optional>
+ <optional> <ref name="contact.suffix"/> </optional>
+ <optional> <ref name="contact.telephone"/> </optional>
+ <optional> <ref name="contact.mobiletelephone"/> </optional>
+ <optional> <ref name="contact.telefax"/> </optional>
+ <optional> <ref name="contact.email"/> </optional>
+ <optional> <ref name="contact.address"/> </optional>
+ <optional> <ref name="contact.information"/> </optional>
+ </interleave>
+ <attribute name="label"/>
+ </element>
+ </define>
+
+ <?context-block end contact ?>
+
+ <?context-block begin fields ?>
+
+ <define name="contact.initials">
+ <element name="initials">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.formalname">
+ <element name="formalname">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.informalname">
+ <element name="informalname">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.title">
+ <element name="title">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.prefix">
+ <element name="prefix">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.suffix">
+ <element name="suffix">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.telephone">
+ <element name="telephone">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.mobiletelephone">
+ <element name="mobiletelephone">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.telefax">
+ <element name="telefax">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.email">
+ <element name="email">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.address">
+ <element name="address">
+ <zeroOrMore>
+ <ref name="contact.address.p"/>
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="contact.information">
+ <element name="information">
+ <text/>
+ </element>
+ </define>
+
+ <define name="contact.address.p">
+ <element name="p">
+ <text/>
+ </element>
+ </define>
+
+ <?context-block end fields ?>
+
+ <?context-block begin contactgroup ?>
+
+ <define name="contacts.contactgroup">
+ <element name="contactgroup">
+ <zeroOrMore>
+ <ref name="contactgroup.member"/>
+ </zeroOrMore>
+ <attribute name="label"/>
+ </element>
+ </define>
+
+ <define name="contactgroup.member">
+ <element name="member">
+ <text/>
+ </element>
+ </define>
+
+ <?context-block end contactgroup ?>
+
+ <?context-block begin contactfile ?>
+
+ <define name="contacts.contactfile">
+ <element name="contactfile">
+ <text/>
+ </element>
+ </define>
+
+ <?context-block end contactfile ?>
+
+ <?context-block begin grammar ?>
+
+</grammar>
+
+<?context-block end grammar ?> \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/x-fe.tex b/Master/texmf-dist/tex/context/base/x-fe.tex
index 6e24417ac44..8562b1d5296 100644
--- a/Master/texmf-dist/tex/context/base/x-fe.tex
+++ b/Master/texmf-dist/tex/context/base/x-fe.tex
@@ -104,7 +104,7 @@
\defineXMLargument
[fe:trace]
[attribute=,option=]
- {\showXMLinh{\XMLop{attribute}}%
+ {\showXMLinh[\XMLop{attribute}]%
\XMLval{fe:trace}{\XMLop{option}}{}}
\mapXMLvalue
diff --git a/Master/texmf-dist/tex/context/base/x-fig-00.dtd b/Master/texmf-dist/tex/context/base/x-fig-00.dtd
new file mode 100644
index 00000000000..34b4d0bef9b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-fig-00.dtd
@@ -0,0 +1,24 @@
+<!-- author : Taco Hoekwater / Hans Hagen
+ info : x-fig-00.tex / x-fig-01.tex
+ usage : <!DOCTYPE figurelibrary SYSTEM "x-fig-00.dtd">
+ -->
+
+<!ELEMENT figurelibrary (description?,figure*)>
+
+<!ATTLIST figurelibrary language CDATA #IMPLIED>
+<!ATTLIST dummy width CDATA #IMPLIED>
+<!ATTLIST dummy height CDATA #IMPLIED>
+
+<!ELEMENT description (organization?,project?,product?,comment?)>
+<!ELEMENT organization (#PCDATA)>
+<!ELEMENT project (#PCDATA)>
+<!ELEMENT product (#PCDATA)>
+
+<!ELEMENT figure (label,file?,dummy?,copyright?,comment?,status?)>
+<!ELEMENT dummy (#PCDATA)>
+<!ELEMENT file (#PCDATA)>
+<!ELEMENT label (#PCDATA)>
+<!ELEMENT copyright (#PCDATA)>
+<!ELEMENT status (#PCDATA)>
+
+<!ELEMENT comment (#PCDATA)>
diff --git a/Master/texmf-dist/tex/context/base/x-fig-00.xsd b/Master/texmf-dist/tex/context/base/x-fig-00.xsd
new file mode 100644
index 00000000000..615841a1e6c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-fig-00.xsd
@@ -0,0 +1,77 @@
+<?xml version="1.0"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+<xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ <p>This schema described the figure database. This base
+ can be used to collect graphics that later can be used
+ in applications like ConTeXt.</p>
+ <p>author: Tobias Burnus &amp; Hans Hagen, copyright:
+ PRAGMA-ADE / Hasselt NL</p>
+ </xsd:documentation>
+</xsd:annotation>
+
+<xsd:element name="figurelibrary" type="figureLibraryType" />
+
+<xsd:element name="comment" type="nonZeroString" />
+
+<xsd:complexType name="figureLibraryType">
+ <xsd:sequence>
+ <xsd:element name="description" type="descriptionType" />
+ <xsd:element name="figure" type="figureType"
+ minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="language" type="xsd:language" />
+</xsd:complexType>
+
+<xsd:complexType name="descriptionType">
+ <xsd:sequence>
+ <xsd:element name="organization" type="nonZeroString" />
+ <xsd:element name="project" type="nonZeroString" />
+ <xsd:element name="product" type="nonZeroString" />
+ <xsd:element ref="comment" minOccurs="0" />
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="figureType">
+ <xsd:sequence>
+ <xsd:choice>
+ <xsd:element name="file" type="NZNormalizedString" />
+ <xsd:element name="dummy" type="dummyType" />
+ </xsd:choice>
+ <xsd:element name="label" type="NZNormalizedString" />
+ <xsd:element name="copyright" type="nonZeroString" />
+ <xsd:element ref="comment" minOccurs="0" />
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="dummyType">
+ <xsd:simpleContent>
+ <xsd:extension base="nonZeroString">
+ <xsd:attribute name="width" type="TeXUnit" use="required" />
+ <xsd:attribute name="height" type="TeXUnit" use="required" />
+ </xsd:extension>
+ </xsd:simpleContent>
+</xsd:complexType>
+
+<xsd:simpleType name="nonZeroString">
+ <xsd:restriction base="xsd:string">
+ <xsd:minLength value="1" />
+ </xsd:restriction>
+</xsd:simpleType>
+
+<xsd:simpleType name="NZNormalizedString">
+ <xsd:restriction base="xsd:normalizedString">
+ <xsd:minLength value="1" />
+ </xsd:restriction>
+</xsd:simpleType>
+
+<xsd:simpleType name="TeXUnit">
+ <xsd:restriction base="xsd:string">
+ <xsd:pattern
+ value='[0-9]*(,|\.|[0-9])?[0-9]*(cm|mm|in|pt|pc|em|ex|bp|dd|cc|sp)' />
+ </xsd:restriction>
+</xsd:simpleType>
+
+</xsd:schema>
diff --git a/Master/texmf-dist/tex/context/base/x-fig-01.tex b/Master/texmf-dist/tex/context/base/x-fig-01.tex
index 5d6c0fa3f32..e74cfc483de 100644
--- a/Master/texmf-dist/tex/context/base/x-fig-01.tex
+++ b/Master/texmf-dist/tex/context/base/x-fig-01.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% \readfile {x-res-01} \donothing \donothing \endinput
+% \readfile {x-res-01} \donothing \donothing \endinput
%D See \type {x-fig-00.tex} for more information on how to use
%D and generate figure databases. This file loads the file
@@ -58,6 +58,9 @@
\doifnothing {\jobfilename} {\end}
\doiffileelse {\jobfilename.xml} {} {\end}
+\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}]
+\setupattachments [symbol=attachment]
+\useattachment [datafile] [\jobname.xml]
\def\StartDescription
{\bgroup
@@ -77,6 +80,7 @@
{\NC product \NC \XMLpop{product} \NC \NR}{}
\doifXMLdataelse{comment}
{\NC comment \NC \XMLpop{comment} \NC \NR}{}
+ \NC specification \NC \attachment[datafile] \NC \NR
\stoptabulate
\blank[2*big]
\egroup}
@@ -335,7 +339,7 @@
\def\StartLibrary{\mainlanguage[\XMLpar{figurelibrary}{language}{en}]}
\def\StopLibrary {}
-\defineXMLignore [description]
+\defineXMLignore [description]
\defineXMLenvironment [figure] \StartFigureC \StopFigureC
\doglobal\newcounter\CurrentPage
diff --git a/Master/texmf-dist/tex/context/base/x-mathml.xsd b/Master/texmf-dist/tex/context/base/x-mathml.xsd
new file mode 100644
index 00000000000..17f0bea2aa4
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-mathml.xsd
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xds="http://www.w3.org/?">
+
+<xsd:schema>
+
+<xsd:element name="imath" type="mathml:math" />
+<xsd:element name="dmath" type="mathml:math" />
+
+</xsd:schema>
diff --git a/Master/texmf-dist/tex/context/base/x-newcml.tex b/Master/texmf-dist/tex/context/base/x-newcml.tex
new file mode 100644
index 00000000000..b1928cce905
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-newcml.tex
@@ -0,0 +1,454 @@
+%D \module
+%D [ file=x-newmml,
+%D version=2006.04.09, % reimplementation
+%D title=\CONTEXT\ XML Modules,
+%D subtitle=ChemML renderer,
+%D author=Hans Hagen,
+%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.
+
+%D This used to be an xtag filter using remapping but the
+%D following is nore in sync with the new mathml methods.
+
+\writestatus{loading}{Context XML Macros (chem ml)}
+
+\unprotect
+
+\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]}
+
+\defineXMLdirective [chemml] \setupCMLappearance
+
+\defineXMLargument [chem] \automathematics % \rm
+\defineXMLargument [ichem] \inlinemathematics % \rm
+\defineXMLargument [dchem] \displaymathematics % \rm
+
+\def\doifnotXMLparzero#1#2#3%
+ {\ifcase\XMLpar{#1}{#2}{0}\else#3{\XMLpar{#1}{#2}{0}}\fi}
+
+\defineXMLargument [caption] \doCMLcaption
+
+\let\CMLtopcaption\empty
+\let\CMLbotcaption\empty
+
+\chardef\CMLcaptionmode\plusone
+
+\def\doCMLcaption#1%
+ {\ifcase\CMLcaptionmode
+ % can't happen
+ \or
+ \def\CMLbotcaption{#1}%
+ \chardef\CMLcaptionmode\plustwo
+ \or
+ \def\CMLtopcaption{#1}%
+ \chardef\CMLcaptionmode\plusthree
+ \fi}
+
+\def\resetCMLcaption
+ {\let\CMLtopcaption\empty
+ \let\CMLbotcaption\empty
+ \chardef\CMLcaptionmode\plusone}
+
+\resetCMLcaption
+
+\def\doCMLtext#1%
+ {\ifx\CMLtopcaption\empty
+ \setbox0\null
+ \else
+ \setbox0\hbox{\txx\setstrut\strut\ignorespaces\CMLtopcaption\unskip}%
+ \fi
+ \setbox2\hbox{\ignorespaces\strut#1\unskip}%
+ \ifx\CMLbotcaption\empty
+ \setbox4\null
+ \else
+ \setbox4\hbox{\txx\setstrut\strut\ignorespaces\CMLbotcaption\unskip}%
+ \fi
+ \scratchdimen=\wd2\advance\scratchdimen-.5em
+ \ifdim\wd0>\scratchdimen
+ \setbox0\hbox spread .5em{\hss\box0\hss}%
+ \fi
+ \ifdim\wd4>\scratchdimen
+ \setbox4\hbox spread .5em{\hss\box4\hss}%
+ \fi
+ \setbox6=\vbox
+ {\offinterlineskip\halign{\hss##\hss\cr\copy0\cr\copy2\cr\copy4\cr}}%
+ \hbox{\lower\ht4\hbox{\lower\dp2\box6}}}
+
+\def\CMLscript#1%
+ {$\scriptscriptstyle\ignorespaces#1\unskip$}
+
+% \startsetups cml:flush:all
+% \ignorespaces
+% \XMLallnamed{atom,bond,singlebond,doublebond,triplebond}
+% \removeunwantedspaces
+% \stopsetups
+
+\newcounter\currentCMLatom
+\newcounter\nofCMLatoms
+
+\defineXMLenvironmentsave
+ [atom]
+ [n=0,weight=0,protons=0,charge=0]
+ {\directsetup{cml:atom:start}}
+ {\directsetup{cml:atom:stop}}
+
+\startsetups cml:atom:start
+ \removeunwantedspaces
+\stopsetups
+
+\startsetups cml:atom:stop
+ \increment\currentCMLatom
+ \resetCMLcaption
+ \doCMLtext {
+ \bgroup
+ \lohi {
+ \doifnotXMLparzero{atom}{protons}\CMLscript
+ } {
+ \doifnotXMLparzero{atom}{weight}\CMLscript
+ }
+ \ignorespaces
+ \XMLflush{atom}
+ \removeunwantedspaces
+ \lohi {
+ \doifnotXMLparzero{atom}{n}\CMLscript
+ } {
+ \ifnum\nofCMLatoms=\currentCMLatom\relax
+ \doifnotXMLparzero{ion}{charge}\CMLscript
+ \else
+ \doifnotXMLparzero{atom}{charge}\CMLscript
+ \fi
+ }
+ \egroup
+ }
+ \ignorespaces
+\stopsetups
+
+\defineXMLnested % why not environment
+ [molecule]
+ [n=0]
+ {\directsetup{cml:molecule:start}}
+ {\directsetup{cml:molecule:stop}}
+
+\startsetups cml:molecule:start
+ \removeunwantedspaces
+ \begingroup
+ \startsavingXMLelements
+ \ignorespaces
+\stopsetups
+
+\startsetups cml:molecule:stop
+ \removeunwantedspaces
+ \stopsavingXMLelements
+ \resetCMLcaption
+ \XMLfirstnamed{caption}
+ \doCMLtext {
+ \newcounter\currentCMLatom
+ \newcounter\nofCMLatoms
+ \doifnotXMLparzero{molecule}{n}\firstofoneargument
+ \ignorespaces
+ \XMLallnamed{atom,ion,bond,singlebond,doublebond,triplebond}
+ \removeunwantedspaces
+ }
+ \endgroup
+ \ignorespaces
+\stopsetups
+
+\setupCMLappearance [ion] [\c!alternative=\v!a]
+
+\defineXMLnested
+ [ion]
+ [n=0,charge=0]
+ {\directsetup{cml:ion:start}}
+ {\directsetup{cml:ion:stop}}
+
+\startsetups cml:ion:start
+ \begingroup
+ \startsavingXMLelements
+\ignorespaces
+\stopsetups
+
+\startsetups cml:ion:stop
+\removeunwantedspaces
+ \stopsavingXMLelements
+ \resetCMLcaption
+ \XMLfirstnamed{caption}
+ \doCMLtext {
+ \newcounter\currentCMLatom
+ \newcounter\nofCMLatoms
+ \doifnotXMLparzero{ion}{n}\firstofoneargument
+ \doifelse\@@CMLionalternative\v!b {
+ [\ignorespaces
+ \XMLallnamed{atom,bond,singlebond,doublebond,triplebond}
+ \removeunwantedspaces]
+ \high {
+ \doifnotXMLparzero{ion}{charge}\CMLscript
+ }
+ } {
+ \countXMLnamedstack{atom}
+ \edef\nofCMLatoms{\the\scratchcounter}% todo: \nofXMLchildren
+ \ignorespaces
+ \XMLallnamed{atom,bond,singlebond,doublebond,triplebond}
+ \removeunwantedspaces
+ }
+ }
+ \endgroup
+ \ignorespaces
+\stopsetups
+
+\let\doCMLsymbol\gobbleoneargument
+\let\doCMLarrow \gobblethreearguments
+
+\defineXMLenvironment
+ [reaction]
+ {\directsetup{cml:reaction:start}}
+ {\directsetup{cml:reaction:stop}}
+
+\startsetups cml:reaction:start
+ \begingroup
+ \let\doCMLsymbol\dodoCMLsymbol
+ \let\doCMLarrow \dodoCMLarrow
+\stopsetups
+
+\startsetups cml:reaction:stop
+ \endgroup
+\stopsetups
+
+\defineXMLcommand [plus] {\doCMLsymbol{+}}
+\defineXMLcommand [minus] {\doCMLsymbol{-}}
+\defineXMLcommand [equal] {\doCMLsymbol{=}}
+
+\def\dodoCMLsymbol#1%
+ {\removeunwantedspaces\quad
+ \mathop{#1}%
+ \quad\kern\zeropoint\ignorespaces}
+
+\defineXMLcommand [gives] {\resetCMLcaption\doCMLgives}
+\defineXMLcommand [equilibrium] {\resetCMLcaption\doCMLequilibrium}
+\defineXMLcommand [mesomeric] {\resetCMLcaption\doCMLmesomeric}
+
+\def\dodoCMLarrow#1%
+ {\removeunwantedspaces\quad
+ \doCMLtext{$\vcenter{\offinterlineskip\halign{##\cr\hskip3em\cr#1\cr}}$}%
+ \quad\kern\zeropoint\ignorespaces}
+
+\def\doCMLgives
+ {\doCMLarrow{\rightarrowfill}}
+
+\def\doCMLequilibrium
+ {\doCMLarrow{\rightarrowfill\cr\noalign{\nointerlineskip}\leftarrowfill}}
+
+\def\doCMLmesomeric
+ {\doCMLarrow{$\leftarrow\hskip-1em$\rightarrowfill}}
+
+\defineXMLcommand [bond] [n=1] \doCMLbond
+\defineXMLcommand [singlebond] [n=1] \doCMLsinglebond
+\defineXMLcommand [doublebond] [n=1] \doCMLdoublebond
+\defineXMLcommand [triplebond] [n=1] \doCMLtriplebond
+
+\def\doCMLbond
+ {\ifcase\XMLop{n}\relax
+ \doCMLsinglebond
+ \or
+ \doCMLdoublebond
+ \or
+ \doCMLtriplebond
+ \fi}
+
+\def\doCMLbond
+ {\removeunwantedspaces
+ \hrule \!!width \hsize \!!height .1ex\relax % .4pt
+ \ignorespaces}
+
+\def\dodoCMLbond#1#2#3%
+ {\removeunwantedspaces
+ \begingroup
+ \setbox\scratchbox\hbox{$M$}%
+ \vbox to \ht\scratchbox
+ {\hsize\wd\scratchbox
+ \vskip.1\wd\scratchbox
+ #1\vfill#2\vfill#3%
+ \vskip.1\wd\scratchbox}%
+ \endgroup
+ \ignorespaces}
+
+\def\doCMLsinglebond{\dodoCMLbond\relax \doCMLbond\relax }
+\def\doCMLdoublebond{\dodoCMLbond\doCMLbond\relax \doCMLbond}
+\def\doCMLtriplebond{\dodoCMLbond\doCMLbond\doCMLbond\doCMLbond}
+
+% extensions (uses m-chemic, which thenneeds to be loaded)
+
+% <dchem>
+% <structure>
+% <component>
+% <graphic>SIX,B</graphic>
+% <graphic>R135</graphic>
+% </component>
+% <component>
+% <graphic>R246</graphic>
+% </component>
+% <component>
+% <graphic>RZ</graphic>
+% <text>A,B,C,D,E,F</text>
+% </component>
+% <component>
+% <graphic>Z</graphic>
+% <oxidation n="3">A</oxidation>
+% <annotation location="tl">
+% <text>B</text>
+% <caption>x</caption>
+% </annotation>
+% <oxidation n="3" sign="+">C</oxidation>
+% <text>D,E,F</text>
+% </component>
+% </structure>
+% <structure>
+% <component>
+% <graphic>SIX,B</graphic>
+% <graphic>r135</graphic>
+% </component>
+% <component>
+% <graphic>R246</graphic>
+% </component>
+% <component>
+% <graphic>RZ</graphic>
+% <text>A,B,C,D,E,F</text>
+% </component>
+% </structure>
+% </dchem>
+
+\ifx\XMLttoks \undefined \newtoks \XMLttoks \fi
+\ifx\XMLgtoks \undefined \newtoks \XMLgtoks \fi
+
+\ifx\startchemical\undefined
+ \def\startchemical {\hbox{module chemic is not loaded}}
+ \let\stopchemical \relax
+ \def\chemical[#1][#2]{}
+\fi
+
+\defineXMLenvironment
+ [structure]
+ {\startchemical
+ \ignorespaces}
+ {\removeunwantedspaces
+ \stopchemical}
+
+\defineXMLenvironment
+ [component]
+ {\global\XMLgtoks\emptytoks
+ \global\XMLttoks\emptytoks
+ \defineXMLargument[graphic]{\dogetCMLgraphic}%
+ \defineXMLargument[text] {\dogetCMLtext}%
+ \ignorespaces}
+ {\removeunwantedspaces
+ \expanded{\chemical[\the\XMLgtoks][\the\XMLttoks]}%
+ \ignorespaces}
+
+\def\dogetCMLgraphic#1%
+ {\doifelsenothing{\the\XMLgtoks}
+ {\uppercase{\doglobal\appendtoks #1\to\XMLgtoks}}
+ {\uppercase{\doglobal\appendtoks,#1\to\XMLgtoks}}%
+ \ignorespaces}
+
+\def\dogetCMLtext#1%
+ {\doifelsenothing{\the\XMLttoks}
+ {\uppercase{\doglobal\appendtoks #1\to\XMLttoks}}
+ {\uppercase{\doglobal\appendtoks,#1\to\XMLttoks}}%
+ \ignorespaces}
+
+\defineXMLargument
+ [oxidation]
+ [sign=,n=1]
+ {\doCMLoxidation}
+
+\def\doCMLoxidation#1%
+ {\expanded{\dogetCMLtext{\noexpand\chemicaloxidation{\XMLop{cml}}{\XMLop{n}}{#1}}}%
+ \ignorespaces}
+
+% \defineXMLenvironment
+% [annotation]
+% [location=]
+% {\defineXMLsave[text]%
+% \defineXMLsave[caption]}
+% {\removeunwantedspaces
+% \processaction
+% [\XMLpar{annotation}{location}{r}]
+% [ t=>\dodoCMLannotation\chemicaltop,
+% b=>\dodoCMLannotation\chemicalbottom,
+% l=>\dodoCMLannotation\chemicalleft,
+% r=>\dodoCMLannotation\chemicalright,
+% lc=>\dodoCMLannotation\chemicalleftcentered,
+% rc=>\dodoCMLannotation\chemicalrightcentered,
+% tl=>\dodoCMLannotation\chemicaltopleft,
+% bl=>\dodoCMLannotation\chemicalbottomleft,
+% tr=>\dodoCMLannotation\chemicaltopright,
+% br=>\dodoCMLannotation\chemicalbottomright,
+% lt=>\dodoCMLannotation\chemicallefttop,
+% lb=>\dodoCMLannotation\chemicalleftbottom,
+% rt=>\dodoCMLannotation\chemicalrighttop,
+% rb=>\dodoCMLannotation\chemicalrightbottom,
+% x=>\dodoCMLannotation\chemicaltighttext,
+% sl=>\dodoCMLannotation\chemicalsmashedleft,
+% sm=>\dodoCMLannotation\chemicalsmashedmiddle,
+% sr=>\dodoCMLannotation\chemicalsmashedright]%
+% \ignorespaces}
+
+% todo: generic mapper t -> top etc
+
+\mapXMLvalue {cml:a:l} {t} {\dodoCMLannotation\chemicaltop}
+\mapXMLvalue {cml:a:l} {b} {\dodoCMLannotation\chemicalbottom}
+\mapXMLvalue {cml:a:l} {l} {\dodoCMLannotation\chemicalleft}
+\mapXMLvalue {cml:a:l} {r} {\dodoCMLannotation\chemicalright}
+\mapXMLvalue {cml:a:l} {lc} {\dodoCMLannotation\chemicalleftcentered}
+\mapXMLvalue {cml:a:l} {rc} {\dodoCMLannotation\chemicalrightcentered}
+\mapXMLvalue {cml:a:l} {tl} {\dodoCMLannotation\chemicaltopleft}
+\mapXMLvalue {cml:a:l} {bl} {\dodoCMLannotation\chemicalbottomleft}
+\mapXMLvalue {cml:a:l} {tr} {\dodoCMLannotation\chemicaltopright}
+\mapXMLvalue {cml:a:l} {br} {\dodoCMLannotation\chemicalbottomright}
+\mapXMLvalue {cml:a:l} {lt} {\dodoCMLannotation\chemicallefttop}
+\mapXMLvalue {cml:a:l} {lb} {\dodoCMLannotation\chemicalleftbottom}
+\mapXMLvalue {cml:a:l} {rt} {\dodoCMLannotation\chemicalrighttop}
+\mapXMLvalue {cml:a:l} {rb} {\dodoCMLannotation\chemicalrightbottom}
+\mapXMLvalue {cml:a:l} {x} {\dodoCMLannotation\chemicaltighttext}
+\mapXMLvalue {cml:a:l} {sl} {\dodoCMLannotation\chemicalsmashedleft}
+\mapXMLvalue {cml:a:l} {sm} {\dodoCMLannotation\chemicalsmashedmiddle}
+\mapXMLvalue {cml:a:l} {sr} {\dodoCMLannotation\chemicalsmashedright}
+
+% \mapXMLvalue {cml:a:l} {cl} {\dodoCMLannotation\chemicalleftcentered}
+% \mapXMLvalue {cml:a:l} {cr} {\dodoCMLannotation\chemicalrightcentered}
+% \mapXMLvalue {cml:a:l} {lt} {\dodoCMLannotation\chemicaltopleft}
+% \mapXMLvalue {cml:a:l} {lb} {\dodoCMLannotation\chemicalbottomleft}
+% \mapXMLvalue {cml:a:l} {rt} {\dodoCMLannotation\chemicaltopright}
+% \mapXMLvalue {cml:a:l} {rb} {\dodoCMLannotation\chemicalbottomright}
+% \mapXMLvalue {cml:a:l} {tl} {\dodoCMLannotation\chemicallefttop}
+% \mapXMLvalue {cml:a:l} {bl} {\dodoCMLannotation\chemicalleftbottom}
+% \mapXMLvalue {cml:a:l} {tr} {\dodoCMLannotation\chemicalrighttop}
+% \mapXMLvalue {cml:a:l} {br} {\dodoCMLannotation\chemicalrightbottom}
+% \mapXMLvalue {cml:a:l} {ls} {\dodoCMLannotation\chemicalsmashedleft}
+% \mapXMLvalue {cml:a:l} {ms} {\dodoCMLannotation\chemicalsmashedmiddle}
+% \mapXMLvalue {cml:a:l} {rs} {\dodoCMLannotation\chemicalsmashedright}
+
+\defineXMLenvironment
+ [annotation]
+ [location=]
+ {\pushXMLmeaning{text}%
+ \pushXMLmeaning{caption}%
+ \defineXMLsave[text]%
+ \defineXMLsave[caption]}
+ {\removeunwantedspaces
+ \XMLval{cml:a:l}{\XMLpar{annotation}{location}{r}}{\XMLflush{text}}%
+ \popXMLmeaning{text}%
+ \popXMLmeaning{caption}%
+ \ignorespaces}
+
+\def\dodoCMLannotation#1%
+ {\expanded{\dogetCMLtext{\noexpand#1{\XMLflush{caption}}{\XMLflush{text}}}}}
+
+\defineXMLenvironment
+ [forever]
+ {\left[}
+ {\right]}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-newmme.tex b/Master/texmf-dist/tex/context/base/x-newmme.tex
new file mode 100644
index 00000000000..9763de11490
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-newmme.tex
@@ -0,0 +1,429 @@
+%D \module
+%D [ file=m-newmme,
+%D version=2005.06.10, % 1999.12.20,
+%D title=\CONTEXT\ XML Modules,
+%D subtitle=MathML Entities,
+%D author=Hans Hagen,
+%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.
+
+\writestatus{loading}{Context XML Macros (MathML Entities)}
+
+\unprotect
+
+%D Used in the manual:
+
+\def\showMMLentity#1%
+ {\bgroup
+ \doifXMLentityelse{#1}
+ {\let\MMLleft\empty\let\MMLright\empty\mathematics{\getXMLentity{#1}{}}}
+ {\getXMLentity{unknown}}%
+ \egroup}
+
+\newbox\unknownXMLentity
+\setbox\unknownXMLentity\hbox{\inframed[\c!strut=\v!no,\c!offset=1pt]{\ttx ?}}
+
+\defineXMLentity [unknown] {\copy\unknownXMLentity}
+
+%D A (not really needed) precaution:
+
+\ifx\blackboard\undefined
+ \def\blackboard{\ifx\Bbb\undefined\else\expandafter\Bbb\fi}
+\fi
+
+%D Basic entities, greek:
+
+\defineXMLentity [alpha] {\mathematics \alpha}
+\defineXMLentity [beta] {\mathematics \beta}
+\defineXMLentity [gamma] {\mathematics \gamma}
+\defineXMLentity [delta] {\mathematics \delta}
+\defineXMLentity [epsilon] {\mathematics \epsilon}
+\defineXMLentity [zeta] {\mathematics \zeta}
+\defineXMLentity [eta] {\mathematics \eta}
+\defineXMLentity [theta] {\mathematics \theta}
+\defineXMLentity [iota] {\mathematics \iota}
+\defineXMLentity [kappa] {\mathematics \kappa}
+\defineXMLentity [lambda] {\mathematics \lambda}
+\defineXMLentity [theta] {\mathematics \theta}
+\defineXMLentity [mu] {\mathematics \mu}
+\defineXMLentity [nu] {\mathematics \nu}
+\defineXMLentity [xi] {\mathematics \xi}
+\defineXMLentity [pi] {\mathematics \pi}
+\defineXMLentity [rho] {\mathematics \rho}
+\defineXMLentity [sigma] {\mathematics \sigma}
+\defineXMLentity [tau] {\mathematics \tau}
+\defineXMLentity [upsilon] {\mathematics \upsilon}
+\defineXMLentity [phi] {\mathematics \phi}
+\defineXMLentity [chi] {\mathematics \chi}
+\defineXMLentity [psi] {\mathematics \psi}
+\defineXMLentity [omega] {\mathematics \omega}
+
+\defineXMLentity [varepsilon] {\mathematics \varepsilon}
+\defineXMLentity [vartheta] {\mathematics \vartheta}
+\defineXMLentity [varpi] {\mathematics \varpi}
+\defineXMLentity [varrho] {\mathematics \varrho}
+\defineXMLentity [varsigma] {\mathematics \varsigma}
+\defineXMLentity [varphi] {\mathematics \varphi}
+
+\defineXMLentity [epsilonv] {\mathematics \varepsilon}
+\defineXMLentity [thetav] {\mathematics \vartheta}
+\defineXMLentity [piv] {\mathematics \varpi}
+\defineXMLentity [rhov] {\mathematics \varrho}
+\defineXMLentity [sigmav] {\mathematics \varsigma}
+\defineXMLentity [phiv] {\mathematics \varphi}
+
+\defineXMLentity [epsi] {\mathematics \epsilon}
+\defineXMLentity [epsiv] {\mathematics \varepsilon}
+
+\defineXMLentity [Alpha] {A}
+\defineXMLentity [Beta] {B}
+\defineXMLentity [Gamma] {\mathematics \Gamma}
+\defineXMLentity [Delta] {\mathematics \Delta}
+\defineXMLentity [Epsilon] {E}
+\defineXMLentity [Zeta] {Z}
+\defineXMLentity [Eta] {N}
+\defineXMLentity [Theta] {\mathematics \Theta}
+\defineXMLentity [Iota] {I}
+\defineXMLentity [Kappa] {K}
+\defineXMLentity [Lambda] {\mathematics \Lambda}
+\defineXMLentity [Mu] {M}
+\defineXMLentity [Nu] {N}
+\defineXMLentity [Xi] {\mathematics \Xi}
+\defineXMLentity [Pi] {\mathematics \Pi}
+\defineXMLentity [Ro] {R}
+\defineXMLentity [Sigma] {\mathematics \Sigma}
+\defineXMLentity [Tau] {T}
+\defineXMLentity [Upsilon] {\mathematics \Upsilon}
+\defineXMLentity [Phi] {\mathematics \Phi}
+\defineXMLentity [Chi] {X}
+\defineXMLentity [Psi] {\mathematics \Psi}
+\defineXMLentity [Omega] {\mathematics \Omega}
+
+%D Basic entities, hebrew:
+
+\defineXMLentity [aleph] {\mathematics \aleph}
+
+%D Basic entities, functions:
+
+\defineXMLentity [abs] {\mathopnolimits{abs}}
+\defineXMLentity [arg] {\mathopnolimits{arg}}
+\defineXMLentity [codomain] {\mathopnolimits{codomain}}
+\defineXMLentity [curl] {\mathopnolimits{curl}}
+\defineXMLentity [determinant] {\mathopnolimits{det}}
+\defineXMLentity [divergence] {\mathopnolimits{div}}
+\defineXMLentity [domain] {\mathopnolimits{domain}}
+\defineXMLentity [false] {\mathopnolimits{false}}
+\defineXMLentity [gcd] {\mathopnolimits{gcd}}
+\defineXMLentity [grad] {\mathopnolimits{grad}}
+\defineXMLentity [identity] {\mathopnolimits{id}}
+\defineXMLentity [image] {\mathopnolimits{image}}
+\defineXMLentity [lcm] {\mathopnolimits{lcm}}
+\defineXMLentity [max] {\mathopnolimits{max}}
+\defineXMLentity [median] {\mathopnolimits{median}}
+\defineXMLentity [min] {\mathopnolimits{min}}
+\defineXMLentity [mode] {\mathopnolimits{mode}}
+\defineXMLentity [mod] {\mathopnolimits{mod}}
+\defineXMLentity [notanumber] {\mathopnolimits{NaN}}
+\defineXMLentity [otherwise] {\mathopnolimits{otherwise}}
+\defineXMLentity [true] {\mathopnolimits{true}}
+\defineXMLentity [declare] {\mathopnolimits{declare}}
+\defineXMLentity [as] {\mathopnolimits{as}}
+\defineXMLentity [polar] {\mathopnolimits{Polar}}
+
+\defineXMLentity [mathematicald] {d}
+
+\defineXMLentity [imaginaryi] {{\rm i}}
+\defineXMLentity [differentiald] {\partial}
+\defineXMLentity [exponentiale] {{\rm e}}
+\defineXMLentity [capitaldifferentiald] {D}
+
+\defineXMLentity [ii] {\getXMLentity{imaginaryi}}
+\defineXMLentity [dd] {\getXMLentity{differentiald}}
+\defineXMLentity [ee] {\getXMLentity{exponentiale}}
+\defineXMLentity [DD] {\getMMLentity{capitaldifferentiald}}
+
+\defineXMLentity [ImaginaryI] {\getXMLentity{imaginaryi}}
+\defineXMLentity [DifferentialD] {\getXMLentity{differentiald}}
+\defineXMLentity [ExponentialE] {\getXMLentity{exponentiale}}
+\defineXMLentity [CapitalDifferentialD] {\getXMLentity{differentiald}}
+
+\defineXMLentity [NaN] {\getXMLentity{notanumber}}
+\defineXMLentity [NotANumber] {\getXMLentity{notanumber}}
+
+\defineXMLentity [and] {\wedge}
+\defineXMLentity [exists] {\exists}
+\defineXMLentity [forall] {\forall}
+\defineXMLentity [implies] {\Rightarrow}
+\defineXMLentity [not] {\neg}
+\defineXMLentity [or] {\vee}
+\defineXMLentity [xor] {\mathopnolimits{xor}}
+
+\defineXMLentity [imaginary] {\Im}
+\defineXMLentity [real] {\Re}
+
+\defineXMLentity [lceiling] {\lceil}
+\defineXMLentity [rceiling] {\rceil}
+
+\defineXMLentity [lfloor] {\lfloor}
+\defineXMLentity [rfloor] {\rfloor}
+
+\defineXMLentity [ne] {\neq}
+\defineXMLentity [neq] {\neq}
+\defineXMLentity [gt] {>}
+\defineXMLentity [lt] {<}
+\defineXMLentity [ge] {\geq}
+\defineXMLentity [geq] {\geq}
+\defineXMLentity [le] {\leq}
+\defineXMLentity [leq] {\leq}
+
+\defineXMLentity [equivalent] {\equiv}
+\defineXMLentity [equiv] {\equiv}
+\defineXMLentity [approx] {\approx}
+
+\defineXMLentity [factorof] {\mid}
+\defineXMLentity [mapsto] {\mapsto}
+
+\defineXMLentity [int] {\int}
+\defineXMLentity [prime] {\prime}
+\defineXMLentity [laplacian] {\nabla^2}
+\defineXMLentity [partial] {\partial}
+
+\defineXMLentity [union] {\cup}
+\defineXMLentity [intersect] {\cap}
+\defineXMLentity [in] {\in}
+\defineXMLentity [notin] {\not\in}
+\defineXMLentity [subset] {\subset}
+\defineXMLentity [prsubset] {\subseteq}
+\defineXMLentity [notsubset] {\not\subset}
+\defineXMLentity [notprsubset] {\not\subseteq}
+\defineXMLentity [setdiff] {\setminus}
+
+\defineXMLentity [card] {\vert}
+\defineXMLentity [cartesianproduct] {\times}
+
+\defineXMLentity [sum] {\sum}
+\defineXMLentity [prod] {\prod}
+\defineXMLentity [product] {\prod}
+\defineXMLentity [lim] {\lim}
+
+\defineXMLentity [exp] {\mathopnolimits{exp}} % {\exp}
+\defineXMLentity [ln] {\mathopnolimits{ln}} % {\ln}
+\defineXMLentity [log] {\mathopnolimits{log}} % {\log}
+
+\defineXMLentity [sin] {\mathopnolimits{sin}}
+\defineXMLentity [arcsin] {\mathopnolimits{arcsin}}
+\defineXMLentity [sinh] {\mathopnolimits{sinh}}
+\defineXMLentity [arcsinh] {\mathopnolimits{arcsinh}}
+\defineXMLentity [cos] {\mathopnolimits{cos}}
+\defineXMLentity [arccos] {\mathopnolimits{arccos}}
+\defineXMLentity [cosh] {\mathopnolimits{cosh}}
+\defineXMLentity [arccosh] {\mathopnolimits{arccosh}}
+\defineXMLentity [tan] {\mathopnolimits{tan}}
+\defineXMLentity [arctan] {\mathopnolimits{arctan}}
+\defineXMLentity [tanh] {\mathopnolimits{tanh}}
+\defineXMLentity [arctanh] {\mathopnolimits{arctanh}}
+\defineXMLentity [cot] {\mathopnolimits{cot}}
+\defineXMLentity [arccot] {\mathopnolimits{arccot}}
+\defineXMLentity [coth] {\mathopnolimits{coth}}
+\defineXMLentity [arccoth] {\mathopnolimits{arccoth}}
+\defineXMLentity [csc] {\mathopnolimits{csc}}
+\defineXMLentity [arccsc] {\mathopnolimits{arccsc}}
+\defineXMLentity [csch] {\mathopnolimits{csch}}
+\defineXMLentity [arccsch] {\mathopnolimits{arccsch}}
+\defineXMLentity [sec] {\mathopnolimits{sec}}
+\defineXMLentity [arcsec] {\mathopnolimits{arcsec}}
+\defineXMLentity [sech] {\mathopnolimits{sech}}
+\defineXMLentity [arcsech] {\mathopnolimits{arcsech}}
+
+\defineXMLentity [transpose] {^{\rm T}}
+
+\defineXMLentity [plusminus] {\mathematics{\pm}}
+\defineXMLentity [minusplus] {\mathematics{\mp}}
+
+\defineXMLentity [vectorproduct] {\times}
+\defineXMLentity [scalarproduct] {\cdot}
+\defineXMLentity [outerproduct] {\otimes}
+
+\defineXMLentity [integers] {\integers}
+\defineXMLentity [reals] {\reals}
+\defineXMLentity [rationals] {\rationals}
+\defineXMLentity [naturalnumbers] {\naturalnumbers}
+\defineXMLentity [complexes] {\complexes}
+\defineXMLentity [primes] {\primes}
+
+\defineXMLentity [emptyset] {\emptyset}
+\defineXMLentity [pi] {\pi}
+\defineXMLentity [eulergamma] {\gamma}
+\defineXMLentity [infinity] {\mathematics{\infty}}
+
+\defineXMLentity [InvisibleTimes] {}
+\defineXMLentity [InvisibleComma] {}
+\defineXMLentity [ApplyFunction] {}
+
+\defineXMLentity [it] {\getXMLentity{InvisibleTines}}
+\defineXMLentity [ic] {\getXMLentity{InvisibleComma}}
+\defineXMLentity [af] {\getXMLentity{ApplyFunction}}
+
+\defineXMLentity [PlusMinus] {\getXMLentity{plusminus}}
+
+\defineXMLentity [infin] {\getXMLentity{infinity}}
+\defineXMLentity [infty] {\getXMLentity{infinity}}
+\defineXMLentity [part] {\getXMLentity{differentiald}}
+
+\defineXMLentity [RightArrow] {\normalorfiller\rightarrow\rightarrowfill}
+\defineXMLentity [LeftArrow] {\normalorfiller\leftarrow\leftarrowfill}
+\defineXMLentity [UnderBrace] {\normalorfiller\empty\upbracefill}
+\defineXMLentity [OverBrace] {\normalorfiller\empty\downbracefill}
+\defineXMLentity [UnderBar] {\normalorfiller\hrule\hrulefill}
+\defineXMLentity [OverBar] {\normalorfiller\hrule\hrulefill}
+\defineXMLentity [Hat] {\normalorfiller\empty\empty} % todo
+
+\defineXMLentity [downarrow] {\mathortext\downarrow\empty}
+\defineXMLentity [uparrow] {\mathortext\uparrow\empty}
+
+\defineXMLentity [Tab] {\hskip4em}
+\defineXMLentity [NewLine] {\mathortext\empty\crlf}
+\defineXMLentity [IndentingNewLine] {\mathortext\empty\crlf}
+
+\defineXMLentity [NoBreak] {\nobreak}
+\defineXMLentity [GoodBreak] {\goodbreak}
+\defineXMLentity [BadBreak] {\nobreak}
+
+\defineXMLentity [Space] {\getXMLentity{MediumSpace}}
+\defineXMLentity [NonBreakingSpace] {\getXMLentity{MediumSpace}}
+\defineXMLentity [ZeroWidthSpace] {}
+
+\def\somespaceentity#1#2%
+ {\mathortext
+ {\mskip#1mu}
+ {\ifvmode\dontleavehmode\else\unskip\fi\hskip#2em\strut\hskip\zeropoint\ignorespaces}%
+ \relax}
+
+\defineXMLentity [VeryThinSpace] {\somespaceentity {2}{.125}}
+\defineXMLentity [ThinSpace] {\somespaceentity {3}{.25}}
+\defineXMLentity [MediumSpace] {\somespaceentity {4}{.5}}
+\defineXMLentity [ThickSpace] {\somespaceentity {5}{1}}
+\defineXMLentity [NegativeVeryThinSpace] {\somespaceentity{-2}{-.125}}
+\defineXMLentity [NegativeThinSpace] {\somespaceentity{-3}{-.25}}
+\defineXMLentity [NegativeMediumSpace] {\somespaceentity{-4}{-.5}}
+\defineXMLentity [NegativeThickSpace] {\somespaceentity{-5}{-1}}
+
+\defineXMLentity [NegVeryThinSpace] {\getXMLentity{NegativeVeryThinSpace}}
+\defineXMLentity [NegThinSpace] {\getXMLentity{NegativeThinSpace}}
+\defineXMLentity [NegMediumSpace] {\getXMLentity{NegativeMediumSpace}}
+\defineXMLentity [NegThickSpace] {\getXMLentity{NegativeThickSpace}}
+
+\defineXMLentity [nbsp] {\getXMLentity{NonBreakingSpace}}
+\defineXMLentity [thinsp] {\getXMLentity{ThinSpace}}
+\defineXMLentity [medsp] {\getXMLentity{MediumSpace}}
+\defineXMLentity [thicksp] {\getXMLentity{ThickSpace}}
+
+\defineXMLentity [larr] {\getXMLentity{LeftArrow}}
+\defineXMLentity [rarr] {\getXMLentity{RightArrow}}
+
+\ifx\MMLleft \undefined \let\MMLleft \firstofoneargument \fi
+\ifx\MMLright\undefined \let\MMLright\firstofoneargument \fi
+
+
+\defineXMLentity [lbrace] {\normalordelimiter{\{}{\MMLleft \{}}
+\defineXMLentity [rbrace] {\normalordelimiter{\}}{\MMLright\}}}
+\defineXMLentity [lbracket] {\normalordelimiter{[}{\MMLleft [}}
+\defineXMLentity [rbracket] {\normalordelimiter{]}{\MMLright]}}
+\defineXMLentity [lparenthesis] {\normalordelimiter{(}{\MMLleft (}}
+\defineXMLentity [rparenthesis] {\normalordelimiter{)}{\MMLright)}}
+\defineXMLentity [langle] {\normalordelimiter{\langle}{\MMLleft \langle}}
+\defineXMLentity [rangle] {\normalordelimiter{\rangle}{\MMLright\rangle}}
+
+\defineXMLentity [lang] {\getXMLentity{langle}}
+\defineXMLentity [rang] {\getXMLentity{rangle}}
+\defineXMLentity [lbrack] {\getXMLentity{lbracket}}
+\defineXMLentity [rbrack] {\getXMLentity{rbracket}}
+\defineXMLentity [lparent] {\getXMLentity{lparenthesis}}
+\defineXMLentity [rparent] {\getXMLentity{rparenthesis}}
+
+% \bgroup
+% \catcode`\{=12 \doglobal\convertargument{\to\mmllbrace
+% \catcode`\}=12 \doglobal\convertargument}\to\mmlrbrace
+% \egroup
+
+% \expanded{\defineXMLentity[\mmllbrace]}{\getXMLentity{lbrace}}
+% \expanded{\defineXMLentity[\mmlrbrace]}{\getXMLentity{rbrace}}
+
+\expanded{\defineXMLentity[\iftrue \string{\else}\fi]}{\getXMLentity{lbrace}}
+\expanded{\defineXMLentity[\iffalse{\else\string}\fi]}{\getXMLentity{rbrace}}
+
+\defineXMLentity [{[}] {\getXMLentity{lbracket}}
+\defineXMLentity [{]}] {\getXMLentity{rbracket}}
+\defineXMLentity [{(}] {\getXMLentity{lparenthesis}}
+\defineXMLentity [{)}] {\getXMLentity{rparenthesis}}
+
+\defineXMLentity [times] {\mathematics{\times}}
+\defineXMLentity [minus] {\mathematics{-}}
+\defineXMLentity [plus] {\mathematics{+}}
+\defineXMLentity [plusmn] {\mathematics{\pm}}
+
+\defineXMLentity [nabla] {\nabla}
+
+\def\myspecialnormalvert {\mathematics{\vert}}
+\def\myspecialstretchvert{\;\vrule\;}
+
+\defineXMLentity [,] {{,}}
+\defineXMLentity [.] {{.}}
+\defineXMLentity [+] {+}
+\defineXMLentity [-] {-}
+\defineXMLentity [(] {(}
+\defineXMLentity [)] {)}
+\defineXMLentity [<] {\mathematics{<}}
+\defineXMLentity [>] {\mathematics{>}}
+\defineXMLentity [|] {\myspecialnormalvert}
+\defineXMLentity [/] {/}
+\defineXMLentity [*] {\times}
+\defineXMLentity [=] {=}
+
+% \defineXMLentity [(] {\MMLleft (}
+% \defineXMLentity [)] {\MMLright)}
+
+% \defineXMLentity [{[}] {\MMLleft [}
+% \defineXMLentity [{]}] {\MMLright]}
+
+\defineXMLentity [++] {++}
+\defineXMLentity [--] {--}
+\defineXMLentity [//] {//}
+\defineXMLentity [**] {\times\times}
+\defineXMLentity [==] {==}
+
+\defineXMLentity [quot] {"}
+
+\defineXMLentity [triangle] {\mathematics\triangle}
+\defineXMLentity [otimes] {\mathematics\otimes}
+\defineXMLentity [oplus] {\mathematics\oplus}
+\defineXMLentity [cup] {\mathematics\cup}
+\defineXMLentity [cap] {\mathematics\cap}
+\defineXMLentity [sdot] {\mathematics\cdot}
+\defineXMLentity [dot] {\mathematics\cdot}
+\defineXMLentity [sim] {\mathematics\sim}
+\defineXMLentity [circ] {\mathematics\circ}
+\defineXMLentity [dagger] {\mathematics\dagger}
+\defineXMLentity [cdots] {\mathematics\cdots}
+
+\defineXMLentity [...] {\getXMLentity{cdots}}
+\defineXMLentity [continued] {\getXMLentity{cdots}}
+
+\defineXMLentity [sub] {\getXMLentity{subset}}
+\defineXMLentity [sube] {\getXMLentity{prsubset}}
+\defineXMLentity [notprsubset] {\getXMLentity{notprsubset}}
+
+\defineXMLentity [ndash] {\endash}
+\defineXMLentity [mdash] {\emdash}
+
+\defineXMLentity [tex-bar] {\mathematics{\vert}}
+\defineXMLentity [tex-dollar] {\dollar}
+\defineXMLentity [tex-backslash] {\backslash}
+\defineXMLentity [tex-leftbrace] {\mathematics{\{}}
+\defineXMLentity [tex-rightbrace] {\mathematics{\}}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-newmml.tex b/Master/texmf-dist/tex/context/base/x-newmml.tex
new file mode 100644
index 00000000000..32b98525d53
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-newmml.tex
@@ -0,0 +1,2496 @@
+%D \module
+%D [ file=x-newmml,
+%D version=2005.06.10, % 1999.12.20,
+%D title=\CONTEXT\ XML Modules,
+%D subtitle=MathML Renderer,
+%D author=Hans Hagen,
+%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.
+
+%D Remark: from now on this is a module and no longer an xtag
+%D filter. In due time it will replace the older renderer (which
+%D we will keep around for sentimental reasons).
+
+% \defineXMLentity[x000AF]{\normalorfiller{x}\hrulefill}
+% CHECK FOR: \xmlrent
+% \enablemathpunctuation
+
+%D Then we start defining the rendering macros:
+
+\writestatus{loading}{Context XML Macros (MathML Renderer)}
+
+\startmodule [mathml]
+
+%D First we load the entities:
+
+\usemodule[newmme]
+
+% \setupmodule[a=c]
+% \setupmodule[a=c]
+
+\unprotect
+
+\def\MMLrm{\mr}
+
+\def\MMLseparator#1{{#1}} % nils space after separator
+
+%D First we define some general formula elements.
+
+\defineXMLenvironment [formula] [label=,sublabel=]
+ {\dostartXMLformula\placeformula}
+ {\dostopXMLformula}
+
+\defineXMLenvironment [subformula] [label=,sublabel=]
+ {\dostartXMLformula\placesubformula}
+ {\dostopXMLformula}
+
+\def\dostartXMLformula#1%
+ {\doifelsenothingXMLop{label}
+ {\startformula}
+ {\expanded{#1[\XMLop{label}]{\XMLop{sublabel}}}\startformula}}
+
+\def\dostopXMLformula
+ {\stopformula}
+
+%D Since I only had the draft of MathML 2 as example of
+%D rendering, there are probably a lot of omissions and
+%D misinterpretations. At least I learned some bits and
+%D pieces of math rendering.
+%D
+%D The main complications were not so much the math, but to
+%D find the most efficient way to handle elements without
+%D spacing beging messed up. The first implementation was
+%D aimed at getting reasonable output, this second
+%D implementation is already better in terms of handling
+%D nesting, and I will definitely need a third one that has
+%D more efficient and less ugly code.
+%D
+%D The \TEX\ part is not that complicated and once the
+%D preprocessor was okay, the rest way just a lot of keying
+%D and testing. It all comes down to gobbling, redefining,
+%D and not so much to parsing.
+%D
+%D The second implementation expanded the whole math sequence
+%D into an internal \TEX\ representation. This is a rather clean
+%D and fast process. Filtering and testing takes place by
+%D redefining teh internal representation macros.
+%D
+%D The third implementation may look a bit more messy in some
+%D respects. This is because in \TEX\ it's not that trivial to
+%D implement a tree handler. We use a stack for the \type {apply}
+%D element and other sequential content. Occasionally we need to
+%D peek into child elements which involves messy code. This
+%D implementation is closer to the normal \XML\ handling in
+%D \CONTEXT.
+
+%D We start with the parent elements and the option handler.
+
+\defineXMLdirective [mathml] \setupMMLappearance
+
+\defineXMLargument [math] \automathematics
+\defineXMLargument [imath] \inlinemathematics
+\defineXMLargument [dmath] \displaymathematics
+\defineXMLargument [m] \inlinemathematics
+
+%D In the styles, options can be set with:
+
+\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]}
+
+%D We will apply inner math to all bits and pieces made up by an
+%D \type {apply}.
+
+\def\MMLmathinner
+ {\ifinner \expandafter \firstofoneargument \else \expandafter \mathinner \fi}
+
+%D A few math related macros:
+
+\let\MMLctempresetlist\empty \def\setMMLcreset{\edef\MMLctempresetlist}
+
+\newcount\MMLapplydepth \def\MMLcreset{\MMLapplydepth\zerocount}
+
+% Stack handler
+
+\startXMLmapping[xmlstack:test]
+
+ \defineXMLnested
+ [apply]
+ {\startsavingXMLelements}
+ {\stopsavingXMLelements}
+
+% already defined
+%
+% \defineXMLnestedenvironmentsave
+% [xmlstack]
+% {}
+% {\pushXMLnameonstack}
+
+\stopXMLmapping
+
+%D Auxiliary MathML macros: (to be generalized)
+
+\def\doifelseMMCfunction
+ {\begingroup
+ \XMLdoifonstackelse{fn}
+ {\donetrue}
+ {\XMLdoifonstackelse{apply}
+ {\defXMLfirstnamedtext\ascii{apply}%
+ \startsavingXMLelements % best use a substack so that we donnot need to \edef
+ \ascii
+ \stopsavingXMLelements}
+ {}%
+ \XMLdoifonstackelse{fn}
+ {\donetrue}
+ {\defineXMLsave[ci][type=]%
+ \XMLfirstnamed{ci}%
+ \doifelse{\XMLpar{ci}{type}{}}{fn}
+ {\donetrue}
+ {\donefalse}}}%
+ \ifdone
+ \endgroup\expandafter\firstoftwoarguments
+ \else
+ \endgroup\expandafter\secondoftwoarguments
+ \fi}
+
+\def\doifelseMMCfunctioninapply#1#2% grouped
+ {\begingroup
+ \startXMLmapping[xmlstack:test]% take fast alternative
+ \getXMLstackdata{#1}%
+ \expanded{\doifinsetelse{\getXMLstackname\plusone}{#2}}
+ {\stopXMLmapping
+ \endgroup\firstoftwoarguments }
+ {\stopXMLmapping
+ \endgroup\secondoftwoarguments}}
+
+\def\dodoifelseMMCfunctioninapply#1#2%
+ {\startXMLmapping[xmlstack:test]% take fast alternative
+ \getXMLstackdata{#1}%
+ \expanded{\doifinsetelse{\getXMLstackname\plusone}{#2}}
+ {\stopXMLmapping
+ \firstoftwoarguments }
+ {\stopXMLmapping
+ \secondoftwoarguments}}
+
+%D Special features:
+
+\newtoks \@@postponedMMLactions \setfalse \somepostponedMMLactions
+
+\def\postponeMMLactions#1%
+ {\global\settrue\somepostponedMMLactions
+ \global\@@postponedMMLactions\expandafter{\the\@@postponedMMLactions#1}}
+
+\def\postponedMMLactions
+ {\global\setfalse\somepostponedMMLactions
+ \@EA\global\@EA\@@postponedMMLactions\@EA\emptytoks
+ \the\@@postponedMMLactions}
+
+%D A couple of lists:
+
+\def\MMLcmainresetlist
+ {times,divide,power,%
+ lt,gt,eq,leq,geq,%
+ in,inverse,%
+ fn,%
+ floor,ceiling,%
+ mean,%
+ selector,%
+ abs,int,limit,sum,product,%
+ outerproduct,innerproduct,scalarproduct}
+
+\def\MMLcfunctionlist
+ {sin,arcsin,sinh,arcsinh,%
+ cos,arccos,cosh,arccosh,%
+ tan,arctan,tanh,arctanh,%
+ cot,arccot,coth,arccoth,%
+ csc,arccsc,csch,arccsch,%
+ sec,arcsec,sech,arcsech,%
+ ln,exp,log,%
+ abs,int,limit,sum,product,%
+ fn} % ?
+
+\def\MMLcconstructlist
+ {diff,partialdiff,root} % apply goes wrong on 1/2 * (a_2 + b_3)
+
+% apply
+%
+%D We use inner and grouping (begin/end and no b/e) else we
+%D get problems with 1/2(1+2) and alike (todo: ask taco).
+%D
+%D The problem with apply is that we need to take care of
+%D several situations, like:
+%D
+%D \starttyping
+%D <apply> <.../> ...
+%D <apply> <fn> ...
+%D <apply> <apply> <ci> ...
+%D <apply> <apply> <fn> <ci> ...
+%D \stoptyping
+%D
+%D Because we translated version 2 of this renderer into
+%D version 3 the following definitions may be sub optimal or
+%D more complex than actually needed.
+
+\defineXMLnested % why nested? could be just an environment
+ [apply]
+ [open=,close=]
+ {\setups{mmc:apply:start}}
+ {\setups{mmc:apply:stop}}
+
+\startsetups mmc:apply:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:apply:stop
+ \stopsavingXMLelements
+ \MMLmathinner {
+ \expanded{\doifinsetelse{\getXMLstackname\plusone}{\MMLcmainresetlist,\MMLctempresetlist}}
+ \MMLcreset
+ \donothing
+ \ifcase\MMLapplydepth \else
+ \doifXMLparelse{apply}{open} \donothing{\getXMLarguments{apply}{open="("}}% slow
+ \doifXMLparelse{apply}{close}\donothing{\getXMLarguments{apply}{close=")"}}% slow
+ \fi
+ \doifXMLparelse{apply}{open}{\left\XMLpar{apply}{open}{}}\donothing
+ \advance\MMLapplydepth\plusone
+ \begingroup
+ \let\MMLctempresetlist\empty
+ \doifelse {\getXMLstackname\plusone} {apply} {
+ % <apply> <apply> ... </apply> <ci> .. </ci> </apply>
+ \doifelseMMCfunctioninapply \plusone {plus,minus} {
+ % yet incomplete and rather untested
+ % <apply> <apply> <minus/> <tan/> <cos/> </apply> <ci>x</ci> </apply>
+ } {
+ \MMLcreset
+ }
+ \getXMLstackdata\plusone
+ \ifconditional\somepostponedMMLactions
+ \postponedMMLactions
+ \else
+ \left(\MMLcreset\getXMLstackdata\plustwo\right)
+ \fi
+ } {
+ \doifelse {\getXMLstackname\plusone} {fn} {
+ % also postpone
+ \directsetup{mmc:fn:apply}
+ } {
+ \doifelse {\getXMLstackname\plusone} {csymbol} {
+ % also postpone
+ \directsetup{mmc:csymbol:apply}
+ } {
+ \doifelse {\getXMLstackname\plusone} {ci} {
+ \getXMLstackdata\plusone
+ \ifnum\XMLstacklevel>\plusone
+ \left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right)
+ \fi
+ } {
+ \getXMLstackdata\plusone
+ }
+ }
+ }
+ }
+ \endgroup
+ \advance\MMLapplydepth\minusone
+ \directsetup{apply:flush}
+ \doifXMLparelse{apply}{close}{\right\XMLpar{apply}{close}{}}\donothing
+ }
+ \endgroup
+\stopsetups
+
+\startsetups apply:flush
+\relax
+ \ifcase\MMLapplydepth
+ \ifconditional\somepostponedMMLactions
+ \postponedMMLactions
+ \ifx\MMLpowerelement\empty\else
+ ^{\MMLcreset\MMLpowerelement\empty}
+ \global\let\MMLpowerelement\empty
+ \fi
+ \fi
+ \fi
+\stopsetups
+
+% reln
+
+\defineXMLnestedenvironmentsave [reln]
+ {\writestatus{XML}{MathML element "reln" is obsolete}}
+ {}
+
+% fn
+
+\startsetups mmc:fn:plusminus
+ \ifnum\XMLstacklevel>\plustwo
+ \MMLcreset
+ \left(\expandafter\flushXMLstackwith\expandafter\plustwo\expandafter{\XMLfnoperator}\right)
+ \else
+ \getXMLstackdata\plustwo
+ \fi
+\stopsetups
+
+\startsetups mmc:fn:minusplus
+ \directsetup{mmc:fn:plusminus}
+\stopsetups
+
+\defineXMLnested
+ [fn]
+ {\directsetup{mmc:fn:start}}
+ {\directsetup{mmc:fn:stop}}
+
+\startsetups mmc:fn:apply
+ \begingroup
+ \startsavingXMLelements
+ \rawXMLstacktext\plusone % still on stack, no check, just fn content
+ \stopsavingXMLelements
+ \doifelse {\getXMLstackname\plusone} {ci} {
+ \flattenXMLcontent{\getXMLstackdata\plusone}
+ \doifsetupselse{mmc:fn:\flattenedXMLcontent} {
+ \global\defXMLstackdata\XMLfnoperator\plusone
+ \expanded{\endgroup\noexpand\directsetup{mmc:fn:\flattenedXMLcontent}}
+ } {
+ \endgroup
+ \MMLcreset
+ \getXMLstackdata\plusone
+ \ifnum\XMLstacklevel>\plusone
+ \getXMLentity{NegThinSpace}
+ \left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right)
+ \fi
+ }
+ } {
+ \endgroup
+ \MMLcreset
+ \getXMLstackdata\plusone
+ }
+\stopsetups
+
+\startsetups mmc:fn:start
+ \ifnum\XMLstacklevel>\plustwo
+ \def\MMCfnleft {\left(}
+ \def\MMCfnright{\right)}
+ \else
+ \let\MMCfnleft \relax
+ \let\MMCfnright\relax
+ \fi
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:fn:stop
+ \stopsavingXMLelements
+ \doifelse {\getXMLstackname\plusone} {ci} {
+ \flattenXMLcontent{\getXMLstackdata\plusone}
+ \doifsetupselse{mmc:fn:\flattenedXMLcontent} {
+ \global\defXMLstackdata\XMLfnoperator\plusone
+ \directsetup{mmc:fn:\flattenedXMLcontent}
+ } {
+ \MMLcreset
+ \getXMLstackdata\plusone
+ }
+ \endgroup
+ } {
+ \doifelse {\getXMLstackname\plusone} {apply} {
+ \doifelseMMCfunctioninapply \plusone {plus,minus} {
+ \left(
+ \getXMLstackdata\plusone
+ \right)
+ } {
+ \getXMLstackdata\plusone
+ }
+ \endgroup
+ \ifnum\XMLstacklevel>\plusone
+ \left(
+ \getXMLstackdata\plustwo
+ \right)
+ \fi
+ } {
+ \MMLcreset
+ \getXMLentity{NegThinSpace}
+ \MMCfnleft
+ \ifnum\XMLstacklevel=\plustwo\MMLccomma\fi
+ \flushXMLstackwith\plustwo\MMLccomma
+ \MMCfnright
+ \endgroup
+ }
+ }
+\stopsetups
+
+% c*
+
+\defineXMLargument [ci] [type=] {\XMLval{mmc:ci}{\XMLop{type}} {\firstofoneargument}}
+\defineXMLargument [cn] [type=,base=] {\XMLval{mmc:cn}{\XMLop{type}} {\firstofoneargument}}
+\defineXMLargument [csymbol] [encoding=text] {\XMLval{mmc:cs}{\XMLop{encoding}}{\firstofoneargument}}
+
+%D The next definition provide a kind of plug-in mechanism (see
+%D the open math extension module).
+
+\defineXMLsingular
+ [csymbol]
+ [encoding=text,
+ definitionURL=]
+ {}
+
+\startsetups mmc:csymbol:apply
+ \begingroup
+ \startsavingXMLelements
+ \rawXMLstacktext\plusone % still on stack, no check, just attr test
+ \stopsavingXMLelements
+ % http://www.publisherswhodontcareaboutcosts.com/SomeName
+ \doifsetupselse{mmc:csymbol:\XMLpar{csymbol}{definitionURL}{}} {
+ \expanded{\endgroup\noexpand\directsetup{mmc:csymbol:\XMLpar{csymbol}{definitionURL}{}}}
+ } {
+ % SomeName (fallback)
+ \splitfilename{\XMLpar{csymbol}{definitionURL}{}}
+ \doifsetupselse{mmc:csymbol:\splitoffbase} {
+ \expanded{\endgroup\noexpand\directsetup{mmc:csymbol:\splitoffbase}}
+ } {
+ \endgroup
+ \XMLval{mmc:cs}{\XMLop{encoding}}{\firstofoneargument}
+ }
+ }
+\stopsetups
+
+%D Alternative b will convert periods into comma's:
+%D
+%D \startbuffer
+%D \startXMLdata
+%D <imath><apply><cn>1.23</cn></apply></imath>
+%D <dmath><apply><cn>1.23</cn></apply></dmath>
+%D \stopXMLdata
+%D
+%D \setupMMLappearance[cn] [alternative=b]
+%D
+%D \startXMLdata
+%D <imath><apply><cn>1.23</cn></apply></imath>
+%D <dmath><apply><cn>1.23</cn></apply></dmath>
+%D \stopXMLdata
+%D \stopbuffer
+%D
+%D \start \typebuffer \getbuffer \stop
+
+\setupMMLappearance[cn] [\c!alternative=\v!a]
+
+\defineXMLargument[cn][type=,base=]{\MMLdocn}
+
+\def\MMLdocn#1%
+ {\begingroup
+ \doif\@@MMLcnalternative\v!b{\redefinemathcharacter [.][ord][mi]["3B]\relax}%
+ \XMLval{mmc:cn}{\XMLop{type}}{\firstofoneargument}{#1}%
+ \endgroup}
+
+\defineXMLsingular [sep] {\MMLcsep} \def\MMLcsep{\,}
+
+\setupMMLappearance[polar] [\c!alternative=\v!a] % a|b|c
+\setupMMLappearance[float] [\c!symbol=\v!no] % \v!yes|dot
+\setupMMLappearance[enotation][\c!symbol=\v!no] % \v!yes|dot
+\setupMMLappearance[base] [\c!symbol=\v!numbers] % digits|characters|text|no
+
+\mapXMLvalue {mmc:ci} {set} {\MMLcCIset}
+\mapXMLvalue {mmc:ci} {vector} {\MMLcCIvector}
+\mapXMLvalue {mmc:ci} {matrix} {\MMLcCImatrix}
+\mapXMLvalue {mmc:ci} {function} {\MMLcCIfunction}
+\mapXMLvalue {mmc:ci} {complex-cartesian} {\MMLccartesian}
+\mapXMLvalue {mmc:ci} {complex} {\MMLccartesian}
+\mapXMLvalue {mmc:ci} {complex-polar} {\MMLcpolar}
+\mapXMLvalue {mmc:ci} {polar} {\MMLcpolar}
+\mapXMLvalue {mmc:ci} {fn} {\MMLcCIfunction}
+
+\mapXMLvalue {mmc:cn} {integer} {\MMLcCNinteger}
+\mapXMLvalue {mmc:cn} {logical} {\MMLcCNlogical}
+\mapXMLvalue {mmc:cn} {rational} {\MMLcCNrational}
+\mapXMLvalue {mmc:cn} {complex-cartesian} {\MMLccartesian}
+\mapXMLvalue {mmc:cn} {complex} {\MMLccartesian}
+\mapXMLvalue {mmc:cn} {complex-polar} {\MMLcpolar}
+\mapXMLvalue {mmc:cn} {polar} {\MMLcpolar}
+\mapXMLvalue {mmc:cn} {e-notation} {\MMLcenotation} % new
+\mapXMLvalue {mmc:cn} {float} {\MMLcfloat} % obsolete
+\mapXMLvalue {mmc:cn} {real} {\MMLcfloat}
+
+\mapXMLvalue {mmc:cs} {text} {\MMLcCStext}
+
+\def\MMLcpolar#1%
+ {\doifdefinedelse{MMLcdopolar\@@MMLpolaralternative}
+ {\getvalue{MMLcdopolar\@@MMLpolaralternative}{#1}}
+ {#1}}
+
+\def\MMLcdopolara#1%
+ {\def\MMLcsep{\MMLseparator,}\getXMLentity{polar}\left(#1\right)}
+
+\def\MMLcdopolarb#1%
+ {\def\MMLcsep##1\empty
+ {\getXMLentity{exponentiale}^{##1\mskip2mu\getXMLentity{imaginaryi}}}
+ #1\empty}
+
+\def\MMLcdopolarc#1%
+ {\def\MMLcsep##1\empty
+ {\getXMLentity{exp}\left(##1\mskip2mu\getXMLentity{imaginaryi}\right)}%
+ #1\empty}
+
+\def\MMLccartesian#1%
+ {\def\MMLcsep{+}#1\getXMLentity{imaginaryi}}
+
+% float will be obsolete, an is replace by e-notation
+
+\def\MMLcfloat#1%
+ {\doifelse\@@MMLfloatsymbol\v!no
+% {{\MMLrm#1}}% make sure that e shows up ok
+ {\mfunction{#1}}% make sure that e shows up ok
+ {% we should ignore \entities !
+ \beforesplitstring#1\at e\to\first
+ \aftersplitstring #1\at e\to\last
+ \ifx\first\empty #1\else
+ \ifx\last \empty #1\else
+ \first
+ \doifelse\@@MMLfloatsymbol{dot}\cdot\times
+ 10^{\last}%
+ \fi\fi}}
+
+% we now have:
+
+\def\MMLcenotation#1%
+ {\doifelse\@@MMLenotationsymbol\v!no
+% {\def\MMLcsep {\unskip{\MMLrm e}\ignorespaces}}
+ {\def\MMLcsep {\unskip\mfunction{e}\ignorespaces}}
+ {\def\MMLcsep##1\empty{\doifelse\@@MMLenotationsymbol{dot}\cdot\times10^{##1}}}%
+ #1\empty}
+
+\def\MMLcCIset#1%
+ {{\bbd#1}}
+
+\def\widevec#1%
+ {\vbox{\m@th\ialign{##\crcr
+ \rightarrowfill\crcr\noalign{\nointerlineskip}%
+ $\hfil\displaystyle{#1}\hfil$\crcr}}}
+
+\def\MMLcCIvector#1%
+ {\widevec{#1}}
+
+\def\MMLcCImatrix#1%
+ {{\bi#1}}
+
+\def\MMLcCIfunction#1%
+ {#1\getXMLentity{NegThinSpace}}
+
+\def\MMLcCNinteger#1%
+ {\doifXMLparelse{cn}{base}
+ {\def\MMLcCNbase{\XMLpar{cn}{base}{}}%
+ \doifelse\@@MMLbasesymbol\v!no
+ {\MMLcCNbasedata{#1}}
+% {\MMLcCNbasedata{#1}_{\hbox{$\MMLrm\scriptscriptstyle
+ {\MMLcCNbasedata{#1}_{\mfunction{%
+ \processaction
+ [\@@MMLbasesymbol]
+ [\v!characters=>\MMLcCNbasestring BODH,
+ \v!text=>\MMLcCNbasestring{BIN}{OCT}{DEC}{HEX},
+% \s!unknown=>\MMLcCNbase]$}}}}
+ \s!unknown=>\MMLcCNbase]}}}}
+ {#1}}
+
+\def\MMLcCNbasedata#1%
+% {\ifnum\MMLcCNbase>10{\MMLrm#1}\else#1\fi}
+ {\ifnum\MMLcCNbase>10\mfunction{#1}\else#1\fi}
+
+\def\MMLcCNbasestring#1#2#3#4%
+ {\ifnum\MMLcCNbase= 2 #1\else
+ \ifnum\MMLcCNbase= 8 #2\else
+ \ifnum\MMLcCNbase=10 #3\else
+ \ifnum\MMLcCNbase=16 #4\else
+ \MMLcCNbase \fi\fi\fi\fi}
+
+\def\MMLcCNlogical#1%
+% {{\MMLrm#1}}
+ {\mfunction{#1}}
+
+\bgroup \catcode`\<=\active
+
+ % quick and dirty, best track the stack (todo)
+
+ \gdef\MMLcCNrational#1%
+ {\ConvertConstantAfter\doifinstringelse{sep}{#1}
+ {\doMMLcCNrational#1\empty}
+ {#1}}
+
+ \gdef\doMMLcCNrational#1<sep#2>#3\empty
+ {\hbox{$\frac{#1}{#3}$}}
+
+\egroup
+
+\def\MMLcCStext#1%
+% {{\MMLrm#1}}
+ {\mfunction{#1}}
+
+% interval
+
+\defineXMLnested [interval]
+ [closure=closed]
+ {\directsetup{mmc:interval:start}}
+ {\directsetup{mmc:interval:stop}}
+
+\startsetups mmc:interval:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:interval:stop
+ \stopsavingXMLelements
+ \XMLval{mmc:int}{\XMLpar{interval}{closure}{closed}}{error}
+ \endgroup
+\stopsetups
+
+\setupMMLappearance[interval][\c!alternative=\v!a,\c!separator={,}]
+
+\mapXMLvalue {mmc:int} {closed}
+ {\left[\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right]}
+
+\mapXMLvalue {mmc:int} {open-closed}
+ {\doifelse\@@MMLintervalalternative\v!b
+ {\left<\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right]}
+ {\left(\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right]}}
+
+\mapXMLvalue {mmc:int} {closed-open}
+ {\doifelse\@@MMLintervalalternative\v!b
+ {\left[\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right>}
+ {\left[\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right)}}
+
+\mapXMLvalue {mmc:int} {open}
+ {\doifelse\@@MMLintervalalternative\v!b
+ {\left<\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right>}
+ {\left(\getXMLstackdata\plusone\MMLseparator\@@MMLintervalseparator\getXMLstackdata\plustwo\right)}}
+
+% inverse
+
+\defineXMLcommand [inverse] {\directsetup{mmc:inverse}}
+
+\startsetups mmc:inverse
+ \ifnum\XMLstacklevel>\plustwo
+ \getXMLentity{\getXMLstackname\plustwo}^{-1}
+ \left[\getXMLstackdata\plusthree\right]
+ \else
+ \xdef\MMLpowerelement{-1}
+ \expanded{\postponeMMLactions{\rawXMLstackdata\plustwo}}
+ \eraseXMLdataonstack\plustwo
+ \fi
+\stopsetups
+
+% condition
+
+\defineXMLnested
+ [condition]
+ {\directsetup{mmc:condition:start}}
+ {\directsetup{mmc:condition:stop}}
+
+\startsetups mmc:condition:start
+% \XMLdoifonstackelse{bvar} {
+% \XMLfirstnamed{bvar}\mid
+% } { }
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:condition:stop
+ \stopsavingXMLelements
+ \flushXMLstackfrom\plusone
+ \endgroup
+\stopsetups
+
+% declare
+
+\setupMMLappearance[declare][\c!state=\v!start]
+
+\defineXMLnested
+ [declare]
+ {\directsetup{mmc:declare:start}}
+ {\directsetup{mmc:declare:stop}}
+
+\startsetups mmc:declare:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:declare:stop
+ \stopsavingXMLelements
+ \doif\@@MMLdeclarestate\v!start {
+ \getXMLentity{declare}\getXMLstackdata\plusone
+ \ifnum\XMLstacklevel>\plusone
+ \getXMLentity{ThickSpace}
+ \getXMLentity{as}
+ \getXMLentity{ThickSpace}
+ \fi
+ \getXMLstackdata\plustwo
+ }
+ \endgroup
+\stopsetups
+
+% lambda
+
+\setupMMLappearance[lambda][\c!alternative=b]
+
+\defineXMLnested
+ [lambda]
+ {\directsetup{mmc:lambda:start}}
+ {\directsetup{mmc:lambda:stop}}
+
+\startsetups mmc:lambda:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:lambda:stop
+ \stopsavingXMLelements
+ \doifelse\@@MMLlambdaalternative\v!a {
+ \getXMLentity{lambda}(\flushXMLstackwith\plusone{\MMLseparator,})
+ } {
+ \countXMLnamedstack{bvar}
+ \ifnum\scratchcounter>\plusone
+ \left(\flushXMLnamedstackwith\plusone{bvar}{\MMLseparator,}\right)
+ \else
+ \XMLfirstnamed{bvar}
+ \fi
+ \getXMLentity{mapsto}
+ \XMLfirstnamed{apply,reln,ci,cn}
+ }
+ \endgroup
+\stopsetups
+
+% compose
+
+\defineXMLcommand [compose] {\directsetup{mmc:compose}}
+
+\startsetups mmc:compose
+ \begingroup
+ \MMLcreset
+ \let\MMLcCIfunction\firstofoneargument % brrr
+ \doifelseMMCfunction {
+ \left(\flushXMLstackwith\plustwo\circ\right)
+ } {
+ \flushXMLstackwith\plustwo\circ
+ }
+ \endgroup
+\stopsetups
+
+\defineXMLcommand [image] {\directsetup{mmc:image}}
+
+\startsetups mmc:image
+ \getXMLentity{image}
+ \left(
+ \begingroup
+ \startlocalsetups [mmc:function]
+ \getXMLentity\currentXMLelement
+ \stoplocalsetups
+ \getXMLstackdata\plustwo
+ \endgroup
+ \right)
+\stopsetups
+
+\setupMMLappearance[piece][\c!separator=]
+
+\def\MMLcPIECEseparator{\doif\@@MMLpieceseparator\v!yes,}
+
+\defineXMLargument[piecewise] {\cases}
+
+\defineXMLnested
+ [piece]
+ {\directsetup{mmc:piece:start}}
+ {\directsetup{mmc:piece:stop}}
+
+\defineXMLenvironmentsave
+ [otherwise]
+ {}
+ {\directsetup{mmc:otherwise}}
+
+\startsetups mmc:piece:start
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:piece:stop
+ \stopsavingXMLelements
+ \edef\ascii{\getXMLstackdata\plusone}
+ \@EA\XMLRtoks\@EA{\ascii\MMLcPIECEseparator\@col@amp@}
+ \edef\ascii{\getXMLstackdata\plustwo}
+ \@EA\appendtoks\@EA\mathematics\@EA{\ascii}\to\XMLRtoks
+ \the\XMLRtoks\crcr
+\stopsetups
+
+\startsetups mmc:otherwise
+ \XMLflush{otherwise}\MMLcPIECEseparator\@col@amp@\mathematics{\getXMLentity{otherwise}}\crcr
+\stopsetups
+
+\defineXMLcommand [quotient] {\directsetup{mmc:quotient}}
+
+\startsetups mmc:quotient
+ \lfloor\getXMLstackdata\plustwo/\getXMLstackdata\plusthree\rfloor
+\stopsetups
+
+\defineXMLcommand [factorial] {\getXMLstackdata\plustwo !}
+
+\defineXMLcommand [divide] {\directsetup{mmc:divide}}
+
+\setupMMLappearance [divide] [\c!level=\!!maxcard]
+
+\startsetups mmc:divide
+ \increment\MMLcDIVIDElevel
+ \ifnum\MMLcDIVIDElevel>\@@MMLdividelevel\space
+ \getXMLstackdata\plustwo/\getXMLstackdata\plusthree
+ \else
+ \MMLcreset
+ \frac{\MMLcreset\getXMLstackdata\plustwo}{\MMLcreset\getXMLstackdata\plusthree}%
+ \fi
+ \decrement\MMLcDIVIDElevel
+\stopsetups
+
+% min max
+
+\defineXMLcommand [min] {\min\directsetup{mmc:minmax}}
+\defineXMLcommand [max] {\max\directsetup{mmc:minmax}}
+
+\startsetups mmc:minmax
+ \doifelse{\getXMLstackdata\plustwo}{bvar} {
+ {}_{\getXMLstackdata\plustwo}
+ \left\{\flushXMLstackwith\plusthree{\MMLseparator,}\right\}
+ } {
+ \left\{\flushXMLstackwith\plustwo {\MMLseparator,}\right\}
+ }
+\stopsetups
+
+% minus plus
+
+\defineXMLcommand [minus] {\directsetup{mmc:minus}}
+\defineXMLcommand [plus] {\directsetup{mmc:plus}}
+
+\setupMMLappearance [sign] [\c!reduction=\v!yes]
+
+\startsetups mmc:minus
+ \doif \@@MMLsignreduction \v!yes {
+ \setMMLcreset{fn,\MMLcfunctionlist}
+ }
+ \ifcase\XMLstacklevel
+ \or
+ % self
+ \or
+ -\getXMLstackdata\plustwo
+ \else
+ \flushXMLstackwith\plustwo-
+ \fi
+\stopsetups
+
+\startsetups mmc:plus
+ \doifelse \@@MMLsignreduction \v!yes {
+ \setMMLcreset{fn,plus,minus,\MMLcfunctionlist,\MMLcconstructlist}% was plus/, minus/
+ \doifelse{\getXMLstackname\plustwo} {apply} {
+ % branch needed, else (a-b) + (c-d) goes wrong
+ % reset check in case of (-x) + 37
+ \begingroup
+ \dodoifelseMMCfunctioninapply \plustwo {minus} {
+ \ifnum\XMLstacklevel>\plustwo
+ \endgroup
+ \else
+ \endgroup
+ \MMLcreset
+ \fi
+ } {
+ \endgroup
+ }
+ \flushXMLstackwith\plustwo +
+ } {
+ \flushXMLstackwith\plustwo {
+ \doifelse {\getXMLstackname\recurselevel} {apply} {
+ \begingroup
+ \dodoifelseMMCfunctioninapply \recurselevel {minus} {
+ \ifnum\XMLstacklevel>\plustwo +\fi
+ } {
+ +
+ }
+ \endgroup
+ \MMLcreset
+ } {
+ +
+ }
+ }
+ }
+ } {
+ \ifcase\XMLstacklevel
+ \or
+ % self
+ \or
+ +\getXMLstackdata\plustwo
+ \else
+ \flushXMLstackwith\plustwo+
+ \fi
+ }
+\stopsetups
+
+% power
+
+\defineXMLcommand [power] {\directsetup{mmc:power}}
+
+\setupMMLappearance[power][\c!reduction=\v!yes]
+
+\let\MMLpowerelement\empty
+
+\startsetups mmc:power
+ \doifelse {\getXMLstackname\plustwo} {apply} {
+ \doifelse\@@MMLpowerreduction\v!yes {
+ \doifelseMMCfunctioninapply \plustwo \MMLcfunctionlist {
+ \xdef\MMLpowerelement{\getXMLstackdata\plusthree}% postpone
+ \MMLcreset\getXMLstackdata\plustwo
+ } {
+ \left(\MMLcreset\getXMLstackdata\plustwo\right)^{\MMLcreset\getXMLstackdata\plusthree}
+ }
+ } {
+ \left(\MMLcreset\getXMLstackdata\plustwo\right)^{\MMLcreset\getXMLstackdata\plusthree}
+ }
+ } {
+ \getXMLstackdata\plustwo^{\MMLcreset\getXMLstackdata\plusthree}
+ }
+\stopsetups
+
+% rem
+
+\defineXMLcommand [rem] {\flushXMLstackwith\plustwo{\getXMLentity{mod}}}
+
+\defineXMLcommand [times] {\directsetup{mmc:times}}
+
+\setupMMLappearance [times] [\c!symbol=\v!no,\c!auto=\v!yes] % new, auto catches cn cn cn
+
+\startsetups mmc:times
+ \setMMLcreset{\MMLcfunctionlist,\MMLcconstructlist}%
+ \doifelse\@@MMLtimesauto\v!no {
+ \let\@@MMLtimes@@symbol\@@MMLtimessymbol
+ } {
+ \countXMLnamedstack {cn}
+ \ifnum\scratchcounter>\plusone
+ \let\@@MMLtimes@@symbol\v!yes
+ \else
+ \let\@@MMLtimes@@symbol\@@MMLtimessymbol
+ \fi
+ }
+ \doifelse\@@MMLtimes@@symbol\v!yes {
+ \flushXMLstackwith\plustwo\times
+ } {
+ \doifelse\@@MMLtimes@@symbol{dot} {
+ \flushXMLstackwith\plustwo\cdot
+ } {
+ \doifelse\@@MMLtimes@@symbol{times} {
+ \flushXMLstackwith\plustwo\times
+ } {
+ \flushXMLstackwith\plustwo\empty
+ }
+ }
+ }
+\stopsetups
+
+\defineXMLcommand [root] {\directsetup{mmc:root}}
+
+\setupMMLappearance[root][\c!symbol=\v!yes]
+
+\startsetups mmc:root
+ \XMLdoifonstackelse {degree} {
+ \root
+ \doifnot\@@MMLrootsymbol\v!no{\MMLcreset\XMLfirstnamed{degree}}
+ \of
+ } {
+ \sqrt
+ }
+ {\MMLcreset\XMLfirstnamed{apply,reln,ci,cn}}
+\stopsetups
+
+% gcd
+
+\defineXMLcommand [gcd] {\gcd\left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right)}
+
+% and or xor implies
+
+\defineXMLcommand [and] {\flushXMLstackwith\plustwo{\getXMLentity{and}}}
+\defineXMLcommand [or] {\flushXMLstackwith\plustwo{\getXMLentity{or}}}
+\defineXMLcommand [xor] {\flushXMLstackwith\plustwo{\getXMLentity{xor}}}
+\defineXMLcommand [implies] {\flushXMLstackwith\plustwo{\getXMLentity{implies}}}
+
+% not
+
+\defineXMLcommand [not] {\getXMLentity{not}\getXMLstackdata\plustwo}
+
+% forall exists
+
+\defineXMLcommand [forall] {\directsetup{mmc:forall}}
+\defineXMLcommand [exists] {\directsetup{mmc:exists}}
+
+%D We need to shift left below rotated A.
+
+\startsetups mmc:forall
+ \getXMLentity{forall}
+ \getXMLentity{NegThinSpace}
+ \directsetup{mmc:forall-exists}
+\stopsetups
+
+\startsetups mmc:exists
+ \getXMLentity{exists}
+ \directsetup{mmc:forall-exists}
+\stopsetups
+
+\startsetups mmc:forall-exists
+ _{\flushXMLnamedstackwith\plustwo{bvar}{\MMLseparator,}}
+ \XMLdoifonstackelse {condition} {
+ \getXMLentity{ThickSpace}
+ \begingroup
+ \XMLfirstnamed{condition}
+ \endgroup
+ \countXMLnamedstack {apply,reln,ci,cn}
+ \ifcase\scratchcounter
+ \or
+ % == snelle volgende
+ \left\vert \MMLcreset
+ \getXMLentity{MediumSpace}
+ \flushXMLnamedstackwith\plustwo{apply,reln,ci,cn}\empty
+ \right.
+ \else
+ % special case
+ % \defineXMLignore[condition]
+ \collectXMLnamedstack{apply,reln,ci,cn}{\hfill\crcr}
+ \left\vert
+ \matrix{\the\XMLRtoks}
+ \right.
+ \fi
+ } {
+ :\XMLfirstnamed{apply,reln,ci,cn}
+ }
+\stopsetups
+
+\defineXMLcommand [abs] {\left\vert \MMLcreset \flushXMLstackfrom\plustwo \right\vert}
+\defineXMLcommand [conjugate] {{\overline{\MMLcreset \flushXMLstackfrom\plustwo}}} % watch extra {}
+\defineXMLcommand [arg] {\getXMLentity{arg} \left(\MMLcreset\flushXMLstackfrom\plustwo\right)}
+\defineXMLcommand [real] {\getXMLentity{real} \left(\MMLcreset\flushXMLstackfrom\plustwo\right)}
+\defineXMLcommand [imaginary] {\getXMLentity{imaginary}\left(\MMLcreset\flushXMLstackfrom\plustwo\right)}
+\defineXMLcommand [lcm] {\getXMLentity{lcm} \left(\flushXMLstackwith\plustwo{\MMLseparator,}\right)}
+\defineXMLcommand [floor] {\getXMLentity{lfloor} \flushXMLstackfrom\plustwo \getXMLentity{rfloor}}
+\defineXMLcommand [ceiling] {\getXMLentity{lceiling} \flushXMLstackfrom\plustwo \getXMLentity{rceiling}}
+
+% relations
+
+\defineXMLcommand [eq] {\MMLcrelation=}
+\defineXMLcommand [neq] {\MMLcrelation\neq}
+\defineXMLcommand [gt] {\MMLcrelation>}
+\defineXMLcommand [lt] {\MMLcrelation<}
+\defineXMLcommand [geq] {\MMLcrelation\geq}
+\defineXMLcommand [leq] {\MMLcrelation\leq}
+\defineXMLcommand [equivalent] {\MMLcrelation\equiv}
+\defineXMLcommand [approx] {\MMLcrelation\approx}
+\defineXMLcommand [factorof] {\MMLcrelation\mid}
+
+\setupMMLappearance[relation][\c!align=\v!no]
+
+\def\MMLcrelation
+ {\MMLcreset
+ \processaction
+ [\@@MMLrelationalign]
+ [\v!last=>\let\next\lastMMLcrelation ,
+ \v!first=>\let\next\firstMMLcrelation,
+ \v!yes=>\let\next\leftMMLcrelation ,
+ \v!left=>\let\next\leftMMLcrelation ,
+ \v!right=>\let\next\rightMMLcrelation,
+ \s!default=>\let\next\noMMLcrelation ,
+ \s!unknown=>\let\next\noMMLcrelation ]
+ \next}
+
+\def\noMMLcrelation#1%
+ {\flushXMLstackwith\plustwo{#1}}
+
+\def\lastMMLcrelation#1%
+ {\XMLRtoks\emptytoks
+ \dostepwiserecurse\plustwo\XMLstacklevel\plusone
+ {\appendetoks\noexpand\getXMLstackdata{\recurselevel}\to\XMLRtoks
+ \ifnum\recurselevel<\numexpr\XMLstacklevel-1\relax
+ \appendtoks\@col@amp@#1\crcr\to\XMLRtoks
+ \else\ifnum\recurselevel=\numexpr\XMLstacklevel-1\relax
+ \appendtoks\@col@amp@#1\to\XMLRtoks
+ \fi\fi}%
+ \eqalign{\the\XMLRtoks\crcr}}
+
+\def\firstMMLcrelation#1%
+ {\collectXMLstackrows\plusthree{\crcr\@col@amp@#1}%
+ \eqalign{\getXMLstackdata\plustwo\@col@amp@#1\the\XMLRtoks}}
+
+\def\leftMMLcrelation#1%
+ {\collectXMLstackrows\plustwo{\@col@amp@#1\crcr}%
+ \eqalign{\the\XMLRtoks}}
+
+\def\rightMMLcrelation#1%
+ {\collectXMLstackrows\plustwo{\crcr#1{}\@col@amp@}%
+ \eqalign{\@col@amp@\the\XMLRtoks\crcr}}
+
+\defineXMLcommand [becomes] {\MMLcrelation{:=}}
+
+\addtocommalist{becomes/}\MMLcmainresetlist
+
+% calculus and vector calculus
+
+\setupMMLappearance[int][\c!location=\v!top]
+
+\def\doMMLlimits#1%
+ {\doifelsevalue{@@MML#1\c!location}\v!top\limits\nolimits}
+
+\defineXMLnested
+ [domainofapplication]
+ {\directsetup{mmc:domainofapplication:start}}
+ {\directsetup{mmc:domainofapplication:stop}}
+
+\startsetups mmc:domainofapplication:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:domainofapplication:stop
+ \stopsavingXMLelements
+% \MMLcreset
+ \flushXMLstackfrom\plusone
+ \endgroup
+\stopsetups
+
+\defineXMLcommand [int] {\directsetup{mmc:int}}
+
+\startsetups mmc:int
+ \MMLcreset
+ \XMLdoifonstackelse{domainofapplication} {
+ \int\doMMLlimits{int}_{\XMLfirstnamed{domainofapplication}}\relax
+ } {
+ \XMLdoifonstackelse{condition} {
+ \int\doMMLlimits{int}_{\XMLfirstnamed{condition}}\relax
+ } {
+ \XMLdoifonstackelse{lowlimit} {
+ \int\doMMLlimits{int}
+ _{\XMLfirstnamed{lowlimit}}
+ ^{\XMLfirstnamed{uplimit}}
+ } {
+ % funny, why do we have lowlimit/uplimit then
+ \XMLdoifonstackelse{interval} {
+ \begingroup
+ \startlocalsetups mmc:interval:start %
+ \begingroup
+ \startsavingXMLelements
+ \stoplocalsetups
+ \startlocalsetups mmc:interval:stop %
+ \stopsavingXMLelements
+ \xdef\MMLfirstelement {\getXMLstackdata\plusone}
+ \xdef\MMLsecondelement{\getXMLstackdata\plustwo}
+ \endgroup
+ \stoplocalsetups
+ \globallet\MMLfirstelement \empty
+ \globallet\MMLsecondelement\empty
+ \XMLfirstnamed{interval}
+ \endgroup
+ \int\doMMLlimits{int}
+ _{\MMLfirstelement}
+ ^{\MMLsecondelement}
+ } {
+ \int
+ }
+ }
+ }
+ }
+ \MMLcreset
+ \XMLdoifonstackelse{apply} {
+ \doifelseMMCfunction {
+ \XMLfirstnamed{apply}
+ } {
+ % if there are too many () now, we need to be more clever
+ \left(\XMLfirstnamed{apply}\right)
+ }
+ } {
+ \XMLfirstnamed{ci}
+ }
+ \XMLdoifonstackelse{bvar} {
+ \,% \getXMLentity{ThinSpace}%
+% {\MMLrm\getXMLentity{mathematicald}}
+ \mfunction{\getXMLentity{mathematicald}}
+ \XMLfirstnamed{bvar}
+ } {
+ % nothing
+ }
+\stopsetups
+
+\setupMMLappearance[diff][\c!location=\v!top,\c!alternative=\v!a]
+
+\defineXMLcommand [diff] {\directsetup{mmc:diff}}
+\defineXMLcommand [partialdiff] {\directsetup{mmc:partialdiff}}
+
+% \setupMMLappearance[diff][alternative=b]
+%
+% \startXMLdata
+% <math><apply><apply><diff/><bvar><ci>x</ci></bvar><ci>f</ci></apply><ci>a</ci></apply></math>
+% <math><apply><apply><diff/><bvar><ci>x</ci></bvar><degree>2</degree><ci>f</ci></apply><ci>a</ci></apply></math>
+% \stopXMLdata
+
+\startsetups mmc:diff
+ \MMLcreset
+ \doifelse\@@MMLdiffalternative\v!a {
+ \XMLdoifonstackelse{bvar} {
+ \frac {
+ \XMLdoifonstackelse{degree} {
+ \collectXMLnamedstack{degree}\empty
+ } {
+ \collectXMLnamedstacknamed{bvar}{degree}+
+ }
+ \mfunction{\getXMLentity{mathematicald}}
+ ^{\the\XMLRtoks}
+ \doif\@@MMLdifflocation\v!top {
+ \XMLdoifonstackelse{ci} {
+ \XMLfirstnamed{ci}
+ } {
+ \MMLcreset\XMLfirstnamed{apply}
+ }
+ }
+ } {
+ \mfunction{\getXMLentity{mathematicald}}
+ \begingroup
+ \defineXMLsave[degree]
+ \XMLfirstnamed{bvar}
+ \doifXMLdata{degree} {
+ ^{\XMLflush{degree}}
+ }
+ \endgroup
+ }
+ \doifnot\@@MMLdifflocation\v!top {
+ \left(\MMLcreset\XMLfirstnamed{apply,ci}\right)
+ }
+ } {
+ \flushXMLstackfrom\plustwo^\prime
+ }
+ } {
+ \MMLcreset
+ \XMLfirstnamed{apply,ci}
+ % there can be problems with nested diff's: ^^{} error
+ % so we add an empty group here
+ {}^
+ {
+ \XMLdoifonstackelse{degree} {
+ \defXMLfirstnamedtext\ascii{degree}
+ \dorecurse\ascii\prime
+ } {
+ \prime
+ }
+ }
+ }
+\stopsetups
+
+\startsetups mmc:partialdiff
+ \XMLdoifonstackelse{list} {
+ \getXMLentity{capitaldifferentiald}_{
+ \begingroup
+ \setfalse\MMLlistdelimiters
+ \XMLallnamed{list}
+ \endgroup
+ }
+ \XMLfirstnamed{apply,reln,ci,cn}
+ } {
+ \XMLdoifonstackelse{bvar} {
+ \frac {
+ \XMLdoifonstackelse{degree} {
+ \collectXMLnamedstack{degree}\empty
+ } {
+ \collectXMLnamedstacknamed{bvar}{degree}+
+ }
+ \getXMLentity{differentiald}^{\the\XMLRtoks}
+ % \let\MMLcDEGREE\gobbletwoarguments
+ % \doifelseMMCfunction\MMLcreset\donothing
+ \MMLcreset
+ \XMLfirstnamed{apply,reln,ci,cn}
+ } {
+ \defineXMLnested[bvar]
+ {\directsetup{mmc:bvar:diff:start}}
+ {\directsetup{mmc:bvar:diff:stop}}
+ \XMLfirstnamed{bvar}
+ }
+ } {
+ \XMLfirstnamed{apply,reln,ci,cn}
+ }
+ }
+\stopsetups
+
+\startsetups mmc:bvar:diff:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:bvar:diff:stop
+ \stopsavingXMLelements
+ \getXMLentity{differentiald}\XMLfirstnamed{apply,reln,ci,cn}
+ \XMLdoifonstackelse{degree} {
+ ^{\XMLfirstnamed{degree}}
+ } {
+ % nothing
+ }
+ \endgroup
+\stopsetups
+
+\def\subMMLcelement #1#2{_{#2}}
+\def\superMMLcelement#1#2{^{#2}}
+
+\defineXMLprocess [lowlimit]
+\defineXMLprocess [uplimit]
+\defineXMLprocess [bvar]
+\defineXMLprocess [degree]
+
+% option:
+%
+% \defineXMLentity [div] {\mathematics{\triangledown\times}}
+% \defineXMLentity [curl] {\mathematics{\triangledown .}}
+% \defineXMLentity [grad] {\mathematics{\triangledown }}
+
+\defineXMLcommand [divergence] {\getXMLentity{divergence}\directsetup{mmc:donamedfunction}}
+\defineXMLcommand [grad] {\getXMLentity {grad}\directsetup{mmc:donamedfunction}}
+\defineXMLcommand [curl] {\getXMLentity {curl}\directsetup{mmc:donamedfunction}}
+\defineXMLcommand [laplacian] {\getXMLentity {laplacian}\directsetup{mmc:donamedfunction}}
+
+\defineXMLcommand [ident] {\getXMLentity {identity}\directsetup{mmc:donamedfunction}}
+\defineXMLcommand [domain] {\getXMLentity {domain}\directsetup{mmc:donamedfunction}}
+\defineXMLcommand [codomain] {\getXMLentity {codomain}\directsetup{mmc:donamedfunction}}
+
+\startsetups mmc:donamedfunction
+% \left(
+% \begingroup
+ \MMLcreset\flushXMLstackfrom\plustwo
+% \endgroup
+% \right)
+\stopsetups
+
+% theory of sets
+
+\defineXMLnested [set]
+ {\setups{mmc:set:start}}
+ {\setups{mmc:set:stop}}
+
+\startsetups mmc:set:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:set:stop
+ \stopsavingXMLelements
+ \XMLdoifonstackelse{condition} {
+ \left\{\XMLfirstnamed{bvar}\,\middle\vert\,\XMLfirstnamed{condition}\right\}
+ } {
+ \left\{\flushXMLstackwith\plusone{\MMLseparator,}\right\}
+ }
+ \endgroup
+\stopsetups
+
+\defineXMLnested [list]
+ {\setups{mmc:list:start}}
+ {\setups{mmc:list:stop}}
+
+\settrue\MMLlistdelimiters
+
+\startsetups mmc:list:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:list:stop
+ \stopsavingXMLelements
+ \ifconditional\MMLlistdelimiters\left [\fi
+ \begingroup
+ \settrue\MMLlistdelimiters
+ \flushXMLstackwith\plusone{\MMLseparator,}
+ \endgroup
+ \ifconditional\MMLlistdelimiters\right]\fi
+ \endgroup
+\stopsetups
+
+\defineXMLcommand [union] {\MMLcset\cup}
+\defineXMLcommand [intersect] {\MMLcset\cap}
+\defineXMLcommand [in] {\MMLcset\in}
+\defineXMLcommand [notin] {\MMLcset{\not\in}}
+\defineXMLcommand [subset] {\MMLcset\subset}
+\defineXMLcommand [prsubset] {\MMLcset\subseteq}
+\defineXMLcommand [notsubset] {\MMLcset{\not\subset}}
+\defineXMLcommand [notprsubset] {\MMLcset{\not\subseteq}}
+\defineXMLcommand [setdiff] {\MMLcset\setminus}
+
+\def\MMLcset#1{\getXMLstackdata\plustwo#1\getXMLstackdata\plusthree}
+
+\defineXMLcommand [card] {\left\vert\flushXMLstackfrom\plustwo\right\vert}
+\defineXMLcommand [cartesianproduct] {\flushXMLstackwith\plustwo\times}
+
+% sequences and series
+
+\defineXMLcommand [sum] {\MMLcSUMandPRODUCT{sum}\sum}
+\defineXMLcommand [product]{\MMLcSUMandPRODUCT{product}\prod}
+
+\setupMMLappearance[sum] [\c!location=\v!top]
+\setupMMLappearance[product][\c!location=\v!top]
+
+\def\stackMMLsubscripts#1%
+ {\vbox
+ {\baselineskip\zeropoint % hack, taco vragen
+ \halign{$\scriptstyle\hss##\hss$\cr#1\crcr}}}
+
+\def\MMLcSUMandPRODUCT#1#2%
+ {\XMLdoifonstackelse{condition,bvar,lowlimit}
+ {\def\MMLcSUMlow
+ {_{\XMLdoifonstackelse{condition}
+ {\collectXMLnamedstack{condition}{\crcr}%
+ \stackMMLsubscripts{\the\XMLRtoks}}
+ {\XMLdoifonstackelse{bvar}
+ {\XMLfirstnamed{bvar}%
+ \XMLdoifonstackelse{lowlimit}{=}{}}%
+ {}%
+ \XMLfirstnamed{lowlimit}}}}}
+ {\let\MMLcSUMlow\empty}%
+ \XMLdoifonstackelse{uplimit}
+ {\def\MMLcSUMup{^{\XMLfirstnamed{uplimit}}}}
+ {\let\MMLcSUMup\empty}%
+ \MMLcreset#2\doMMLlimits{#1}\MMLcSUMup\MMLcSUMlow
+ \MMLcreset\XMLfirstnamed{apply,ci}}
+
+\defineXMLcommand [limit] {\directsetup{mmc:limit}}
+
+\setupMMLappearance[limit][\c!location=\v!top]
+
+\startsetups mmc:limit
+ \MMLcreset \lim
+ \doMMLlimits{limit}_{
+ \MMLcreset
+ \XMLdoifonstackelse {condition} {
+ \XMLfirstnamed{condition}
+ } {
+ \XMLdoifonstackelse {bvar} {
+ \XMLfirstnamed{bvar}\rightarrow
+ } {
+ }
+ \XMLfirstnamed{lowlimit}
+ }
+ }
+ \XMLfirstnamed{apply}
+\stopsetups
+
+\defineXMLcommand [tendsto] [type=default] {\directsetup{mmc:tendsto}}
+
+\startsetups mmc:tendsto
+ \MMLcreset \getXMLstackdata\plustwo
+ \processaction
+ [\XMLpar{tendsto}{type}{default}]
+ [ above=>\downarrow,
+ below=>\uparrow,
+ unknown=>\rightarrow]
+ \MMLcreset \getXMLstackdata\plusthree
+\stopsetups
+
+% elementary classical functions
+
+\defineXMLcommand [exp] {\directsetup{mmc:exp}}
+\defineXMLcommand [ln] {\directsetup{mmc:function}}
+\defineXMLcommand [log] {\directsetup{mmc:log}}
+\defineXMLignore [logbase]
+
+\setupMMLappearance[log][\c!location=\v!right]
+
+\startsetups mmc:exp
+ \getXMLentity{exponentiale}^{\XMLfirstnamed{apply,reln,ci,cn}}
+\stopsetups
+
+\startsetups mmc:log
+ \XMLdoifonstackelse {logbase} {
+ \doifelse\@@MMLloglocation\v!left {
+ \mathop{{}^{{\defineXMLprocess[logbase]\XMLfirstnamed{logbase}}}
+ \getXMLentity{NegThinSpace}
+ \getXMLentity{log}}
+ } {
+ \getXMLentity{log}_{{\defineXMLprocess[logbase]\XMLfirstnamed{logbase}}}
+ }
+ } {
+ \getXMLentity{log}
+ }
+ \MMLcreset
+ % mmc:function:argument assumes that the apply is second in the row (*1*)
+ % \removeXMLdatafromstack{logbase}
+ \directsetup{mmc:function:argument}
+\stopsetups
+
+% statistics
+
+\defineXMLcommand [mean] {\overline{\getXMLstackdata\plustwo}}
+\defineXMLcommand [sdev] {\sigma(\MMLcreset\getXMLstackdata\plustwo)}
+\defineXMLcommand [variance] {\sigma(\MMLcreset\getXMLstackdata\plustwo)^2}
+\defineXMLcommand [median] {\getXMLentity{median}(\MMLcreset\getXMLstackdata\plustwo)}
+\defineXMLcommand [mode] {\getXMLentity{mode}(\MMLcreset\getXMLstackdata\plustwo)}
+
+% moments
+
+\defineXMLcommand [moment] {\directsetup{mmc:moment}}
+\defineXMLprocess [momentabout]
+
+\startsetups mmc:moment
+ \left\langle\XMLfirstnamed{apply,reln,ci,cn}^{\XMLfirstnamed{degree}}\right\rangle
+ \XMLdoifonstackelse{momentabout} {
+ _{\XMLfirstnamed{momentabout}}
+ } {
+ }
+\stopsetups
+
+% linear algebra
+
+\defineXMLcommand [vector] {\directsetup{mmc:vector}} % sequence
+
+\setupMMLappearance [vector] [\c!direction=\v!horizontal,\c!separator={,}]
+
+\defineXMLnested
+ [vector]
+ {\directsetup{mmc:vector:start}}
+ {\directsetup{mmc:vector:stop}}
+
+\startsetups mmc:vector:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:vector:stop
+ \stopsavingXMLelements
+ \ifnum\XMLstacklevel>\plusone
+ \doifelse\@@MMLvectordirection\v!horizontal {
+ \left(\flushXMLstackwith\plusone{\MMLseparator\@@MMLvectorseparator}\right)
+ } {
+ \collectXMLstack\crcr
+ \MMLcreset\left(\matrix{\the\XMLRtoks}\right)
+ }
+ \else
+ \overrightarrow{\charhtstrut\getXMLstackdata\plusone}
+ \fi
+ \endgroup
+\stopsetups
+
+\defineXMLnestedenvironmentsave [matrix] {} {\directsetup{mmc:matrix}}
+\defineXMLnestedenvironmentsave [matrixrow] {} {\directsetup{mmc:matrixrow}}
+
+\unexpanded\def\@col@amp@{&}
+
+\settrue\MMCdelmatrix %( ) when true
+
+\startsetups mmc:matrix
+ \begingroup
+ \MMLcreset
+ \defineXMLnestedenvironmentsave [matrixrow] {} {\directsetup{mmc:matrixrow:do}}
+ \ifconditional\MMCdelmatrix
+ \left(\matrix{\XMLflush{matrix}}\right)
+ \else
+ \settrue\MMCdelmatrix
+ \matrix{\XMLflush{matrix}}
+ \fi
+ \endgroup
+\stopsetups
+
+\startsetups mmc:matrixrow
+ \begingroup
+ \MMLcreset
+ \left(\matrix{\directsetup{mmc:matrixrow:do}}\right)
+ \endgroup
+\stopsetups
+
+\startsetups mmc:matrixrow:do
+ \begingroup
+ \startsavingXMLelements
+ \XMLflush{matrixrow}
+ \stopsavingXMLelements
+ \collectXMLstackrows\plusone\@col@amp@
+ \edef\ascii{\the\XMLRtoks}
+ \edef\ascii{\ascii}
+ \expandafter\endgroup\ascii\crcr
+\stopsetups
+
+\defineXMLcommand [determinant] {\directsetup{mmc:determinant}}
+\defineXMLcommand [transpose] {\directsetup{mmc:transpose}}
+\defineXMLcommand [selector] {\directsetup{mmc:selector}}
+
+\startsetups mmc:determinant
+ \begingroup
+ \left|
+ \setfalse\MMCdelmatrix
+ \getXMLstackdata\plustwo
+ \right|
+ \endgroup
+\stopsetups
+
+\startsetups mmc:transpose
+% \getXMLstackdata\plustwo^{\MMLrm T}
+ \getXMLstackdata\plustwo^{\mfunction{T}}
+\stopsetups
+
+\startsetups mmc:selector
+ \MMLmathinner{\getXMLstackdata\plustwo}_{\MMLcreset\flushXMLstackwith\plusthree{\MMLseparator,}}
+\stopsetups
+
+\defineXMLcommand [vectorproduct] {\getXMLstackdata\plustwo\getXMLentity{vectorproduct}\getXMLstackdata\plusthree}
+\defineXMLcommand [scalarproduct] {\getXMLstackdata\plustwo\getXMLentity{scalarproduct}\getXMLstackdata\plusthree}
+\defineXMLcommand [outerproduct] {\getXMLstackdata\plustwo\getXMLentity {outerproduct}\getXMLstackdata\plusthree}
+
+% semantic mapping elements
+
+\defineXMLnested
+ [semantics]
+ {\directsetup{mmc:semantics:start}}
+ {\directsetup{mmc:semantics:stop}}
+
+\startsetups mmc:semantics:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmc:semantics:stop
+ \stopsavingXMLelements
+ \XMLdoifonstackelse {annotation} {
+ \flushXMLnamedstackwith\plusone{annotation}\empty
+ } {
+ \flushXMLnamedstackwith\plusone{apply}\empty
+ }
+ \endgroup
+\stopsetups
+
+\defineXMLenvironmentsave
+ [annotation]
+ [encoding=]
+ {}
+ {\directsetup{mmc:annotation}}
+
+\startsetups mmc:annotation
+ \expanded{\doifinset{\XMLpar{annotation}{encoding}{}}{TeX,tex,TEX,ConTeXt,context,CONTEXT}} {
+ \XMLtexdata{annotation}
+ }
+\stopsetups
+
+\defineXMLignore [annotation-xml]
+
+% misc
+
+\defineXMLcommand [integers] {\getXMLentity{integers}}
+\defineXMLcommand [reals] {\getXMLentity{reals}}
+\defineXMLcommand [rationals] {\getXMLentity{rationals}}
+\defineXMLcommand [naturalnumbers] {\getXMLentity{naturalnumbers}}
+\defineXMLcommand [complexes] {\getXMLentity{complexes}}
+\defineXMLcommand [primes] {\getXMLentity{primes}}
+\defineXMLcommand [exponentiale] {\getXMLentity{ExponentialE}}
+\defineXMLcommand [imaginaryi] {\getXMLentity{ImaginaryI}}
+\defineXMLcommand [notanumber] {\mathop{\mfunction{NaN}}}
+\defineXMLcommand [true] {\mathop{\mfunction{true}}}
+\defineXMLcommand [false] {\mathop{\mfunction{false}}}
+\defineXMLcommand [emptyset] {\mathop{\O}}
+\defineXMLcommand [pi] {\pi}
+\defineXMLcommand [eulergamma] {\gamma}
+\defineXMLcommand [infinity] {\infty}
+
+% gonio functions
+
+\defineXMLcommand[sin] {\directsetup{mmc:function}} \defineXMLcommand[arcsin] {\directsetup{mmc:function}}
+\defineXMLcommand[sinh]{\directsetup{mmc:function}} \defineXMLcommand[arcsinh]{\directsetup{mmc:function}}
+\defineXMLcommand[cos] {\directsetup{mmc:function}} \defineXMLcommand[arccos] {\directsetup{mmc:function}}
+\defineXMLcommand[cosh]{\directsetup{mmc:function}} \defineXMLcommand[arccosh]{\directsetup{mmc:function}}
+\defineXMLcommand[tan] {\directsetup{mmc:function}} \defineXMLcommand[arctan] {\directsetup{mmc:function}}
+\defineXMLcommand[tanh]{\directsetup{mmc:function}} \defineXMLcommand[arctanh]{\directsetup{mmc:function}}
+\defineXMLcommand[cot] {\directsetup{mmc:function}} \defineXMLcommand[arccot] {\directsetup{mmc:function}}
+\defineXMLcommand[coth]{\directsetup{mmc:function}} \defineXMLcommand[arccoth]{\directsetup{mmc:function}}
+\defineXMLcommand[csc] {\directsetup{mmc:function}} \defineXMLcommand[arccsc] {\directsetup{mmc:function}}
+\defineXMLcommand[csch]{\directsetup{mmc:function}} \defineXMLcommand[arccsch]{\directsetup{mmc:function}}
+\defineXMLcommand[sec] {\directsetup{mmc:function}} \defineXMLcommand[arcsec] {\directsetup{mmc:function}}
+\defineXMLcommand[sech]{\directsetup{mmc:function}} \defineXMLcommand[arcsech]{\directsetup{mmc:function}}
+
+\setupMMLappearance[function][\c!reduction=\v!yes]
+
+\startsetups mmc:function
+ \getXMLentity\currentXMLelement
+ \ifx\MMLpowerelement\empty\else
+ ^{\MMLcreset\MMLpowerelement\empty}
+ \getXMLentity{NegThinSpace}
+ \global\let\MMLpowerelement\empty
+ \fi
+ \doif {\getXMLstackname\plusone} {\currentXMLelement} {
+ % rather fuzzy test; looks like an apply case
+ \directsetup{mmc:function:argument}
+ }
+\stopsetups
+
+\startsetups mmc:function:argument
+ \doifelse\@@MMLfunctionreduction\v!yes {
+ % \doifelse {\getXMLstackname\plustwo} {apply} {
+ % \doifelseMMCfunctioninapply \plustwo \MMLcfunctionlist \donefalse \donetrue
+ %
+ % best is to grab the apply (independent of order), (*1*), so:
+ %
+ \XMLdoifonstackelse {apply} {
+ \doifelseMMCfunctioninapply \XMLstackposition \MMLcfunctionlist \donefalse \donetrue
+ } {
+ \donefalse
+ }
+ } {
+ \donetrue
+ }
+ % beware, we still flush from 2 up
+ \ifdone
+ \left(\MMLcreset\flushXMLstackfrom\plustwo\right)
+ \else
+ \MMLcreset\flushXMLstackfrom\plustwo
+ \fi
+\stopsetups
+
+% presentation mml
+
+\def\resetMMLseparator
+ {\newcounter\MMLxxcounter
+ \let\lastMMLseparator\empty}
+
+\def\grabMMLseparator#1%
+ {\increment\MMLxxcounter
+ \newcounter\MMLyycounter
+ \expanded{\dograbMMLseparator#1\noexpand\relax}}
+
+\def\dograbMMLseparator
+ {\increment\MMLyycounter
+ \doifnextcharelse\relax
+ {\lastMMLseparator\gobbleoneargument}
+ {\doifnextcharelse\xmlrent\grabMMLseparatora\grabMMLseparatorb}}
+
+\def\grabMMLseparatora#1\xmlrent#2%
+ {\ifnum\MMLxxcounter=\MMLyycounter\space
+ \def\lastMMLseparator{\xmlrent{#2}}%
+ \fi
+ \dograbMMLseparator}
+
+\def\grabMMLseparatorb#1%
+ {\ifnum\MMLxxcounter=\MMLyycounter\space
+ \doifXMLentityelse{#1}
+ {\def\lastMMLseparator{\xmlrent{#1}}}
+ {\def\lastMMLseparator{#1}}%
+ \fi
+ \dograbMMLseparator}
+
+%
+
+\defineXMLargument [mi] \MMLpMI
+\defineXMLargument [mn] \MMLpMN
+\defineXMLargument [mo] \MMLpMO
+
+\def\MMLpMI#1%
+ {\begingroup
+ \setMMLpmathstyle{mstyle}%
+ #1%
+ \endgroup}
+
+% \def\MMLpMN#1%
+% {\begingroup
+% \MMLrm
+% \setMMLpmathstyle{mstyle}%
+% #1%
+% \endgroup}
+
+\def\MMLpMN#1%
+ {\mfunction{\setMMLpmathstyle{mstyle}#1}}
+
+\def\MMLpMO#1% yes or no
+ {\flattenXMLcontent{#1}%
+ \doifXMLentityelse\flattenedXMLcontent
+ {\getXMLentity\flattenedXMLcontent}
+ {\ConvertConstantAfter\doifinstringelse{\xmlrent}{#1} % TODO ! ! ! ! ! ! ! !
+ {#1}
+ {\hbox
+ {\setMMLpmathstyle{mstyle}%
+ \ignorespaces#1\unskip}}}}
+
+% we need to get rid of spaces: <mo> &RightArrow; </mo>
+
+\def\MMLpMO#1% yes or no
+ {\flattenXMLcontent{#1}%
+ \doifXMLentityelse\flattenedXMLcontent
+ {\getXMLentity\flattenedXMLcontent}
+ {\ignorespaces#1\removeunwantedspaces}}
+
+\let\normalright=\right
+\let\normalleft =\left
+
+\def\doMMLleft #1{\pushmacro\left \let\left \empty\normalleft #1\popmacro\left}
+\def\doMMLright#1{\pushmacro\right\let\right\empty\normalright#1\popmacro\right}
+
+\let\MMLpopen \empty
+\let\MMLpclose\empty
+
+\defineXMLnested [mfenced] [open=(,close=),separators=]
+ {\directsetup{mmp:mfenced:start}}
+ {\directsetup{mmp:mfenced:stop}}
+
+\startsetups mmp:mfenced:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:mfenced:stop
+ \stopsavingXMLelements
+ \edef\MMLpopen {\XMLpar{mfenced}{open} {}}
+ \edef\MMLpclose{\XMLpar{mfenced}{close}{}}
+ \ifx\MMLpopen \space\let\MMLpopen \empty\fi
+ \ifx\MMLpclose\space\let\MMLpclose\empty\fi
+ \ifx\MMLpopen\empty
+ \ifx\MMLpclose\empty
+ \else
+ \doMMLleft.
+ \fi
+ \else
+ \doMMLleft\MMLpopen
+ \fi
+ \pushmacro\MMLpopen
+ \pushmacro\MMLpclose
+ \doifelsenothing{\XMLpar{mfenced}{separators}{}} {
+ \flushXMLstackfrom\plusone
+ } {
+ \resetMMLseparator
+ \flushXMLstackwith\plusone {
+ \begingroup
+ \let\myspecialnormalvert\myspecialstretchvert
+ \grabMMLseparator{\XMLpar{mfenced}{separators}{}}
+ \endgroup
+ }
+ }
+ \popmacro\MMLpclose
+ \popmacro\MMLpopen
+ \ifx\MMLpclose\empty
+ \ifx\MMLpopen\empty
+ \else
+ \doMMLright.
+ \fi
+ \else
+ \doMMLright\MMLpclose
+ \fi
+ \endgroup
+\stopsetups
+
+% \startbuffer
+% <math><mfenced separators="" open="(" close=")"><mi>x</mi></mfenced></math>
+% <math><mfenced separators="" open="" close=")"><mi>x</mi></mfenced></math>
+% <math><mfenced separators="" open="(" close="" ><mi>x</mi></mfenced></math>
+% <math><mfenced separators="" open="" close="" ><mi>x</mi></mfenced></math>
+% <math><mfenced separators="" open="" close=" "><mi>x</mi></mfenced></math>
+% \stopbuffer
+%
+% \processXMLbuffer
+
+\defineXMLnestedenvironmentsave [menclose] [notation=]
+ {\directsetup{mmp:menclose:start}}
+ {\directsetup{mmp:menclose:stop}}
+
+\startsetups mmp:menclose:start
+ \begingroup
+\stopsetups
+
+\startsetups mmp:menclose:stop
+ \doifelse{\XMLpar{menclose}{notation}{}}{longdiv} {
+ \overline{)\XMLflush{menclose}}
+ } {
+ \XMLflush{menclose}
+ }
+ \endgroup
+\stopsetups
+
+\defineXMLnested [mfrac] [linethickness=]
+ {\directsetup{mmp:mfrac:start}}
+ {\directsetup{mmp:mfrac:stop}}
+
+\startsetups mmp:mfrac:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:mfrac:stop
+ \stopsavingXMLelements
+ \doifXMLparelse{mfrac}{linethickness} {
+ \edef\theXMLpar{\XMLpar{mfrac}{linethickness}{1}}
+ \processaction
+ [\theXMLpar]
+ [ thin=>\scratchdimen=.2pt,
+ medium=>\scratchdimen=.4pt,
+ thick=>\scratchdimen=.8pt,
+ unknown=>\setdimensionwithunit\scratchdimen{\theXMLpar}{}]
+ {{\getXMLstackdata\plusone}\above\scratchdimen{\getXMLstackdata\plustwo}}
+ } {
+ \frac{\getXMLstackdata\plusone}{\getXMLstackdata\plustwo}
+ }
+ \endgroup
+\stopsetups
+
+\defineXMLargument
+ [ms]
+ [lquote=\xmlrent{quot},
+ rquote=\xmlrent{quot},
+ fontweight=,
+ fontstyle=,
+ mathstyle=,
+ mathvariant=,
+ background=,
+ color=]
+ {\MMLpSTRING}
+
+\def\MMLpSTRING#1%
+ {\hbox
+ {\tf % else encoding problems
+ \MMLpTEXT{\XMLpar{ms}{lquote}{}%
+ \doMMPpbackground{ms}{\doMMPpcolor{ms}{\setMMLptextstyle{ms}\ignorespaces#1\removeunwantedspaces}}%
+ \XMLpar{ms}{rquote}{}}}}
+
+\defineXMLenvironment
+ [mstyle]
+ [fontweight=,
+ fontstyle=,
+ mathstyle=,
+ mathvariant=,
+ background=,
+ color=]
+ {\begingroup}
+ {\endgroup}
+
+\defineXMLargument [mtext] [CPA] \MMLpTEXT
+\defineXMLargument [merror] [CPA] \MMLpERROR
+\defineXMLargument [mphantom] [CPA] \MMLpPHANTOM
+\defineXMLargument [mpadded] [CPA] \MMLpPADDED
+
+\mapXMLvalue{mmp}{normal} {\tf} \mapXMLvalue{mmp}{double-stuck} {\bf}
+\mapXMLvalue{mmp}{bolditalic} {\bi} \mapXMLvalue{mmp}{bold-italic} {\bi}
+\mapXMLvalue{mmp}{boldslanted}{\bs} \mapXMLvalue{mmp}{bold-slanted} {\bs}
+\mapXMLvalue{mmp}{boldnormal} {\bf} \mapXMLvalue{mmp}{bold} {\bf}
+\mapXMLvalue{mmp}{slanted} {\sl} \mapXMLvalue{mmp}{normalslanted}{\sl}
+\mapXMLvalue{mmp}{italic} {\it} \mapXMLvalue{mmp}{normalitalic} {\it}
+\mapXMLvalue{mmp}{fraktur} {\bf} \mapXMLvalue{mmp}{bold-fraktur} {\bf}
+\mapXMLvalue{mmp}{script} {\tf} \mapXMLvalue{mmp}{bold-script} {\bf}
+
+% and all kind of other crappy names
+
+\def\setMMLptextstyle#1%
+ {\XMLval{mmp}{\XMLpar{#1}{fontweight}{}\XMLpar{#1}{fontstyle}{}}{}}
+
+\def\setMMLpmathstyle#1%
+ {\XMLval{mmp}{\XMLpar{#1}{mathvariant}{}}{}}
+
+\def\doMMPpcolor#1#2%
+ {\doifXMLparelse{#1}{color}{\color[\XMLpar{#1}{color}{}]{#2}}{#2}}
+
+\def\doMMPpbackground#1#2%
+ {\doifXMLparelse{#1}{background}
+ {\inframed
+ [\c!frame=\v!off,
+ \c!background=\v!color,
+ \c!backgroundcolor=\XMLpar{#1}{background}{}]
+ {#2}}
+ {#2}}
+
+\def\MMLpTEXT#1%
+ {\hbox
+ {\tf % else encoding problems
+ \doMMPpbackground{ms}{\doMMPpcolor{ms}{\setMMLptextstyle{ms}\ignorespaces#1\removeunwantedspaces}}}}
+
+\def\MMLpERROR#1%
+ {\hbox{$\displaystyle#1$}}
+
+\def\MMLpPHANTOM#1%
+ {\phantom{\ignorespaces{}#1\unskip}} % watch spacing {} hack
+
+\def\MMLpPADDED#1%
+ {#1}
+
+% mrow
+
+\defineXMLenvironment [mrow] {\resetMMLbounds} {\finishMMLbounds}
+
+% \def\MMLleft #1{\increment\MMLboundslevel\left #1}
+% \def\MMLright#1{\right#1\decrement\MMLboundslevel}
+
+% \def\resetMMLbounds
+% {\let\MMLboundslevel\!!plusone\left.}
+
+% \def\finishMMLbounds
+% {\dorecurse\MMLboundslevel{\right.}}
+
+\def\resetMMLbounds
+ {\pushmacro\MMLboundslevel
+ \newcounter\MMLboundslevel}
+
+\def\MMLleft #1%
+ {\increment\MMLboundslevel
+ \normalleft#1}
+
+\def\MMLright#1%
+ {\ifnum\MMLboundslevel=0 \normalleft.\!\fi
+ \normalright#1%
+ \decrement\MMLboundslevel}
+
+\def\finishMMLbounds
+ {\ifnum\MMLboundslevel>0
+ \normalright.\!%
+ \decrement\MMLboundslevel
+ \expandafter\finishMMLbounds
+ \else
+ \popmacro\MMLboundslevel
+ \fi}
+
+\defineXMLnested [msqrt] {\directsetup{mmp:msqrt:start}} {\directsetup{mmp:msqrt:stop}}
+\defineXMLnested [mroot] {\directsetup{mmp:mroot:start}} {\directsetup{mmp:mroot:stop}}
+
+\startsetups mmp:msqrt:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:msqrt:stop
+ \stopsavingXMLelements
+ \sqrt{\flushXMLstackfrom\plusone}
+ \endgroup
+\stopsetups
+
+\startsetups mmp:mroot:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:mroot:stop
+ \stopsavingXMLelements
+ \root{\getXMLstackdata\plustwo}\of{\getXMLstackdata\plusone}
+ \endgroup
+\stopsetups
+
+\setupMMLappearance[scripts][\c!alternative=\v!a]
+
+\defineXMLnested [msub] {\directsetup{mmp:msub:start}} {\directsetup{mmp:msub:stop}}
+\defineXMLnested [msup] {\directsetup{mmp:msup:start}} {\directsetup{mmp:msup:stop}}
+\defineXMLnested [msubsup] {\directsetup{mmp:msbp:start}} {\directsetup{mmp:msbp:stop}}
+
+\startsetups mmp:msub:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:msub:stop
+ \stopsavingXMLelements
+ \doifelse\@@MMLscriptsalternative\v!a {
+ {\getXMLstackdata\plusone}_{\getXMLstackdata\plustwo}
+ } {
+ \getXMLstackdata\plusone_{\getXMLstackdata\plustwo}
+ }
+ \endgroup
+\stopsetups
+
+\startsetups mmp:msup:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:msup:stop
+ \stopsavingXMLelements
+ \doifelse\@@MMLscriptsalternative\v!a {
+ {\getXMLstackdata\plusone}^{\getXMLstackdata\plustwo}
+ } {
+ \getXMLstackdata\plusone^{\getXMLstackdata\plustwo}
+ }
+ \endgroup
+\stopsetups
+
+\startsetups mmp:msbp:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:msbp:stop
+ \stopsavingXMLelements
+ \getXMLstackdata\plusone_{\getXMLstackdata\plustwo}^{\getXMLstackdata\plusthree}
+ \endgroup
+\stopsetups
+
+\defineXMLnested [mover] {\directsetup{mmp:mover:start}} {\directsetup{mmp:mover:stop}}
+\defineXMLnested [munder] {\directsetup{mmp:munder:start}} {\directsetup{mmp:munder:stop}}
+\defineXMLnested [munderover] {\directsetup{mmp:munderover:start}} {\directsetup{mmp:munderover:stop}}
+
+\startsetups mmp:mover:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:mover:stop
+ \stopsavingXMLelements
+ \mathop{\vbox{\m@th\ialign{\hss##\hss\crcr\noalign{\kern3\p@}%
+ \disabledelimiter\doMMLfiller{\getXMLstackdata\plustwo}
+ \crcr\noalign{\kern3\p@\nointerlineskip}%
+ \disabledelimiter\doMMLfiller{\getXMLstackdata\plusone}
+ \crcr}}}
+ \limits
+ \endgroup
+\stopsetups
+
+\startsetups mmp:munder:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:munder:stop
+ \stopsavingXMLelements
+ \mathop{\vtop{\m@th\ialign{\hss##\hss\crcr
+ \disabledelimiter\doMMLfiller{\getXMLstackdata\plusone}
+ \crcr\noalign{\kern3\p@\nointerlineskip}%
+ \disabledelimiter\doMMLfiller{\getXMLstackdata\plustwo}
+ \crcr\noalign{\kern3\p@}}}}
+ \limits
+ \endgroup
+\stopsetups
+
+\startsetups mmp:munderover:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:munderover:stop
+ \stopsavingXMLelements
+ \getXMLstackdata\plusone
+ _{\disablefiller\disabledelimiter\getXMLstackdata\plustwo}
+ ^{\disablefiller\disabledelimiter\getXMLstackdata\plusthree}
+ \endgroup
+\stopsetups
+
+\def\doMMLfiller#1%
+ {\pushmacro\doMMLfiller
+ \let\doMMLfiller\gobbleoneargument
+ \gdef\dodoMMLfiller{\disablefiller\mathematics{#1}}%
+ \setbox\scratchbox=\hbox
+ {\def\normalorfiller##1##2%
+ {\gdef\dodoMMLfiller{\enablefiller#1}%
+ \let\normalorfiller\gobbletwoarguments}%
+ $#1$}%
+ \popmacro\doMMLfiller
+ \dodoMMLfiller}
+
+% tables
+
+% obsolete: \setupMMLappearance[mtable][\c!alternative=\v!a]
+
+\mapXMLvalue {mmp:mtable} {align:left} {right}
+\mapXMLvalue {mmp:mtable} {align:right} {left}
+\mapXMLvalue {mmp:mtable} {align:center} {middle}
+
+\mapXMLvalue {mmp:mtable} {frame:none} {off}
+\mapXMLvalue {mmp:mtable} {frame:solid} {on}
+\mapXMLvalue {mmp:mtable} {frame:on} {on}
+
+\defineXMLnested
+ [mtable]
+ [columnalign=,
+ columnspacing=.25ex,
+ rowspacing=.25ex,
+ frame=,
+ color=,
+ background=]
+ {\directsetup{mmp:mtable:start}}
+ {\directsetup{mmp:mtable:stop}}
+
+\defineXMLnestedargument
+ [mtr]
+ {\MMPmtableHANDLEtr}
+
+\defineXMLnestedargument
+ [mlabeledtr]
+ {\MMPmtableHANDLEtr}
+
+\defineXMLnestedargument
+ [mtd]
+ [columnalign=,
+ columnspacing=.25ex,
+ rowspacing=.25ex,
+ frame=,
+ color=,
+ background=]
+ {\MMPmtableHANDLEtd}
+
+\startsetups mmp:mtable:start
+ \vcenter \bgroup
+ \MMLpTABLEsplitter{background} \c!backgroundcolor
+ \MMLpTABLEsplitter{color} \c!color
+ \MMLpTABLEmapper {frame} \c!frame
+ \MMLpTABLEmapper {columnalign}\c!align
+ \setMMLpunit{\XMLpar{mtable}{rowspacing}\empty}{.25ex}
+ \let\MMLpTABLEoffset\MMLpunit
+ \bTABLE[\c!frame=\v!off,\c!background=\v!color,\c!offset=\MMLpTABLEoffset]
+\stopsetups
+
+\startsetups mmp:mtable:stop
+ \eTABLE
+ \egroup
+\stopsetups
+
+\long\def\MMPmtableHANDLEtr#1{%
+ \bTR\ignorespaces#1\removeunwantedspaces\eTR
+}
+
+\long\def\MMPmtableHANDLEtd#1{%
+ \let\theMMLpTABLEmap\empty
+ \MMLpTABLEmap{background} \c!backgroundcolor
+ \MMLpTABLEmap{color} \c!color
+ \MMLpTABLEmap{frame} \c!frame
+ \MMLpTABLEmap{columnalign}\c!align
+ \expanded{\bTD[\theMMLpTABLEmap]}%
+ $\ignorespaces#1\removeunwantedspaces$\eTD
+}
+
+\def\MMLpTABLEmapper#1#2%
+ {\doifXMLparelse{mtable}{#1}
+ {\newcounter\MMLcounter
+ \def\docommando##1%
+ {\increment\MMLcounter
+ \expanded{\setupTABLE[column][\MMLcounter][#2=\XMLval{mmp:mtable}{#2:##1}\empty]}}%
+ \expanded{\processseparatedlist[\XMLpar{mtable}{#1}\empty]}[ ]\docommando}
+ {}}
+
+\def\MMLpTABLEsplitter#1#2%
+ {\doifXMLparelse{mtable}{#1}
+ {\newcounter\MMLcounter
+ \def\docommando##1%
+ {\increment\MMLcounter
+ \expanded{\setupTABLE[column][\MMLcounter][#2=##1]}}%
+ \expanded{\processseparatedlist[\XMLpar{mtable}{#1}\empty]}[ ]\docommando}
+ {}}
+
+\def\MMLpTABLEmap#1#2%
+ {\doifXMLparelse{mtd}{#1}
+ {\edef\theMMLpTABLEmap{#2=\XMLval{mmp:mtable}{#2:\XMLpar{mtd}{#1}\empty}\empty,\theMMLpTABLEmap}}
+ {}}
+
+\defineXMLsingular [mspace] [width=.5em] {\directsetup{mmp:mspace}}
+
+\startsetups mmp:mspace
+ \setMMLpunit{\XMLpar{mspace}{width}{}}{.5em}
+ \hskip\MMLpunit\relax
+\stopsetups
+
+\def\setMMLpunit#1#2% i've forgotten what this means
+ {\setbox\scratchbox=\hbox
+ {\edef\ascii{#1}%
+ \@EA\aftersplitstring\ascii\at.\to\ascii
+ \scratchcounter=\ifx\ascii\empty#1\else\ascii\fi
+ \unskip\unskip}%
+ \ifdim\wd\scratchbox=\zeropoint
+ \edef\MMLpunit{#1em}%
+ \else
+ \edef\ascii{#1}\convertcommand\ascii\to\ascii
+ \convertasciiafter\doifinstringelse{em}{\ascii}{\edef\MMLpunit{#1}}{%
+ \convertasciiafter\doifinstringelse{ex}{\ascii}{\edef\MMLpunit{#1}}{%
+ \convertasciiafter\doifinstringelse{pt}{\ascii}{\edef\MMLpunit{#1}}{%
+ \edef\MMLpunit{#2}}}}%
+ \fi}
+
+% end of tables
+
+\def\setMMLpunit#1#2%
+ {\setbox\scratchbox=\hbox
+ {\edef\ascii{#1}%
+ \@EA\aftersplitstring\ascii\at.\to\ascii
+ \scratchcounter=\ifx\ascii\empty#1\else\ascii\fi
+ \unskip\unskip}%
+ \ifdim\wd\scratchbox=\zeropoint
+ \edef\MMLpunit{#1em}%
+ \else
+ \edef\ascii{#1}\convertcommand\ascii\to\ascii
+ \convertasciiafter\doifinstringelse{em}{\ascii}{\edef\MMLpunit{#1}}{%
+ \convertasciiafter\doifinstringelse{ex}{\ascii}{\edef\MMLpunit{#1}}{%
+ \convertasciiafter\doifinstringelse{pt}{\ascii}{\edef\MMLpunit{#1}}{%
+ \edef\MMLpunit{#2}}}}%
+ \fi}
+
+\defineXMLsingular [mspace] [width=.5em] {\directsetup{mmp:mspace}}
+
+\startsetups mmp:mspace
+ \setMMLpunit{\XMLpar{mspace}{width}{}}{.5em}
+ \hskip\MMLpunit
+\stopsetups
+
+\defineXMLsingular [mglyph] [fontfamily=,index=1,alt=] {\directsetup{mmp:mglyph}}
+
+\startsetups mmp:mglyph
+ \def\MMLpglyph{\XMLpar{mglyph}{fontfamily}{}}%
+ \doifelsenothing{\MMLpglyph} {
+ \hbox{\tttf[fontfamily unspecified]}
+ } {
+ \doifdefinedelse{\MMLpglyph} {
+ \hbox{\getvalue{\MMLpglyph}\char0\XMLpar{mglyph}{index}{1}}
+ } {
+ \doifelsenothing{\XMLpar{mglyph}{alt}{}} {
+ \hbox{\tttf[unknown fontfamily \XMLpar{mglyph}{fontfamily}{}]}
+ } {
+ \hbox{\tttf\XMLpar{mglyph}{alt}{}}
+ }
+ }
+ }
+\stopsetups
+
+\defineXMLsingular [malignmark] {}
+\defineXMLsingular [none] {}
+\defineXMLsingular [mprescripts] {}
+
+\defineXMLnested
+ [mmultiscripts]
+ {\setups{mmp:mmultiscripts:start}}
+ {\setups{mmp:mmultiscripts:stop}}
+
+\startsetups mmp:mmultiscripts:start
+ \begingroup
+ \startsavingXMLelements
+\stopsetups
+
+\startsetups mmp:mmultiscripts:stop
+ \stopsavingXMLelements
+ \donefalse
+ \scratchcounter\zerocount
+ \dorecurse\XMLstacklevel {
+ % watch the extra {}'s
+ \ifdone
+ \ifodd\scratchcounter
+ ^{\getXMLstackdata\recurselevel}{}
+ \else
+ _{\getXMLstackdata\recurselevel}
+ \fi
+ \else
+ \doif{\getXMLstackname\recurselevel}{mprescripts}{\donetrue{}}
+ \fi
+ \ifdone \advance\scratchcounter\plusone \fi
+
+ }
+ \donetrue
+ \scratchcounter\zerocount
+ \dorecurse\XMLstacklevel {
+ \ifdone
+ % watch the extra {}'s
+ \ifcase\scratchcounter
+ \getXMLstackdata\recurselevel
+ \else\ifodd\scratchcounter
+ _{\getXMLstackdata\recurselevel}
+ \else
+ ^{\getXMLstackdata\recurselevel}{}
+ \fi\fi
+ \fi
+ \doif{\getXMLstackname\recurselevel}{mprescripts}{\donefalse}
+ \ifdone \advance\scratchcounter\plusone \fi
+ }
+ \endgroup
+\stopsetups
+
+% experimental patches
+
+\startmoduletestsection
+
+\let\MMLdoL\donothing
+\let\MMLdoR\donothing
+
+\startsetups mmc:apply:stop
+ \stopsavingXMLelements
+ \MMLmathinner {
+ \expanded{\doifinsetelse{\getXMLstackname\plusone}{\MMLcmainresetlist,\MMLctempresetlist}}
+ \MMLcreset
+ \donothing
+ \ifcase\MMLapplydepth \else
+ \doifXMLparelse{apply}{open} \donothing{\getXMLarguments{apply}{open="("}}% slow
+ \doifXMLparelse{apply}{close}\donothing{\getXMLarguments{apply}{close=")"}}% slow
+ \fi
+ \advance\MMLapplydepth\plusone
+ \begingroup
+ \doifXMLparelse{apply}{open} % now inside the group
+ {\edef\MMLdoL{\noexpand\left \XMLpar{apply}{open} {(}}
+ \edef\MMLdoR{\noexpand\right\XMLpar{apply}{close}{)}}}
+ {\let\MMLdoL\donothing
+ \let\MMLdoR\donothing}
+ \let\MMLctempresetlist\empty
+ \doifelse {\getXMLstackname\plusone} {apply} {
+ % <apply> <apply> ... </apply> <ci> .. </ci> </apply>
+ \doifelseMMCfunctioninapply \plusone {plus,minus} {
+ % yet incomplete and rather untested
+ % <apply> <apply> <minus/> <tan/> <cos/> </apply> <ci>x</ci> </apply>
+ } {
+ \MMLcreset
+ }
+ \MMLdoL
+ \getXMLstackdata\plusone
+ \ifconditional\somepostponedMMLactions
+ \postponedMMLactions
+ \else
+ \left(\MMLcreset\getXMLstackdata\plustwo\right)
+ \fi
+ \MMLdoR
+ } {
+ \doifelse {\getXMLstackname\plusone} {fn} {
+ % \MMLdoL/R are to be taken care of in the next setup
+ \directsetup{mmc:fn:apply}
+ } {
+ \doifelse {\getXMLstackname\plusone} {csymbol} {
+ % \MMLdoL/R are to be taken care of in the next setup
+ \directsetup{mmc:csymbol:apply}
+ } {
+ \doifelse {\getXMLstackname\plusone} {ci} {
+ % \MMLdoL/R are to be taken care of in the next setup
+ \directsetup{mmc:ci:apply}
+ } {
+ \MMLdoL
+ \getXMLstackdata\plusone
+ \MMLdoR
+ }
+ }
+ }
+ }
+ \endgroup
+ \advance\MMLapplydepth\minusone
+ \directsetup{apply:flush}
+ }
+ \endgroup
+\stopsetups
+
+\startsetups mmc:fn:apply
+ \begingroup
+ \startsavingXMLelements
+ \rawXMLstacktext\plusone % still on stack, no check, just fn content
+ \stopsavingXMLelements
+ \doifelse {\getXMLstackname\plusone} {ci} {
+ \flattenXMLcontent{\getXMLstackdata\plusone}
+ \doifsetupselse{mmc:fn:\flattenedXMLcontent} {
+% \MMLdoL/MMLdoR to be handled in plugin
+ \global\defXMLstackdata\XMLfnoperator\plusone
+ \expanded{\endgroup\noexpand\directsetup{mmc:fn:\flattenedXMLcontent}}
+ } {
+ \endgroup
+ \MMLcreset
+\MMLdoL
+ \getXMLstackdata\plusone
+ \ifnum\XMLstacklevel>\plusone
+ \getXMLentity{NegThinSpace}
+ \left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right)
+ \fi
+\MMLdoR
+ }
+ } {
+ \endgroup
+ \MMLcreset
+\MMLdoL
+ \getXMLstackdata\plusone
+\MMLdoR
+ }
+\stopsetups
+
+\startsetups mmc:csymbol:apply
+ \begingroup
+ \startsavingXMLelements
+ \rawXMLstacktext\plusone % still on stack, no check, just attr test
+ \stopsavingXMLelements
+ % \MMLdoL/MMLdoR to be handled in plugin
+ \doifsetupselse{mmc:csymbol:\XMLpar{csymbol}{definitionURL}{}} {
+ \expanded{\endgroup\noexpand\directsetup{mmc:csymbol:\XMLpar{csymbol}{definitionURL}{}}}
+ } {
+ \endgroup
+ \XMLval{mmc:cs}{\XMLop{encoding}}{\firstofoneargument}
+ }
+\stopsetups
+
+\startsetups mmc:ci:apply
+ \getXMLstackdata\plusone
+ \ifnum\XMLstacklevel>\plusone
+ \left(\MMLcreset\flushXMLstackwith\plustwo{\MMLseparator,}\right)
+ \fi
+\stopsetups
+
+\stopmoduletestsection
+
+\stopmodule
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-newmmo.tex b/Master/texmf-dist/tex/context/base/x-newmmo.tex
new file mode 100644
index 00000000000..2becfb30a80
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-newmmo.tex
@@ -0,0 +1,126 @@
+%D \module
+%D [ file=x-newmmo,
+%D version=2006.05.17,
+%D title=\CONTEXT\ XML Modules,
+%D subtitle=MathML Renderer/Open Math Extensions,
+%D author=Hans Hagen,
+%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.
+
+%D Strange things, why not mapped onto normal content MathML and/or
+%D onto processing instructions.
+
+\unprotect
+
+%D \startbuffer
+%D <math xmlns="http://www.w3.org/1998/Math/MathML">
+%D <vector>
+%D <apply>
+%D <csymbol definitionURL="http://www.openmath.org/cd/nums1#rational"/>
+%D <ci>a</ci>
+%D <cn type="integer">2</cn>
+%D </apply>
+%D <ci>a</ci>
+%D </vector>
+%D </math>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+
+\startsetups mmc:csymbol:http://www.openmath.org/cd/nums1\string#rational
+ \MMLcreset
+ \getXMLstackdata\plustwo/\getXMLstackdata\plusthree
+\stopsetups
+
+%D \startbuffer
+%D <math xmlns="http://www.w3.org/1998/Math/MathML">
+%D <apply>
+%D <csymbol definitionURL="http://www.openmath.org/cd/math4all#diffquot"/>
+%D <ci>y</ci>
+%D <ci>x</ci>
+%D </apply>
+%D </math>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+
+\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#diffquot
+ \MMLcreset
+ \frac {
+ \Delta\getXMLstackdata\plustwo
+ } {
+ \Delta\getXMLstackdata\plusthree
+ }
+\stopsetups
+
+%D \startbuffer
+%D <math xmlns="http://www.w3.org/1998/Math/MathML">
+%D <apply>
+%D <csymbol definitionURL="http://www.openmath.org/cd/math4all#difference"/>
+%D <ci>y</ci>
+%D </apply>
+%D </math>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D \startbuffer
+%D <math xmlns="http://www.w3.org/1998/Math/MathML">
+%D <apply>
+%D <csymbol definitionURL="http://www.openmath.org/cd/math4all#difference"/>
+%D <apply>
+%D <eq/>
+%D <ci>y</ci>
+%D <apply>
+%D <minus/>
+%D <apply>
+%D <ci>f</ci>
+%D <ci>x</ci>
+%D </apply>
+%D <apply>
+%D <ci>f</ci>
+%D <apply>
+%D <minus/>
+%D <ci>x</ci>
+%D <cn type="integer">1</cn>
+%D </apply>
+%D </apply>
+%D </apply>
+%D </apply>
+%D </apply>
+%D </math>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+
+\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#difference
+ \MMLcreset
+ \Delta\getXMLstackdata\plustwo
+\stopsetups
+
+%D \startbuffer
+%D <math xmlns="http://www.w3.org/1998/Math/MathML">
+%D <apply>
+%D <csymbol definitionURL="http://www.openmath.org/cd/math4all#diff"/>
+%D <ci>s</ci>
+%D <ci>t</ci>
+%D </apply>
+%D </math>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+
+\startsetups mmc:csymbol:http://www.openmath.org/cd/math4all\string#diff
+ \MMLcreset
+ \frac {
+ \mfunction{\getXMLentity{mathematicald}}\getXMLstackdata\plustwo
+ } {
+ \mfunction{\getXMLentity{mathematicald}}\getXMLstackdata\plusthree
+ }
+\stopsetups
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-newpml.tex b/Master/texmf-dist/tex/context/base/x-newpml.tex
new file mode 100644
index 00000000000..30b52061006
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-newpml.tex
@@ -0,0 +1,250 @@
+%D \module
+%D [ file=xtag-pml,
+%D version=2001.06.10,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=Units,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\writestatus{loading}{Context XML Macros (units)}
+
+\usemodule[newmml]
+
+%D Quick and dirty in||line units:
+%D
+%D \startbuffer
+%D <phys>
+%D <cn> 10 </cn>
+%D <cu> <Newton/> <Square/> <Meter/> <Per/> <Sec/> </cu>
+%D </phys>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D A more \MATHML||like unit application:
+%D
+%D \startbuffer
+%D <phys> <apply> <unit/>
+%D <cn> 10 </cn>
+%D <csymbol> <Square/> <Meter/> <Per/> <Sec/> </csymbol>
+%D </apply> </phys>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D A bit more compact:
+%D
+%D \startbuffer
+%D <phys> <apply> <unit/>
+%D <cn> 10 </cn>
+%D <cu> <Square/> <Meter/> <Per/> <Sec/> </cu>
+%D </apply> </phys>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D A bit more complicated:
+%D
+%D \startbuffer
+%D <phys> <apply> <unit/>
+%D <apply> <divide/> <ci> a </ci> <cn> 10 </cn> </apply>
+%D <cu> <Square/> <Meter/> <Per/> <Sec/> </cu>
+%D </apply> </phys>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D An alternative (equivalent) for \type {</cu>}:
+%D
+%D \startbuffer
+%D <phys> <apply> <unit/>
+%D <cn> 10 </cn> <cunseq> <Square/> <Meter/> <Per/> <Sec/> </cunseq>
+%D </apply> </phys>
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+
+\usemodule[units]
+
+\unprotect
+
+\defineXMLargument [phys] \automathematics
+\defineXMLargument [iphys] \inlinemathematics
+\defineXMLargument [dphys] \displaymathematics
+
+\defineXMLcommand [unit] {\directsetup{pml:unit}}
+
+\startsetups pml:unit
+ \flushXMLstackwith\plustwo\relax
+\stopsetups
+
+% \defineXMLenvironment
+% [unit]
+% {\ignorespaces}
+% {\removeunwantedspaces}
+
+\defineXMLsingular
+ [unit]
+ [label=]
+ {\XMLop{label}}
+
+\defineXMLsingular
+ [unitmeaning]
+ [label=]
+ {\expanded{\unitmeaning{\XMLop{label}}}}
+
+\let\handlePMLunit\firstofoneargument
+
+%D All unit commands are remapped in a similar way.
+
+\defineXMLsingular [Atto] {\handlePMLunit\Atto}
+\defineXMLsingular [Femto] {\handlePMLunit\Femto}
+\defineXMLsingular [Pico] {\handlePMLunit\Pico}
+\defineXMLsingular [Nano] {\handlePMLunit\Nano}
+\defineXMLsingular [Micro] {\handlePMLunit\Micro}
+\defineXMLsingular [Milli] {\handlePMLunit\Milli}
+\defineXMLsingular [Centi] {\handlePMLunit\Centi}
+\defineXMLsingular [Deci] {\handlePMLunit\Deci}
+\defineXMLsingular [Hecto] {\handlePMLunit\Hecto}
+\defineXMLsingular [Kilo] {\handlePMLunit\Kilo}
+\defineXMLsingular [Mega] {\handlePMLunit\Mega}
+\defineXMLsingular [Giga] {\handlePMLunit\Giga}
+\defineXMLsingular [Terra] {\handlePMLunit\Terra}
+\defineXMLsingular [Peta] {\handlePMLunit\Peta}
+\defineXMLsingular [Exa] {\handlePMLunit\Exa}
+
+\defineXMLsingular [Times] {\handlePMLunit\Times}
+\defineXMLsingular [Solidus] {\handlePMLunit\Solidus}
+\defineXMLsingular [Per] {\handlePMLunit\Per}
+\defineXMLsingular [OutOf] {\handlePMLunit\OutOf}
+
+\defineXMLsingular [Linear] {\handlePMLunit\Linear}
+\defineXMLsingular [Square] {\handlePMLunit\Square}
+\defineXMLsingular [Cubic] {\handlePMLunit\Cubic}
+
+\defineXMLsingular [Inverse] {\handlePMLunit\Inverse}
+
+\defineXMLsingular [Degrees] {\handlePMLunit\Degrees}
+\defineXMLsingular [Meter] {\handlePMLunit\Meter}
+\defineXMLsingular [Liter] {\handlePMLunit\Liter}
+\defineXMLsingular [Sec] {\handlePMLunit\Sec}
+\defineXMLsingular [Year] {\handlePMLunit\Year}
+\defineXMLsingular [Month] {\handlePMLunit\Month}
+\defineXMLsingular [Week] {\handlePMLunit\Week}
+\defineXMLsingular [Day] {\handlePMLunit\Day}
+\defineXMLsingular [Hour] {\handlePMLunit\Hour}
+\defineXMLsingular [Min] {\handlePMLunit\Min}
+\defineXMLsingular [Minute] {\handlePMLunit\Min}
+\defineXMLsingular [Second] {\handlePMLunit\Sec}
+\defineXMLsingular [Rad] {\handlePMLunit\Rad}
+\defineXMLsingular [Deg] {\handlePMLunit\Deg}
+\defineXMLsingular [Hertz] {\handlePMLunit\Hertz}
+\defineXMLsingular [RevPerSec] {\handlePMLunit\RevPerSec}
+\defineXMLsingular [RevPerMin] {\handlePMLunit\RevPerMin}
+\defineXMLsingular [Gram] {\handlePMLunit\Gram}
+\defineXMLsingular [Atom] {\handlePMLunit\Atom}
+\defineXMLsingular [Newton] {\handlePMLunit\Newton}
+\defineXMLsingular [Pascal] {\handlePMLunit\Pascal}
+\defineXMLsingular [Joule] {\handlePMLunit\Joule}
+\defineXMLsingular [Watt] {\handlePMLunit\Watt}
+\defineXMLsingular [Celsius] {\handlePMLunit\Celsius}
+\defineXMLsingular [Kelvin] {\handlePMLunit\Kelvin}
+\defineXMLsingular [Fahrenheit] {\handlePMLunit\Fahrenheit}
+\defineXMLsingular [Mol] {\handlePMLunit\Mol}
+\defineXMLsingular [Molair] {\handlePMLunit\Molair}
+\defineXMLsingular [Equivalent] {\handlePMLunit\Equivalent}
+\defineXMLsingular [Farad] {\handlePMLunit\Farad}
+\defineXMLsingular [Ohm] {\handlePMLunit\Ohm}
+\defineXMLsingular [Siemens] {\handlePMLunit\Siemens}
+\defineXMLsingular [Ampere] {\handlePMLunit\Ampere}
+\defineXMLsingular [Coulomb] {\handlePMLunit\Coulomb}
+\defineXMLsingular [Volt] {\handlePMLunit\Volt}
+\defineXMLsingular [eVolt] {\handlePMLunit\eVolt}
+\defineXMLsingular [Tesla] {\handlePMLunit\Tesla}
+\defineXMLsingular [VoltAC] {\handlePMLunit\VoltAC}
+\defineXMLsingular [VoltDC] {\handlePMLunit\VoltDC}
+\defineXMLsingular [Baud] {\handlePMLunit\Baud}
+\defineXMLsingular [Bit] {\handlePMLunit\Bit}
+\defineXMLsingular [Byte] {\handlePMLunit\Byte}
+\defineXMLsingular [Bequerel] {\handlePMLunit\Bequerel}
+\defineXMLsingular [Sievert] {\handlePMLunit\Sievert}
+\defineXMLsingular [Candela] {\handlePMLunit\Candela}
+\defineXMLsingular [Bell] {\handlePMLunit\Bell}
+\defineXMLsingular [At] {\handlePMLunit\At}
+\defineXMLsingular [Atm] {\handlePMLunit\Atm}
+\defineXMLsingular [Bar] {\handlePMLunit\Bar}
+\defineXMLsingular [EVolt] {\handlePMLunit\EVolt}
+\defineXMLsingular [Foot] {\handlePMLunit\Foot}
+\defineXMLsingular [Inch] {\handlePMLunit\Inch}
+\defineXMLsingular [Cal] {\handlePMLunit\Cal}
+\defineXMLsingular [Force] {\handlePMLunit\Force}
+\defineXMLsingular [Lux] {\handlePMLunit\Lux}
+\defineXMLsingular [Gray] {\handlePMLunit\Gray}
+\defineXMLsingular [Weber] {\handlePMLunit\Weber}
+\defineXMLsingular [Henry] {\handlePMLunit\Henry}
+\defineXMLsingular [Sterant] {\handlePMLunit\Sterant}
+\defineXMLsingular [Angstrom] {\handlePMLunit\Angstrom}
+\defineXMLsingular [Gauss] {\handlePMLunit\Gauss}
+
+\defineXMLsingular [Percent] {\handlePMLunit\Percent}
+\defineXMLsingular [Promille] {\handlePMLunit\Promille}
+\defineXMLsingular [Permille] {\handlePMLunit\Permille}
+
+\defineXMLsingular [Unit] {\handlePMLunit\Unit}
+\defineXMLsingular [NoUnit] {\handlePMLunit\NoUnit}
+
+\protect \doifnotmode{demo}{\endinput}
+
+\starttext
+
+\startXMLdata
+<phys>
+ <apply> <times/>
+ <cn> 1 </cn>
+ <ci><unit><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
+ </apply>
+</phys>
+\stopXMLdata
+
+\startXMLdata
+<phys>
+ <apply> <divide/>
+ <cn> 2 </cn>
+ <ci> <unit><Unit/><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
+ </apply>
+</phys>
+\stopXMLdata
+
+\startXMLdata
+<phys>
+ <apply> <times/>
+ <cn> 3 </cn>
+ <ci> <unit> <Milli/> <Sec/> <Per/> <Square/> <Kilo/> <Meter/> </unit> </ci>
+ </apply>
+</phys>
+\stopXMLdata
+
+\startXMLdata
+<phys>
+ <apply> <times/>
+ <cn> 4 </cn>
+ <ci> <unit><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
+ </apply>
+</phys>
+\stopXMLdata
+
+\startXMLdata
+<phys>
+ <apply> <times/>
+ <cn> 5 </cn>
+ <ci> <unit> <Milli/> <Sec/> <Per/> <Square/> <Kilo/> <Meter/> </unit> </ci>
+ </apply>
+</phys>
+\stopXMLdata
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/x-om2cml.xsl b/Master/texmf-dist/tex/context/base/x-om2cml.xsl
new file mode 100644
index 00000000000..acd95db2c10
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-om2cml.xsl
@@ -0,0 +1,1258 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ This style sheet is used in the Math4All project. This project
+ will provide an on-line math method for secondary and tertiary
+ education. In addition to the web-bases content the project
+ provides high quality typeset output as well.
+
+ This stylesheet is a copy of the one used by the group of Arjeh
+ Cohen (TU Eindhoven). This steet has multiple authors: David
+ Carlisle, and Clare M. So and Hans Cuypers (also see notice
+ below.)
+
+ In due time we may extend this sheet with options needed for the
+ project (alternative rendering, additional dictionaries).
+
+ Hans Hagen, PRAGMA ADE, Hasselt NL / 2006-04-14
+
+-->
+
+<!-- ********************************************************** -->
+<!-- XSL Transform of OpenMath to Content MathML -->
+<!-- (Based on initial version by David Carlisle) -->
+<!-- -->
+<!-- Author: Clare M. So <clare@scl.csd.uwo.ca> -->
+<!-- -->
+<!-- May to August 2002 -->
+<!-- -->
+<!-- (Last updated July 9, 2003) -->
+<!-- ********************************************************** -->
+
+<!-- ********************************************************** -->
+<!-- CHANGE LOG -->
+<!-- ********************************************************** -->
+<!-- May 13, 2003 - Add template nthdiff of calculus1 CD -->
+<!-- May 14, 2003 - Add templates for moreerrors CD -->
+<!-- May 15, 2003 - Split templates for multiset1, set1, -->
+<!-- and list1 CDs -->
+<!-- Split templates for s_dist1 and s_data1 CDs -->
+<!-- June 4, 2003 - Fix bugs in splitting set1, multiset1, and -->
+<!-- set1 CDs -->
+<!-- - Add templates for transc3 CD -->
+<!-- July 9, 2003 - Add template for nthdiff -->
+
+<!-- Special MathML entities -->
+
+<!DOCTYPE stylesheet [
+<!ENTITY pi "&#x003C0;">
+<!ENTITY e "&#x02147E;">
+<!ENTITY ee "&#x02147E;">
+<!ENTITY ExponentialE "&#x02147E;">
+<!ENTITY ImaginaryI "&#x02148;">
+<!ENTITY ii "&#x02148;">
+<!ENTITY gamma "&#x003B3;">
+<!ENTITY infin "&#x0221E;">
+<!ENTITY infty "&#x0221E;">
+<!ENTITY true "&#xF0002;">
+<!ENTITY false "&#xF0003;">
+<!ENTITY NotANumber "&#xF0001;">
+<!ENTITY NaN "&#xF0001;">
+]>
+
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:om="http://www.openmath.org/OpenMath"
+ xmlns="http://www.w3.org/1998/Math/MathML"
+ exclude-result-prefixes="om"
+ version="1.0">
+
+ <!-- xsl:output method="xml" indent="yes"/ -->
+ <xsl:output method="xml"/>
+
+ <xsl:strip-space elements="*"/>
+
+ <xsl:variable name="defaultOMSpriority">-10</xsl:variable>
+
+ <!-- **************************************************** -->
+ <!-- ****************** Basic Elements ****************** -->
+ <!-- **************************************************** -->
+
+ <!-- OMOBJ (D. Carlisle) -->
+ <xsl:template match="om:OMOBJ">
+ <math>
+ <xsl:apply-templates/>
+ </math>
+ </xsl:template>
+
+ <!-- OMI (D. Carlisle) -->
+ <xsl:template match="om:OMI">
+ <cn type="integer">
+ <xsl:variable name="x" select="normalize-space(.)"/>
+ <xsl:choose>
+ <xsl:when test="contains($x,'x')">
+ <xsl:attribute name="base">16</xsl:attribute>
+ <xsl:value-of select="concat(substring-before($x,'x'),substring-after($x,'x'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$x"/> <!-- default is decimal -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </cn>
+ </xsl:template>
+
+ <!-- OMV (D. Carlisle) -->
+ <xsl:template match="om:OMV">
+ <ci>
+ <xsl:value-of select="normalize-space(@name)"/>
+ </ci>
+ </xsl:template>
+
+ <!-- OMF (decimal) -->
+ <xsl:template match="om:OMF[@dec]">
+ <cn>
+ <xsl:value-of select="normalize-space(@dec)"/>
+ </cn>
+ </xsl:template>
+
+ <!-- OMF (hex) -->
+ <xsl:template match="om:OMF[@hex]">
+ <cn base="16">
+ <xsl:value-of select="normalize-space(@hex)"/>
+ </cn>
+ </xsl:template>
+
+ <!-- OMA (D. Carlisle) -->
+ <xsl:template match="om:OMA">
+ <apply>
+ <xsl:apply-templates/>
+ </apply>
+ </xsl:template>
+
+ <!-- OMB -->
+ <!-- Note: No Content MathML equivalent -->
+ <xsl:template match="om:OMB">
+ <mtext definitionURL="http://www.openmath.org/objects#OMB">
+ <xsl:value-of select="."/>
+ </mtext>
+ </xsl:template>
+
+ <!-- OMSTR (D. Carlisle) -->
+ <!-- Note: mtext is a presentational MathML tag -->
+ <xsl:template match="om:OMSTR">
+ <mtext>
+ <xsl:value-of select="."/>
+ </mtext>
+ </xsl:template>
+
+ <!-- ***************************************************** -->
+ <!-- ****************** MathML group ******************** -->
+ <!-- ***************************************************** -->
+
+ <!-- Content Dicitionary: alg1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: zero, one -->
+
+ <!-- Trivial cases: none -->
+ <xsl:template match="om:OMS[@cd='alg1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- zero -->
+ <xsl:template match="om:OMS[@cd='alg1' and @name='zero']">
+ <cn type="integer">0</cn>
+ </xsl:template>
+
+ <!-- one -->
+ <xsl:template match="om:OMS[@cd='alg1' and @name='one']">
+ <cn type="integer">1</cn>
+ </xsl:template>
+
+ <!-- Content Dictionary: arith1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD conatains: abs, divide, gcd, lcm, minus, plus, power, product,
+ root, sum, unary_minus -->
+
+ <!-- Trivial Cases: abs, divide, gcd, lcm, minus, plus -->
+ <xsl:template match="om:OMS[@cd='arith1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- unary_minus -->
+ <xsl:template match="om:OMS[@cd='arith1' and @name='unary_minus']">
+ <minus/>
+ </xsl:template>
+
+ <!-- root -->
+ <xsl:template match="om:OMA[om:OMS[@cd='arith1' and @name='root']]">
+ <apply>
+ <root/>
+ <degree>
+ <xsl:apply-templates select="*[3]"/>
+ </degree>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- sum and product -->
+ <xsl:template match="om:OMA[om:OMS[@cd='arith1' and (@name='sum' or @name='product')]]">
+ <apply>
+ <xsl:element name="{om:OMS[1]/@name}"/>
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/> <!-- the bounded var is in the func -->
+ </xsl:apply-templates>
+ </bvar>
+ <xsl:apply-templates select="*[2]"/> <!-- range of product/summation -->
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: bigfloat1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: bigfloat, bigfloatprec -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- bigfloat -->
+ <xsl:template match="om:OMA[om:OMS[@cd='bigfloat1' and @name='bigfloat']]">
+ <apply>
+ <times/>
+ <xsl:apply-templates select="*[2]"/>
+ <apply>
+ <power/>
+ <xsl:apply-templates select="*[3]"/>
+ <xsl:apply-templates select="*[4]"/>
+ </apply>
+ </apply>
+ </xsl:template>
+
+ <!-- bigfloatprec -->
+ <!-- Note: No Content MathML equivalent -->
+ <xsl:template match="om:OMS[@cd='bigfloat1' and @name='bigfloatprec']">
+ <csymbol encoding="OpenMath"
+ definitionURL="http://www.openmath.org/cd/bigfloat1#bigfloatprec"/>
+ </xsl:template>
+
+ <!-- Content Dictionary: calculus1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: defint, diff, int, nthdiff, partialdiff -->
+
+ <!-- Trivial cases: partialdiff -->
+ <xsl:template match="om:OMS[@cd='calculus1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- diff, int -->
+ <xsl:template match="om:OMA[om:OMS[@cd='calculus1' and (@name='diff' or @name='int')]]">
+ <apply>
+ <xsl:element name="{om:OMS[1]/@name}"/>
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="2"/>
+ </xsl:apply-templates>
+ </bvar>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- defint -->
+ <xsl:template match="om:OMA[om:OMS[@cd='calculus1' and @name='defint']]">
+ <apply>
+ <int/> <!-- pretty much the same as sum and product... CHECK domainofapp -->
+ <bvar> <!-- perphaps write a method for the similar parts... -->
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/>
+ </xsl:apply-templates>
+ </bvar>
+ <xsl:apply-templates select="*[2]"/> <!-- range of diff -->
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- nthdiff -->
+ <xsl:template match="om:OMA[om:OMS[@cd='calculus1' and @name='nthdiff']]">
+ <apply>
+ <diff/>
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="*[2]"/>
+ </bvar>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionaries: complex1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: argument, complex_cartesian, complex_polar, conjugate,
+ imaginary, real -->
+
+ <!-- Trivial cases: conjugate, imaginary, real -->
+ <xsl:template match="om:OMS[@cd='complex1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- argument -->
+ <xsl:template match="om:OMS[@cd='complex1' and @name='argument']">
+ <arg/>
+ </xsl:template>
+
+ <!-- complex_cartesian or complex_polar -->
+ <xsl:template match="om:OMA[om:OMS[@cd='complex1' and (@name='complex_cartesian' or @name='complex_polar')]]">
+ <xsl:variable name="type_name" select="translate(om:OMS[1]/@name,'_','-')"/>
+ <xsl:choose>
+ <xsl:when test="child::om:OMV or child::om:OMA">
+ <apply>
+ <csymbol definitionURL="{concat('http://www.openmath.org/cd/complex1#',om:OMS[1]/@name)}"/>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:when>
+ <xsl:otherwise>
+ <cn type="{$type_name}">
+ <xsl:apply-templates select="*[2]" mode="convert"/>
+ <sep/>
+ <xsl:apply-templates select="*[3]" mode="convert"/>
+ </cn>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Content Dictionary: fns1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: domain, domainofapplication, identity, image, inverse,
+ lambda, left_compose, left_inverse, right_inverse -->
+
+ <!-- Trivial cases: domain, image, inverse -->
+ <xsl:template match="om:OMS[@cd='fns1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- domainofapplication -->
+ <xsl:template match="om:OMA[om:OMS[@cd='fns1' and @name='domainofapplication']]">
+ <domainofapplication>
+ <xsl:apply-templates select="*[2]"/>
+ </domainofapplication>
+ </xsl:template>
+
+ <!-- identity -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='identity']">
+ <ident/>
+ </xsl:template>
+
+ <!-- lambda -->
+ <xsl:template match="om:OMBIND[om:OMS[@cd='fns1' and @name='lambda']]">
+ <lambda>
+ <xsl:for-each select="om:OMBVAR/child::om:OMV">
+ <bvar>
+ <xsl:apply-templates select="."/>
+ </bvar>
+ </xsl:for-each>
+ <xsl:apply-templates select="*[3]"/>
+ </lambda>
+ </xsl:template>
+
+ <!-- range -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='range']">
+ <codomain/>
+ </xsl:template>
+
+ <!-- left_compose -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='left_compose']">
+ <compose/>
+ </xsl:template>
+
+ <!-- left_inverse -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='left_inverse']">
+ <inverse/>
+ </xsl:template>
+
+ <!-- right_inverse -->
+ <!-- Note: No Content MathML equivalent -->
+ <xsl:template match="om:OMS[@cd='fns1' and @name='right_inverse']">
+ <inverse encoding="OpenMath" definitionURL="http://www.openmath.org/cd/fns1#right_inverse"/>
+ </xsl:template>
+
+ <!-- Content Dictionary: integer1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: factorial, factorof, quotient, remainder -->
+
+ <!-- Trivial cases: factorof, factorial, quotient -->
+ <xsl:template match="om:OMS[@cd='integer1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- remainder -->
+ <xsl:template match="om:OMS[@cd='integer1' and @name='remainder']">
+ <rem/>
+ </xsl:template>
+
+ <!-- Content Dictionary: interval1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: integer_interval, interval, interval_oo, interval_cc,
+ interval_oc, interval_co -->
+
+ <!-- Trivial case: none -->
+
+ <!-- (All) -->
+ <xsl:template match="om:OMA[om:OMS[@cd='interval1']]">
+ <interval>
+ <xsl:choose>
+ <xsl:when test="om:OMS[1]/@name='interval_oo'">
+ <xsl:attribute name='closure'>open</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[1]/@name='interval_cc'">
+ <xsl:attribute name='closure'>closed</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[1]/@name='interval_oc'">
+ <xsl:attribute name='closure'>open-closed</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[1]/@name='interval_co'">
+ <xsl:attribute name='closure'>closed-open</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="*[3]"/>
+ </interval>
+ </xsl:template>
+
+ <!-- Content Dictionary: linalg1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: determinant, matrix_selector, outerproduct,
+ scalarproduct, transpose, vector_selector, vector_product -->
+
+ <!-- Trivial cases: determinant, outerproduct, scalarproduct, transpose,
+ vectorproduct -->
+ <xsl:template match="om:OMS[@cd='linalg1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- vector_selector -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg1' and @name='vector_selector']]">
+ <apply>
+ <selector/>
+ <xsl:apply-templates select="*[3]"/> <!-- the vector -->
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- matrix_selector -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg1' and @name='matrix_selector']]">
+ <apply>
+ <selector/>
+ <xsl:apply-templates select="*[4]"/> <!-- the matrix -->
+ <xsl:apply-templates select="*[3]"/>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: linalg2 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: matrix, matrixrow, vector -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- matrixrow, matrix -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg2']]">
+ <xsl:element name="{om:OMS[1]/@name}">
+ <xsl:apply-templates select="*[position()>1]"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- (row) vector -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg2' and @name='vector']]">
+ <apply>
+ <transpose/>
+ <vector>
+ <xsl:apply-templates select="*[position()>1]"/>
+ </vector>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: limit1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: above, below, bothsides, limit, null -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- both_sides, above, below, null -->
+ <xsl:template match="om:OMA[om:OMS[@cd='limit1']]">
+ <apply>
+ <limit/>
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="4"/>
+ </xsl:apply-templates>
+ </bvar>
+ <xsl:choose>
+ <xsl:when test="om:OMS[2]/@name='null'">
+ <lowlimit>
+ <xsl:apply-templates select="*[2]"/>
+ </lowlimit>
+ </xsl:when>
+ <xsl:otherwise>
+ <condition>
+ <apply>
+ <tendsto>
+ <xsl:choose>
+ <xsl:when test="om:OMS[2]/@name='both_sides'">
+ <xsl:attribute name="type">all</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[2]/@name='above'">
+ <xsl:attribute name="type">above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="om:OMS[2]/@name='below'">
+ <xsl:attribute name="type">below</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </tendsto>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="4"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </condition>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="*[4]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: list1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: list, map, suchthat -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- list -->
+ <xsl:template match="om:OMA[om:OMS[@cd='list1' and @name='list']]">
+ <list>
+ <xsl:apply-templates select="*[position()>1]"/>
+ </list>
+ </xsl:template>
+
+ <!-- map -->
+ <xsl:template match="om:OMA[om:OMS[@cd='list1' and @name='map']]">
+ <list>
+ <xsl:apply-templates select="." mode="map"/>
+ </list>
+ </xsl:template>
+
+ <!-- suchthat -->
+ <xsl:template match="om:OMA[om:OMS[@cd='list1' and @name='suchthat']]">
+ <list>
+ <xsl:apply-templates select="." mode="suchthat"/>
+ </list>
+ </xsl:template>
+
+ <!-- Content Dictionary: logic1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: and, equivalent, false, implies, not, or, true, xor -->
+
+ <!-- Trivial cases: all -->
+ <xsl:template match="om:OMS[@cd='logic1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- Content Dictionary: mathmltypes -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: complex_cartesian_type, complex_polar_type, constant_type,
+ fn_type, integer_type, list_type, matrix_type, rational_type, real_type,
+ set_type, type, vector_type -->
+
+ <!-- (All mathmltypes elements) -->
+ <xsl:template match="om:OMATTR[om:OMATP[om:OMS[@cd='mathmltypes' and @name='type']]]">
+ <xsl:variable name="type_name" select="normalize-space(translate(substring-before(om:OMATP/om:OMS[2]/@name,'_type'),'_','-'))"/>
+ <xsl:choose>
+ <xsl:when test="*[2]=om:OMV">
+ <ci type="{$type_name}">
+ <xsl:value-of select="normalize-space(*[2]/@name)"/>
+ </ci>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMI">
+ <cn type="{$type_name}">
+ <xsl:variable name="x" select="normalize-space(*[2])"/>
+ <xsl:choose>
+ <xsl:when test="contains($x,'x')">
+ <xsl:attribute name="base">16</xsl:attribute>
+ <xsl:value-of select="concat(substring-before($x,'x'),substring-after($x,'x'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$x"/> <!-- default is decimal -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </cn>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMF[@dec]">
+ <cn type="{$type_name}">
+ <xsl:value-of select="normalize-space(*[2]/@dec)"/>
+ </cn>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMF[@hex]">
+ <cn type="{$type_name}" base="16">
+ <xsl:value-of select="normalize-space(*[2]/@hex)"/>
+ </cn>
+ </xsl:when>
+ <xsl:otherwise> <!-- MathML cannot add type attribute to other objects -->
+ <xsl:comment>
+ Content MathML cannot add type <xsl:value-of select="$type_name"/> for the object after this comment.
+ </xsl:comment>
+ <xsl:apply-templates select="*[2]"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Content Dictionary: minmax1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: max, min -->
+ <xsl:template match="om:OMS[@cd='minmax1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- Trivial cases: none -->
+
+ <!-- max, min -->
+ <xsl:template match="om:OMA[om:OMS[@cd='minmax1']]">
+ <apply>
+ <xsl:element name="{om:OMS/@name}"/>
+ <xsl:choose>
+ <xsl:when test="*[2]=om:OMA[om:OMS[@cd='set1' and @name='set']]">
+ <xsl:apply-templates select="om:OMA/*[position()>1]"/>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMA[om:OMS[@cd='multiset1' and @name='multiset']]">
+ <xsl:apply-templates select="om:OMA/*[position()>1]"/>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMA[om:OMS[@cd='set1' and @name='suchthat']]">
+ <xsl:apply-templates select="*[2]" mode="suchthat"/>
+ </xsl:when>
+ <xsl:when test="*[2]=om:OMA[om:OMS[@cd='set1' and @name='map']]">
+ <xsl:apply-templates select="*[2]" mode="map"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <bvar><ci>x</ci></bvar>
+ <condition>
+ <apply>
+ <in/>
+ <ci>x</ci>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </condition>
+ </xsl:otherwise>
+ </xsl:choose>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: multiset1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: cartesian_product, emptyset, in, intersect, multiset,
+ notin, notprsubset, notsubset, prsubset, setdiff, size, subset, union -->
+
+ <!-- Trivial cases: emptyset, in, interset, notin, notprsubset, notsubset, prsubset,
+ subset, union -->
+ <xsl:template match="om:OMS[@cd='multiset1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- cartesian_product -->
+ <xsl:template match="om:OMS[@cd='multiset1' and @name='cartesian_product']">
+ <cartesianproduct/>
+ </xsl:template>
+
+
+ <!-- multiset -->
+ <xsl:template match="om:OMA[om:OMS[@cd='multiset1' and @name='multiset']]">
+ <set type="multiset">
+ <xsl:apply-templates select="*[position()>1]"/>
+ </set>
+ </xsl:template>
+
+ <!-- size -->
+ <xsl:template match="om:OMS[@cd='multiset1' and @name='size']">
+ <card/>
+ </xsl:template>
+
+ <!-- Content Dictionary: nums1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains based_integer, e, gamma, i, infinity, NaN, pi, rational -->
+
+ <!-- Trivial cases: pi, infinity -->
+ <xsl:template match="om:OMS[@cd='nums1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- based_integer -->
+ <!-- Note: Content MathML does not support base that is represented by a variable -->
+ <xsl:template match="om:OMA[om:OMS[@cd='nums1' and @name='based_integer']]">
+ <xsl:choose>
+ <xsl:when test="*[2]=om:OMV">
+ <apply>
+ <csymbol encoding="OpenMath" definitionURL="http://www.openmath.org/cd/nums1#based_integer"/>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:when>
+ <xsl:otherwise>
+ <cn type="integer" base="{normalize-space(*[2])}">
+ <xsl:value-of select="normalize-space(om:OMSTR)"/>
+ </cn>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- e -->
+ <xsl:template match="om:OMS[@cd='nums1' and @name='e']">
+ <exponentiale/>
+ </xsl:template>
+
+ <!-- gamma -->
+ <xsl:template match="om:OMS[@cd='nums1' and @name='gamma']">
+ <eulergamma/>
+ </xsl:template>
+
+ <!-- i -->
+ <xsl:template match="om:OMS[@cd='nums1' and @name='i']">
+ <imaginaryi/>
+ </xsl:template>
+
+ <!-- NaN -->
+ <xsl:template match="om:OMS[@cd='nums1' and @name='NaN']">
+ <notanumber/>
+ </xsl:template>
+
+ <!-- rational -->
+ <!-- Note: Content MathML does not support rational numbers that are
+ made up of variables or other mathematical objects -->
+ <xsl:template match="om:OMA[om:OMS[@cd='nums1' and @name='rational']]">
+ <xsl:choose>
+ <xsl:when test="child::om:OMV or child::om:OMA">
+ <apply>
+ <csymbol definitionURL="http://www.openmath.org/cd/nums1#rational"/>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:when>
+ <xsl:otherwise>
+ <cn type="rational">
+ <xsl:apply-templates select="*[2]" mode="convert"/>
+ <sep/>
+ <xsl:apply-templates select="*[3]" mode="convert"/>
+ </cn>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Content Dictionary: piece1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: otherwise, piece, piecewise -->
+
+ <!-- Trivial cases: (All of the OMSs here are almost trivial, except
+ that these functions are used without "apply" in Content MathML) -->
+
+ <!-- piecewise, piece, otherwise -->
+ <xsl:template match="om:OMA[om:OMS[@cd='piece1']]">
+ <xsl:element name="{om:OMS/@name}">
+ <xsl:apply-templates select="*[position()>1]"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Content Dictionary: quant1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: forall, exists -->
+
+ <!-- forall,exists -->
+ <xsl:template match="om:OMBIND[om:OMS[@cd='quant1']]">
+ <apply>
+ <xsl:element name="{om:OMS[1]/@name}"/>
+ <xsl:for-each select="om:OMBVAR/om:OMV">
+ <bvar>
+ <xsl:apply-templates select="."/>
+ </bvar>
+ </xsl:for-each>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: relation1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: approx, eq, geq, gt, leq, lt, neq -->
+
+ <!-- Trivial cases: all -->
+
+ <xsl:template match="om:OMS[@cd='relation1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- Content Dictionary: setname1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: C, N, P, Q, R, Z -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- P -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='P']">
+ <primes/>
+ </xsl:template>
+
+ <!-- N -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='N']">
+ <naturalnumbers/>
+ </xsl:template>
+
+ <!-- Z -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='Z']">
+ <integers/>
+ </xsl:template>
+
+ <!-- Z -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='Q']">
+ <rationals/>
+ </xsl:template>
+
+ <!-- R -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='R']">
+ <reals/>
+ </xsl:template>
+
+ <!-- C -->
+ <xsl:template match="om:OMS[@cd='setname1' and @name='C']">
+ <complexes/>
+ </xsl:template>
+
+ <!-- Content Dictionary: rounding1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: ceiling, floor, round, trunc -->
+
+ <!-- Trivial Cases: ceiling, floor -->
+ <xsl:template match="om:OMS[@cd='rounding1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- trunc -->
+ <xsl:template match="om:OMA[om:OMS[@cd='rounding1' and @name='trunc']]">
+ <apply>
+ <quotient/>
+ <xsl:apply-templates select="*[2]"/>
+ <cn>1</cn>
+ </apply>
+ </xsl:template>
+
+ <!-- round -->
+ <xsl:template match="om:OMA[om:OMS[@cd='rounding1' and @name='round']]">
+ <piecewise>
+ <piece>
+ <apply>
+ <floor/>
+ <apply>
+ <plus/>
+ <cn>0.5</cn>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </apply>
+ <apply>
+ <geq/>
+ <xsl:apply-templates select="*[2]"/>
+ <cn>0</cn>
+ </apply>
+ </piece>
+ <piece>
+ <apply>
+ <ceiling/>
+ <apply>
+ <minus/>
+ <xsl:apply-templates select="*[2]"/>
+ <cn>0.5</cn>
+ </apply>
+ </apply>
+ <apply>
+ <lt/>
+ <xsl:apply-templates select="*[2]"/>
+ <cn>0</cn>
+ </apply>
+ </piece>
+ </piecewise>
+ </xsl:template>
+
+ <!-- Content Dictionary: set1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: cartesian_product, emptyset, in, intersect, map, notin,
+ notprsubset, notsubset, prsubset, set, setdiff, size, subset, suchthat, union -->
+
+ <!-- Trivial cases: emptyset, in, intersect, notin, notprsubset, notsubset, prsubset
+ setdiff, subset, union -->
+ <xsl:template match="om:OMS[@cd='set1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- cartesian_product -->
+ <xsl:template match="om:OMS[@cd='set1' and @name='cartesian_product']">
+ <cartesianproduct/>
+ </xsl:template>
+
+ <!-- map -->
+ <xsl:template match="om:OMA[om:OMS[@cd='set1' and @name='map']]">
+ <set>
+ <xsl:apply-templates select="." mode="map"/>
+ </set>
+ </xsl:template>
+
+ <!-- size -->
+ <xsl:template match="om:OMS[@cd='set1' and @name='size']">
+ <card/>
+ </xsl:template>
+
+ <!-- suchthat -->
+ <xsl:template match="om:OMA[om:OMS[@cd='set1' and @name='suchthat']]">
+ <set>
+ <xsl:apply-templates select="." mode="suchthat"/>
+ </set>
+ </xsl:template>
+
+ <!-- Content Dictionary: s_data1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: mean, median, mode, moment, sdev, variance -->
+
+ <!-- Trivial cases: mean, median, mode, sdev, variance -->
+ <xsl:template match="om:OMS[@cd='s_data1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- moment -->
+ <xsl:template match="om:OMA[om:OMS[@cd='s_data1' and @name='moment']]">
+ <apply>
+ <moment/>
+ <degree>
+ <xsl:apply-templates select="*[2]"/>
+ </degree>
+ <momentabout>
+ <xsl:apply-templates select="*[3]"/>
+ </momentabout>
+ <xsl:apply-templates select="*[position()>3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: s_dist1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: mean, moment, sdev, variance -->
+
+ <!-- Trivial cases: mean, sdev, variance -->
+ <xsl:template match="om:OMS[@cd='s_dist1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- moment -->
+ <xsl:template match="om:OMA[om:OMS[@cd='s_dist1' and @name='moment']]">
+ <apply>
+ <moment/>
+ <degree>
+ <xsl:apply-templates select="*[2]"/>
+ </degree>
+ <momentabout>
+ <xsl:apply-templates select="*[3]"/>
+ </momentabout>
+ <xsl:apply-templates select="*[position()>3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: transc1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: arccos, arccosh, arccot, arccoth, arccsc,
+ arccsch, arcsec, arcsech, arcsin, arcsinh, arctan, arctanh, cos,
+ cosh, cot, coth, csc, csch, exp, ln, log, sec, sech, sin, sinh,
+ tan, tanh -->
+
+ <!-- Trivial cases: all except log -->
+ <xsl:template match="om:OMS[@cd='transc1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- log -->
+ <xsl:template match="om:OMA[om:OMS[@cd='transc1' and @name='log']]">
+ <apply>
+ <log/>
+ <logbase>
+ <xsl:apply-templates select="*[2]"/>
+ </logbase>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- Content Dictionary: veccalc1 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: curl, divergence, grad, Laplacian -->
+
+ <!-- Trivial cases: all except Laplacian -->
+ <xsl:template match="om:OMS[@cd='veccalc1']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- Laplacian -->
+ <!-- Note: Capital "L" -->
+ <xsl:template match="om:OMS[@cd='veccalc1' and @name='Laplacian']">
+ <laplacian/>
+ </xsl:template>
+
+ <!-- Content Dictionary: altenc -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: LaTeX_encoding, MathML_encoding -->
+
+ <!-- Trivial cases: none -->
+
+ <!-- (Everything in altenc) -->
+ <xsl:template match="om:OMATTR[om:OMATP[om:OMS[@cd='altenc']]]">
+ <semantics>
+ <xsl:apply-templates select="*[2]"/>
+ <xsl:apply-templates select="om:OMATP/child::om:OMS"/>
+ </semantics>
+ </xsl:template>
+
+ <!-- MathML_encoding -->
+ <xsl:template match="om:OMS[@cd='altenc' and @name='MathML_encoding']">
+ <annotation-xml encoding="MathML">
+ <xsl:value-of select="normalize-space(following-sibling::*[position()=1])"/> <!-- OMXML or OMSTR-->
+ </annotation-xml>
+ </xsl:template>
+
+ <!-- LaTeX_encoding -->
+ <xsl:template match="om:OMS[@cd='altenc' and @name='LaTeX_encoding']">
+ <annotation encoding="LaTeX">
+ <xsl:value-of select="normalize-space(following::om:OMSTR)"/>
+ </annotation>
+ </xsl:template>
+
+ <!-- **************************************************** -->
+ <!-- ************** Not in MathML group CDs ************* -->
+ <!-- **************************************************** -->
+
+ <!-- Everything below should not be handled by the Trivial case!) -->
+
+ <!-- Content Dictionary: linalg3 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- (column) vector -->
+ <xsl:template match="om:OMA[om:OMS[@cd='linalg3' and @name='vector']]">
+ <vector>
+ <xsl:apply-templates select="*[position()>1]"/>
+ </vector>
+ </xsl:template>
+
+ <!-- Content Dictionary: arith2 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: inverse, times -->
+
+ <!-- times -->
+ <!-- Note: This function is n-ary just like MathML! -->
+ <xsl:template match="om:OMS[@cd='arith2' and @name='times']">
+ <times/>
+ </xsl:template>
+
+ <!-- Content Dictionary: error -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- (all errors) -->
+ <xsl:template match="om:OME">
+ <mtext>
+ <xsl:text>ERROR:</xsl:text>
+ <xsl:text> Error Type: </xsl:text><xsl:value-of select="om:OMS[1]/@name"/>
+ <xsl:text> Error occured in CD: </xsl:text><xsl:value-of select="om:OMS[2]/@cd"/>
+ <xsl:text> Error occured in symbol: </xsl:text><xsl:value-of select="om:OMS[2]/@name"/>
+ </mtext>
+ </xsl:template>
+
+ <!-- Content Dictionary: moreerrors -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: algorithm, asynchronousError, encodingError, limitation,
+ unexpected -->
+
+ <!-- (all) -->
+ <xsl:template match="om:OMA[om:OMS[@cd='moreerrors']]">
+ <mtext>
+ <xsl:text>ERROR:</xsl:text>
+ <xsl:text> Error Type: </xsl:text><xsl:value-of select="normalize-space(om:OMS/@name)"/>
+ <xsl:text> Description: </xsl:text><xsl:value-of select="normalize-space(om:OMSTR)"/>
+ </mtext>
+ </xsl:template>
+
+ <!-- Content Dicitionary: transc3 -->
+ <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+
+ <!-- This CD contains: arccos, arccosh, arccot, arccoth, arccsc, arccsch,
+ arcsec, arcsech, arcsin, arcsinh, arctan, arctanh, ln, log -->
+
+ <!-- (all except log) -->
+ <xsl:template match="om:OMS[@cd='transc3']">
+ <xsl:element name="{@name}"/>
+ </xsl:template>
+
+ <!-- log -->
+ <xsl:template match="om:OMA[om:OMS[@cd='transc3' and @name='log']]">
+ <apply>
+ <log/>
+ <logbase>
+ <xsl:apply-templates select="*[3]"/>
+ </logbase>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </xsl:template>
+
+ <!-- **************************************************** -->
+ <!-- **************** EVERYTHING ELSE ******************* -->
+ <!-- **************************************************** -->
+
+ <!-- Note: Rather than hard code all of the CDs, I just assign the lowest
+ priority among all templates. -->
+
+ <xsl:template match="om:OMS[@cd and @name]" priority="-10">
+ <csymbol>
+ <xsl:attribute name="definitionURL">
+ <xsl:value-of select="concat(concat(concat('http://www.openmath.org/cd/',@cd),'#'),@name)"/>
+ </xsl:attribute>
+ </csymbol>
+ </xsl:template>
+
+ <!-- **************************************************** -->
+ <!-- **************** HELPER TEMPLATES ****************** -->
+ <!-- **************************************************** -->
+
+ <!-- All mode "convert" templates are for converting OMSs or OMIs to
+ numbers including in various cn containing <sep/> -->
+
+ <xsl:template match="om:OMS[@cd='alg1' and @name='zero']" mode="convert">0</xsl:template>
+
+ <xsl:template match="om:OMS[@cd='alg1' and @name='one']" mode="convert">1</xsl:template>
+
+ <xsl:template match="om:OMS" mode="convert">
+ <xsl:choose>
+ <xsl:when test="@name='pi'">&pi;</xsl:when>
+ <xsl:when test="@name='i'">&ii;</xsl:when>
+ <xsl:when test="@name='NaN'">&NaN;</xsl:when>
+ <xsl:when test="@name='gamma'">&gamma;</xsl:when>
+ <xsl:when test="@name='e'">&ee;</xsl:when>
+ <xsl:when test="@name='true'">&true;</xsl:when>
+ <xsl:when test="@name='false'">&false;</xsl:when>
+ <xsl:when test="@name='infinity'">&infin;</xsl:when>
+ <xsl:otherwise><xsl:value-of select="normalize-space(.)"/></xsl:otherwise> <!-- for debugging -->
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="om:OMI" mode="convert">
+ <xsl:variable name="x" select="normalize-space(.)"/>
+ <xsl:choose>
+ <xsl:when test="contains($x,'x')">
+ <xsl:value-of select="concat(substring-before($x,'x'),substring-after($x,'x'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$x"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="om:OMF" mode="convert">
+ <xsl:value-of select="@*"/>
+ </xsl:template>
+
+ <!-- The following templates, with mode "map" and "suchthat", are used to contruct sets or lists
+ without enumerating every element -->
+
+ <xsl:template match="om:OMA" mode="map">
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="2"/>
+ </xsl:apply-templates>
+ </bvar>
+ <condition>
+ <apply>
+ <in/>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="2"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="*[3]"/>
+ </apply>
+ </condition>
+ <xsl:apply-templates select="*[2]"/>
+ </xsl:template>
+
+ <xsl:template match="om:OMA" mode="suchthat">
+ <bvar>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/>
+ </xsl:apply-templates>
+ </bvar>
+ <condition>
+ <apply>
+ <and/>
+ <xsl:apply-templates select="*[3]"/>
+ <apply>
+ <in/>
+ <xsl:apply-templates select="." mode="getVar">
+ <xsl:with-param name="NUM" select="3"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="*[2]"/>
+ </apply>
+ </apply>
+ </condition>
+ </xsl:template>
+
+ <!-- This template is for getting bound variables (all variables in <OMBIND>) -->
+ <!-- Note: Default bound variable is "x" -->
+
+ <xsl:template match="om:OMA" mode="getVar">
+ <xsl:param name="NUM" select="3"/>
+ <xsl:choose>
+ <xsl:when test="*[$NUM]=om:OMBIND">
+ <xsl:apply-templates select="*[$NUM]/om:OMBVAR/om:OMV[position()>0]"/>
+ </xsl:when>
+ <xsl:otherwise> <!-- default -->
+ <ci>x</ci>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Added by Hans Hagen -->
+
+ <xsl:template match="om:OMS[@cd='altenc' and @name='TeX_encoding']">
+ <annotation encoding="TeX">
+ <xsl:value-of select="normalize-space(following::om:OMSTR)"/>
+ </annotation>
+ </xsl:template>
+
+ <xsl:template match="om:OMS[@cd='math4all' and @name]">
+ <csymbol>
+ <xsl:attribute name="definitionURL">
+ <xsl:value-of select="concat(concat(concat('http://www.openmath.org/cd/',@cd),'#'),@name)"/>
+ </xsl:attribute>
+ </csymbol>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/Master/texmf-dist/tex/context/base/x-openmath.tex b/Master/texmf-dist/tex/context/base/x-openmath.tex
new file mode 100644
index 00000000000..38474996e1b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-openmath.tex
@@ -0,0 +1,4 @@
+% This module is yet empty. We assume a transformation using
+% x-openmath.xsl.
+
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/x-openmath.xsl b/Master/texmf-dist/tex/context/base/x-openmath.xsl
new file mode 100644
index 00000000000..e91b83e51c6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-openmath.xsl
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output method="xml"/>
+
+ <!-- newline, temp hack, latest texexec handles it okay -->
+
+ <xsl:template match ="processing-instruction()"><xsl:copy/><xsl:text>
+ </xsl:text></xsl:template>
+
+ <!-- xsl:template match="*"><xsl:copy/></xsl:template -->
+ <!-- xsl:element name="{name(current())}"><xsl:apply-templates/></xsl:element -->
+
+<!--
+ <xsl:template match="*">
+ <xsl:copy>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </xsl:template>
+-->
+
+ <xsl:template match = "node()|@*" >
+ <xsl:copy>
+ <xsl:apply-templates select = "node()|@*" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="comment"></xsl:template>
+
+ <xsl:variable name='openmath-to-content-mathml'><value-of select='$stylesheet-path'/>/x-openmath.xsl</xsl:variable>
+
+ <xsl:include href="x-om2cml.xsl"/>
+
+</xsl:stylesheet>
diff --git a/Master/texmf-dist/tex/context/base/x-physml.xsd b/Master/texmf-dist/tex/context/base/x-physml.xsd
new file mode 100644
index 00000000000..865d88c58ed
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-physml.xsd
@@ -0,0 +1,172 @@
+<?xml version="1.0"?>
+
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+<xsd:annotation>
+ <xsd:documentation xml:lang="en">
+ This schema covers (basic presentational) Physics
+ markup. It combines the power of MathML and the ConTeXt
+ units engine.
+
+ author: Hans Hagen, copyright: PRAGMA-ADE / Hasselt NL
+ </xsd:documentation>
+</xsd:annotation>
+
+<xsd:complexType name="unit.power.type">
+ <xsd:element name="Inverse" minOccurs="0" maxOccurs="1" />
+ <xsd:choice>
+ <xsd:element name="Linear" />
+ <xsd:element name="Square" />
+ <xsd:element name="Cubic" />
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="unit.prefix.type">
+ <xsd:choice>
+ <xsd:element name="Atto" />
+ <xsd:element name="Femto" />
+ <xsd:element name="Pico" />
+ <xsd:element name="Nano" />
+ <xsd:element name="Micro" />
+ <xsd:element name="Milli" />
+ <xsd:element name="Centi" />
+ <xsd:element name="Deci" />
+ <xsd:element name="Hecto" />
+ <xsd:element name="Kilo" />
+ <xsd:element name="Mega" />
+ <xsd:element name="Giga" />
+ <xsd:element name="Terra" />
+ <xsd:element name="Peta" />
+ <xsd:element name="Exa" />
+
+ <xsd:element name="NoUnit" />
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="unit.midfix.type">
+ <xsd:choice>
+ <xsd:element name="Per" />
+ <xsd:element name="Times" />
+ <xsd:element name="Solidus" />
+ <xsd:element name="OutOf" />
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="unit.suffix.type">
+ <xsd:choice>
+ <xsd:element name="Ampere" />
+ <xsd:element name="Angstrom" />
+ <xsd:element name="At" />
+ <xsd:element name="Atm" />
+ <xsd:element name="Atom" />
+ <xsd:element name="Bar" />
+ <xsd:element name="Baud" />
+ <xsd:element name="Bell" />
+ <xsd:element name="Bequerel" />
+ <xsd:element name="Bit" />
+ <xsd:element name="Byte" />
+ <xsd:element name="Cal" />
+ <xsd:element name="Candela" />
+ <xsd:element name="Celsius" />
+ <xsd:element name="Coulomb" />
+ <xsd:element name="Day" />
+ <xsd:element name="Deg" />
+ <xsd:element name="Degrees" />
+ <xsd:element name="Equivalent" />
+ <xsd:element name="EVolt" />
+ <xsd:element name="eVolt" />
+ <xsd:element name="Fahrenheit" />
+ <xsd:element name="Farad" />
+ <xsd:element name="Foot" />
+ <xsd:element name="Force" />
+ <xsd:element name="Gauss" />
+ <xsd:element name="Gram" />
+ <xsd:element name="Gray" />
+ <xsd:element name="Henry" />
+ <xsd:element name="Hertz" />
+ <xsd:element name="Hour" />
+ <xsd:element name="Inch" />
+ <xsd:element name="Joule" />
+ <xsd:element name="Kelvin" />
+ <xsd:element name="Liter" />
+ <xsd:element name="Lux" />
+ <xsd:element name="Meter" />
+ <xsd:element name="Min" />
+ <xsd:element name="Mol" />
+ <xsd:element name="Molair" />
+ <xsd:element name="Month" />
+ <xsd:element name="Newton" />
+ <xsd:element name="Ohm" />
+ <xsd:element name="Pascal" />
+ <xsd:element name="Rad" />
+ <xsd:element name="RevPerMin" />
+ <xsd:element name="RevPerSec" />
+ <xsd:element name="Sec" />
+ <xsd:element name="Second" />
+ <xsd:element name="Siemens" />
+ <xsd:element name="Sievert" />
+ <xsd:element name="Sterant" />
+ <xsd:element name="Tesla" />
+ <xsd:element name="Volt" />
+ <xsd:element name="VoltAC" />
+ <xsd:element name="VoltDC" />
+ <xsd:element name="Watt" />
+ <xsd:element name="Weber" />
+ <xsd:element name="Week" />
+ <xsd:element name="Year" />
+
+ <xsd:element name="Unit" />
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="unit.component.type">
+ <xsd:sequence>
+ <xsd:element ref="unit.power.type" minOccurs="0" maxOccurs="1" />
+ <xsd:element ref="unit.prefix.type" minOccurs="0" maxOccurs="1" />
+ <xsd:element ref="unit.suffix.type" minOccurs="0" maxOccurs="1" />
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="unit.type">
+ <xsd:choice>
+ <xsd:sequence>
+ <xsd:element ref="unit.component.type" minOccurs="1" maxOccurs="1" />
+ </xsd:sequence>
+ <xsd:sequence>
+ <xsd:element ref="unit.component.type" minOccurs="1" maxOccurs="1" />
+ <xsd:element ref="unit.midfix.type" minOccurs="1" maxOccurs="1" />
+ <xsd:element ref="unit.component.type" minOccurs="1" maxOccurs="1" />
+ </xsd:sequence>
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:element name="unit" type="unit.type" />
+
+<xsd:element name="physics.type">
+ <choice>
+ <xsd:element name="apply">
+ <xsd:sequence>
+ <xsd:element name="unit" minOccurs="1" maxOccurs="1" />
+ <xsd:element name="some kind of mml result" minOccurs="0" maxOccurs="1" />
+ <choice>
+ <xsd:element name="cu" type=unit.type minOccurs="0" maxOccurs="1" />
+ <xsd:element name="cunseq" type=unit.type minOccurs="0" maxOccurs="1" />
+ <xsd:element name="csymbol" type=unit.type minOccurs="0" maxOccurs="1" />
+ </choice>
+ </xsd:sequence>
+ </xsd:element>
+ <xsd:sequence>
+ <choice>
+ <xsd:element name="cn" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="ci" minOccurs="0" maxOccurs="1" />
+ </choice>
+ <xsd:element name="cu" type="unit.type" minOccurs="0" maxOccurs="1" />
+ </xsd:sequence>
+ </choice>
+</xsd:element>
+
+<xsd:element name="phys" type="physics.type" />
+<xsd:element name="iphys" type="physics.type" />
+<xsd:element name="dphys" type="physics.type" />
+
+</xsd:schema>
diff --git a/Master/texmf-dist/tex/context/base/x-res-00.tex b/Master/texmf-dist/tex/context/base/x-res-00.tex
index 46a278768a2..9878d0a5834 100644
--- a/Master/texmf-dist/tex/context/base/x-res-00.tex
+++ b/Master/texmf-dist/tex/context/base/x-res-00.tex
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\unprotect
+\unprotect
% \defineXMLcommandpush [rl:instance] (todo)
% \rawframed == [frame=off,offset=overlay]
@@ -19,28 +19,29 @@
% resource library
\defineXMLprocess [rl:figurelibrary] % not to be used any longer
-\defineXMLprocess [rl:library]
+\defineXMLprocess [rl:library]
-% resource library description
+% resource library description
\defineXMLignore [rl:description]
\defineXMLpush [rl:organization]
\defineXMLpush [rl:product]
\defineXMLpush [rl:project]
+\defineXMLpush [rl:collection]
-% resource library entries (better use XMLignore)
+% resource library entries (better use XMLignore)
-\defineXMLignore [rl:applet]
-\defineXMLignore [rl:application]
-\defineXMLignore [rl:figure]
-\defineXMLignore [rl:movie]
-\defineXMLignore [rl:sound]
+\defineXMLignore [rl:applet]
+\defineXMLignore [rl:application]
+\defineXMLignore [rl:figure]
+\defineXMLignore [rl:movie]
+\defineXMLignore [rl:sound]
-\defineXMLpush [rl:type]
-\defineXMLpush [rl:state]
-\defineXMLpush [rl:width]
-\defineXMLpush [rl:height]
+\defineXMLpush [rl:type]
+\defineXMLpush [rl:state]
+\defineXMLpush [rl:width]
+\defineXMLpush [rl:height]
\defineXMLpush [rl:file]
\defineXMLpush [rl:label]
\defineXMLpush [rl:original]
@@ -54,13 +55,13 @@
\defineXMLpush [rl:original]
\defineXMLpush [rl:manipulation]
-% instances
+% instances
\defineXMLignore [rl:instance]
\defineXMLpush [rl:background]
-\defineXMLpush [rl:viewport]
-\defineXMLpush [rl:dimension]
-\defineXMLpush [rl:position]
+\defineXMLpush [rl:viewport]
+\defineXMLpush [rl:dimension]
+\defineXMLpush [rl:position]
-\protect \endinput
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-res-01.tex b/Master/texmf-dist/tex/context/base/x-res-01.tex
index 82c1116dec5..e989d7090c1 100644
--- a/Master/texmf-dist/tex/context/base/x-res-01.tex
+++ b/Master/texmf-dist/tex/context/base/x-res-01.tex
@@ -24,8 +24,13 @@
%D The following modes are supported:
%D
%D \starttabulate[|lT|l|]
-%D \NC letter \NC map the preview on letter size \NC \NR
-%D \NC compact \NC use an alternative presentation \NC \NR
+%D \NC letter \NC map the preview on letter size \NC \NR
+%D \NC compact \NC use an alternative presentation \NC \NR
+%D \NC clipgrid-distance \NC add a copy with grid overlayed \NC \NR
+%D \NC clipgrid-steps \NC add a copy with grid overlayed \NC \NR
+%D \NC previewpage-A4 \NC show graphic relative to A4 \NC \NR
+%D \NC previewpage-letter \NC show graphic relative to letter \NC \NR
+%D \NC previewpage-S6 \NC show graphic relative to S6 \NC \NR
%D \stoptabulate
%D
%D The resulting file has the following characteristics:
@@ -60,6 +65,10 @@
\doifnothing {\jobfullname} {\end}
\doiffileelse {\jobfullname} {} {\end}
+\definesymbol [attachment] [{\bf\color[darkred]{\jobname.xml}}]
+\setupattachments [symbol=attachment]
+\useattachment [datafile] [\jobname.xml]
+
\def\StartDescription
{\bgroup}
@@ -74,15 +83,41 @@
{\NC product \NC \XMLflush{rl:product} \NC \NR}{}
\doifXMLdataelse{rl:comment}
{\NC comment \NC \XMLflush{rl:comment} \NC \NR}{}
+ \NC specification \NC \attachment[datafile] \NC \NR
\stoptabulate
\blank[2*big]
\egroup}
-\def\StartFigureA
- {\bgroup
- \XMLassign{rl:file}{unknown}}
-\defineoverlay[page][\overlaybutton{Description}]
+\def\localexternalfigurereplacement#1#2#3% hack, no reuse of dummies (yet), todo: pass objname
+ {\doifelsenothing{\XMLflush{rl:label}}
+ {\edef\FigureName{\XMLflush{rl:label}}}
+ {\edef\FigureName{\XMLflush{rl:file}}}%
+ \doifobjectfoundelse{rl}\FigureName
+ {}
+ {\setobject{rl}\FigureName\vbox{\normalexternalfigurereplacement{#1}{#2}{#3}}}%
+ \getobject{rl}\FigureName}
+
+\startmode[dummy]
+
+ \useMPlibrary[dum]
+
+ \def\StartFigureA
+ {\bgroup
+ \XMLassign{rl:file}{dummy}}
+
+ \let\normalexternalfigurereplacement\externalfigurereplacement
+ \let\externalfigurereplacement \localexternalfigurereplacement
+
+\stopmode
+
+\startnotmode[dummy]
+
+ \def\StartFigureA
+ {\bgroup
+ \XMLassign{rl:file}{unknown}}
+
+\stopnotmode
\startbuffer[unknown]
\framed
@@ -98,6 +133,8 @@
\useexternalfigure[unknown][unknown][type=buffer,object=no]
+\defineoverlay[page][\overlaybutton{Description}]
+
% \def\externalfigurereplacement#1#2#3%
% {\getbuffer[rl-unknown]}
@@ -105,9 +142,9 @@
{\doglobal\increment\CurrentPage
\setupbackgrounds[page][background=page]
\doifelsenothing{\XMLflush{rl:label}}
- {\expanded{\definereference[Description][about: \XMLflush{rl:file}]}%
+ {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}%
\expanded{\pagereference[\XMLflush{rl:file}]}}
- {\expanded{\definereference[Description][about: \XMLflush{rl:label}]}%
+ {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}%
\expanded{\pagereference[\XMLflush{rl:label}]}}
\pagefigure[\XMLflush{rl:file}]
\setupbackgrounds[page][background=]
@@ -153,7 +190,6 @@
\enablemode[previewpage-A4]
\stopnotmode
-%startbuffer[paper]
\startsetups[paper]
\startmode[previewpage-A4]
\framed
@@ -174,7 +210,6 @@
{\externalfigure[\XMLflush{rl:file}][reset=yes]}
\stopmode
\stopsetups
-%stopbuffer
\setupbuttons
[offset=10pt,
@@ -196,8 +231,8 @@
{\hbox to \hsize
{\forgetall \dontcomplain
\doifelsenothing{\XMLflush{rl:label}}
- {\expanded{\pagereference[about: \XMLflush{rl:file}]}}
- {\expanded{\pagereference[about: \XMLflush{rl:label}]}}%
+ {\expanded{\pagereference[about:\XMLflush{rl:file}]}}
+ {\expanded{\pagereference[about:\XMLflush{rl:label}]}}%
% moved here, because descriptions may be absent
\ifnum\CurrentPage=1 \pagereference[begin]\fi
%
@@ -238,7 +273,7 @@
[offset=overlay,
framecolor=darkred,
rulethickness=.5pt]
- {\scale[width=40pt]{\setups[paper]}}% {\disableXML\getbuffer[paper]}}%
+ {\scale[width=40pt]{\setups[paper]}}%
\startmode[compact]%
\vfill
\hbox to \hsize{\hss\strut\bf\CurrentPage\hss}%
@@ -432,9 +467,9 @@
\setupbackgrounds[page][background=page]
\startpagefigure[\XMLflush{rl:file}][offset=20pt]%
\doifelsenothing{\XMLflush{rl:label}}
- {\expanded{\definereference[Description][about: \XMLflush{rl:file}]}%
+ {\expanded{\definereference[Description][about:\XMLflush{rl:file}]}%
\expanded{\pagereference[grid:\XMLflush{rl:file}]}}
- {\expanded{\definereference[Description][about: \XMLflush{rl:label}]}%
+ {\expanded{\definereference[Description][about:\XMLflush{rl:label}]}%
\expanded{\pagereference[grid:\XMLflush{rl:label}]}}
\stoppagefigure
%\pagefigure[\XMLflush{rl:file}][offset=20pt]
diff --git a/Master/texmf-dist/tex/context/base/x-res-04.tex b/Master/texmf-dist/tex/context/base/x-res-04.tex
index 826a07d2385..066404afd25 100644
--- a/Master/texmf-dist/tex/context/base/x-res-04.tex
+++ b/Master/texmf-dist/tex/context/base/x-res-04.tex
@@ -39,30 +39,32 @@
%D \starttyping
%D <!-- texexec --pdf --use=fig-01 figtest.xml -->
%D
-%D <figurelibrary language="nl">
+%D <?xml version='1.0'?>
%D
-%D <description>
-%D <organization>PRAGMA Advanced Document Engineering</organization>
-%D <project>Manuals</project>
-%D <product>Beginners Manual</product>
-%D <comment>A bunch of figures.</comment>
-%D </description>
+%D <rl:library language="nl">
%D
-%D <figure>
-%D <file>koe.pdf</file>
-%D <label>a dutch cow</label>
-%D <copyright>Corel Draw Suite</copyright>
-%D <comment>I bet that you've seen this cow before.</comment>
-%D </figure>
+%D <rl:description>
+%D <organization>PRAGMA Advanced Document Engineering</rl:organization>
+%D <project>Manuals</rl:project>
+%D <product>Beginners Manual</rl:product>
+%D <comment>A bunch of figures.</rl:comment>
+%D </rl:description>
%D
-%D <figure>
-%D <dummy width="4cm" height="3cm">non existent</dummy>
-%D <label>a european cow</label>
-%D <copyright>Nobody</copyright>
-%D <comment>When will we talk about European cows?</comment>
-%D </figure>
+%D <rl:figure>
+%D <rl:file>koe.pdf</rl:file>
+%D <rl:label>a dutch cow</rl:label>
+%D <rl:copyright>Corel Draw Suite</rl:copyright>
+%D <rl:comment>I bet that you've seen this cow before.</rl:comment>
+%D </rl:figure>
%D
-%D </figurelibrary>
+%D <rl:figure>
+%D <rl:dummy width="4cm" height="3cm">non existent</rl:dummy>
+%D <rl:label>a european cow</rl:label>
+%D <rl:copyright>Nobody</rl:copyright>
+%D <rl:comment>When will we talk about European cows?</rl:comment>
+%D </rl:figure>
+%D
+%D </rl:library>
%D \stoptyping
%D
%D You can convert this base into a \PDF\ file using
@@ -183,8 +185,8 @@
\doglobal\newcounter\figurefilepage
\autoXMLnamespace[rl]
\startXMLmapping[rl:find]
- \xdef\figurefilebase{#1}
- \def\askedlabel{#2}
+ \xdef\figurefilebase{#1}%
+ \def\askedlabel{#2}%
\doifelseXMLelement{rl:rl:\askedlabel}
{\enableXMLelements\flushXMLelement{rl:rl:\askedlabel}}
{\processcommacommand[\figurepathlist]\dogetfigurefilename}%
diff --git a/Master/texmf-dist/tex/context/base/x-res-08.tex b/Master/texmf-dist/tex/context/base/x-res-08.tex
index 5dfa6b6fa24..e7388516646 100644
--- a/Master/texmf-dist/tex/context/base/x-res-08.tex
+++ b/Master/texmf-dist/tex/context/base/x-res-08.tex
@@ -82,8 +82,8 @@
\fi
\writtenXMLelementcs{\XMLrlprefix comment}\currentresourcecomment
\ifconditional\externalfigureflush
- \writtenXMLelementcs{\XMLrlprefix width}\figurewidth
- \writtenXMLelementcs{\XMLrlprefix height}\figureheight
+ \writtenXMLelementcs{\XMLrlprefix width}\figurewidth
+ \writtenXMLelementcs{\XMLrlprefix height}\figureheight
\fi}}}
\def\XMLfeedbackexternalfigure
diff --git a/Master/texmf-dist/tex/context/base/x-set-11.tex b/Master/texmf-dist/tex/context/base/x-set-11.tex
index 5e7068b1409..f3ce754209a 100644
--- a/Master/texmf-dist/tex/context/base/x-set-11.tex
+++ b/Master/texmf-dist/tex/context/base/x-set-11.tex
@@ -97,7 +97,7 @@
2: -- is processed
3: -- is undefined
4: -- is processed again
- optional: optioneel
+ optional: optional
displaymath: formula
index: entry
math: formula
@@ -264,6 +264,44 @@
content: text
\stopmessages
+\startmessages french library: setup
+ title: réglage
+ formula: formule
+ number: numéro
+ list: liste
+ dimension: dimension
+ mark: marquage
+ reference: reference
+ command: commande
+ file: fichier
+ name: nom
+ identifier: identificateur
+ text: texte
+ section: section
+ singular: nom singulier
+ plural: nom pluriel
+ matrix: n*m
+ see: vois
+ inherits: herite de
+ 1: les caractères < et > sont globalement actifs !
+ 2: -- est traité
+ 3: -- n'est pas défini
+ 4: -- est traité de nouveau
+ optional: optionel
+ displaymath: formule
+ index: entrée
+ math: formule
+ nothing: vide
+ file: fichier
+ position: position
+ reference: réference
+ csname: nom
+ destination: destination
+ triplet: triplet
+ word: mot
+ content: texte
+\stopmessages
+
\def\c!setup!internal!#1%
{{\dogetmessage{setup}{#1}%
\expanded{\setupintfont{\currentmessagetext}}}}
@@ -313,7 +351,7 @@
\newif\ifshortsetup
\def\setup {\shortsetupfalse\dosetup}
-\def\shortsetup{\shortsetuptrue\dosetup}
+\def\shortsetup{\shortsetuptrue \dosetup}
\def\setupsetup{\dodoubleargument\getparameters[\??stp]}
\setupsetup
@@ -345,14 +383,35 @@
\let\plaatssetup \placesetup
\let\plaatselkesetup\placeeverysetup
-\def\dosetup#1{{\enableXML\flushXMLelement{stp:#1}}}
+% we use :1 as fallback
+%
+% \setup{setupinterlinespace}
+% \setup{setupinterlinespace:1}
+% \setup{setupinterlinespace:2}
+
+\bgroup \catcode`\<=\active
+
+\gdef\dosetup#1%
+ {\bgroup
+ \def<<##1>>{##1}%
+ \edef\ascii{#1}%
+ \enableXML
+ \doifelseXMLelement{stp:\ascii}
+ {\expanded{\flushXMLelement{stp:\ascii}}}
+ {\doifelseXMLelement{stp:\ascii:1}
+ {\expanded{\flushXMLelement{stp:\ascii:1}}}
+ {\convertargument#1\to\ascii
+ \em unknown setup \quote{\ascii}}}
+ \egroup}
+
+\egroup
-\defineXMLenvironment [cd:command] [name=,type=,generated=,interactive=]
+\defineXMLenvironment [cd:command] [name=,type=,generated=,interactive=,variant=]
{}
{\showSETUPrecord}
\def\showSETUPrecord
- {\getvalue{startsetuptext}
+ {\getvalue{\e!start setuptext}
\tttf
\nohyphens
\veryraggedright
@@ -391,7 +450,7 @@
\egroup
\stopXMLmapping}
\stopXMLmapping
- \getvalue{stopsetuptext}}
+ \getvalue{\e!stop setuptext}}
\defineXMLenvironmentsave [cd:sequence] \ignorespaces \ignorespaces
\defineXMLenvironmentsave [cd:arguments] \ignorespaces \ignorespaces
@@ -487,6 +546,13 @@
\def\previousSETUPargument{\currentSETUPargument}
+\defineXMLenvironmentsave [cd:define] [name=]
+ {}
+ {\setevalue{cd:def:\XMLop{name}}{\XMLflush{cd:define}}}
+
+\defineXMLsingular [cd:resolve] [name=]
+ {\getvalue{cd:def:\XMLop{name}}}
+
\defineXMLenvironmentsave [cd:assignments]
{}
{\xdef\currentSETUPwidth{0pt}%
@@ -724,11 +790,13 @@
\startXMLmapping[zero]
-\defineXMLenvironmentsave [cd:command] [name=,type=,generated=,interactive=]
+\defineXMLenvironmentsave [cd:command] [name=,type=,generated=,interactive=,variant=]
{}
{\doifelseXMLop{type}{environment}
{\edef\currentSETUPname{start\getinterfacecomponent{string}{\XMLop{name}}}}
{\edef\currentSETUPname{\getinterfacecomponent{string}{\XMLop{name}}}}%
+ \doifsomething{\XMLop{variant}}
+ {\edef\currentSETUPname{\currentSETUPname:\XMLop{variant}}}% like setupinterlinespace:1
\doifXMLop{generated}{yes}
{\edef\currentSETUPname{\currentSETUPname*}}%
\doglobal\saveXMLdatainelement{stp:\currentSETUPname}{cd:command}{cd:command}%
@@ -737,9 +805,20 @@
\stopXMLmapping
-\def\loadsetups
- {\startXMLmapping[zero]
- \processXMLfilegrouped{cont-en.xml}
- \stopXMLmapping}
+\def\loadsetups{\complexorsimple\loadsetups}
+
+\def\simpleloadsetups
+ {\doifnotmode{no-setup-main}
+ {\complexloadsetups[cont-en.xml]}}
+
+\def\complexloadsetups[#1]%
+ {\doifnotmode{no-setup-all}
+ {\doifsomething{#1}
+ {\startXMLmapping[zero]
+ \expanded{\processXMLfilegrouped{#1}}%
+ \stopXMLmapping}}}
+
+\defineXMLsingular [cd:include] [file=]
+ {\complexloadsetups[\XMLop{file}]}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/x-set-12.tex b/Master/texmf-dist/tex/context/base/x-set-12.tex
index f98761513b6..93055b86085 100644
--- a/Master/texmf-dist/tex/context/base/x-set-12.tex
+++ b/Master/texmf-dist/tex/context/base/x-set-12.tex
@@ -18,19 +18,45 @@
\loadsetups
-\startinterface dutch \definecolor[LocalColor][green] \stopinterface
-\startinterface english \definecolor[LocalColor][red] \stopinterface
-\startinterface german \definecolor[LocalColor][blue] \stopinterface
-\startinterface czech \definecolor[LocalColor][magenta] \stopinterface
-\startinterface italian \definecolor[LocalColor][cyan] \stopinterface
-\startinterface romanian \definecolor[LocalColor][yellow] \stopinterface
-
-\startinterface english \definecolor[TitleColor][g=.5,b=.5] \stopinterface
-\startinterface dutch \definecolor[TitleColor][r=.5,b=.5] \stopinterface
-\startinterface german \definecolor[TitleColor][r=.5,g=.5] \stopinterface
-\startinterface italian \definecolor[TitleColor][r=.5] \stopinterface
-\startinterface czech \definecolor[TitleColor][g=.5] \stopinterface
-\startinterface romanian \definecolor[TitleColor][b=.5] \stopinterface
+\definecolor[TitleColor][r=.375,g=.125,b=.125]
+\definecolor[TitleColor][r=.125,g=.375,b=.125]
+\definecolor[TitleColor][r=.125,g=.125,b=.375]
+\definecolor[TitleColor][r=.375,g=.375,b=.125]
+\definecolor[TitleColor][r=.375,g=.125,b=.375]
+\definecolor[TitleColor][r=.125,g=.375,b=.375]
+
+\definecolor[TitleColor][r=.25,g=.20,b=.15]
+\definecolor[TitleColor][r=.25,g=.15,b=.20]
+\definecolor[TitleColor][r=.20,g=.15,b=.25]
+\definecolor[TitleColor][r=.20,g=.25,b=.15]
+\definecolor[TitleColor][r=.15,g=.20,b=.25]
+\definecolor[TitleColor][r=.15,g=.25,b=.20]
+
+\startinterface dutch \definecolor[LocalColor][r=.75,g=.25,b=.25] \stopinterface
+\startinterface english \definecolor[LocalColor][r=.25,g=.75,b=.25] \stopinterface
+\startinterface german \definecolor[LocalColor][r=.25,g=.25,b=.75] \stopinterface
+\startinterface french \definecolor[LocalColor][r=.75,g=.75,b=.25] \stopinterface
+\startinterface czech \definecolor[LocalColor][r=.75,g=.25,b=.75] \stopinterface
+\startinterface italian \definecolor[LocalColor][r=.25,g=.75,b=.75] \stopinterface
+\startinterface romanian \definecolor[LocalColor][r=.5,g=.4,b=.3] \stopinterface
+% \definecolor[LocalColor][r=.5,g=.3,b=.4]
+% \definecolor[LocalColor][r=.4,g=.3,b=.5]
+% \definecolor[LocalColor][r=.4,g=.5,b=.3]
+% \definecolor[LocalColor][r=.3,g=.4,b=.5]
+% \definecolor[LocalColor][r=.3,g=.5,b=.4]
+
+\startinterface english \definecolor[TitleColor][r=.375,g=.125,b=.125] \stopinterface
+\startinterface dutch \definecolor[TitleColor][r=.125,g=.375,b=.125] \stopinterface
+\startinterface german \definecolor[TitleColor][r=.125,g=.125,b=.375] \stopinterface
+\startinterface french \definecolor[TitleColor][r=.375,g=.375,b=.125] \stopinterface
+\startinterface italian \definecolor[TitleColor][r=.375,g=.125,b=.375] \stopinterface
+\startinterface czech \definecolor[TitleColor][r=.125,g=.375,b=.375] \stopinterface
+\startinterface romanian \definecolor[TitleColor][r=.25,g=.20,b=.15] \stopinterface
+% \definecolor[TitleColor][r=.25,g=.15,b=.20]
+% \definecolor[TitleColor][r=.20,g=.15,b=.25]
+% \definecolor[TitleColor][r=.20,g=.25,b=.15]
+% \definecolor[TitleColor][r=.15,g=.20,b=.25]
+% \definecolor[TitleColor][r=.15,g=.25,b=.20]
\definecolor [lightgray] [s=.9]
\definecolor [darkgray] [s=.1]
@@ -123,27 +149,47 @@
\setuplayout
[titlepage]
-\startmakeup[\v!standard]
- \dontcomplain
- \startcolor[TitleColor]
- \definedfont[RegularBold at 100pt]\setstrut
- \setupalign[\v!left]
- \strut Con\TeX t \par
- \definedfont[RegularBold at 50pt]\setstrut
+\startsetups text:commands
\startinterface dutch \strut commando's \par \stopinterface
\startinterface english \strut commands \par \stopinterface
\startinterface german \strut befehle \par \stopinterface
- \startinterface czech \strut prikaz\'y \par \stopinterface
+ \startinterface french \strut commandes \par \stopinterface
+ \startinterface czech \strut p\v{r}ikazy \par \stopinterface
\startinterface italian \strut comandi \par \stopinterface
\startinterface romanian \strut comenzile \par \stopinterface
- \vfill
- \definedfont[RegularBold at 150pt]\setstrut
+\stopsetups
+
+\startsetups text:uppercase
\startinterface dutch NL\stopinterface
\startinterface english EN\stopinterface
\startinterface german DE\stopinterface
+ \startinterface french FR\stopinterface
\startinterface czech CZ\stopinterface
\startinterface italian IT\stopinterface
\startinterface romanian RO\stopinterface
+\stopsetups
+
+\startsetups text:lowercase
+ \startinterface dutch \strut nl / nederlands \par \stopinterface
+ \startinterface english \strut en / english \par \stopinterface
+ \startinterface german \strut de / deutsch \par \stopinterface
+ \startinterface french \strut fr / fran\c{c}ais \par \stopinterface
+ \startinterface czech \strut cz / \v{c}esk\'y \par \stopinterface
+ \startinterface italian \strut it / italiano \par \stopinterface
+ \startinterface romanian \strut ro / rom\^{a}n\u{a} \par \stopinterface
+\stopsetups
+
+\startmakeup[\v!standard]
+ \dontcomplain
+ \startcolor[TitleColor]
+ \definedfont[RegularBold at 100pt]\setstrut
+ \setupalign[\v!left]
+ \strut Con\TeX t \par
+ \definedfont[RegularBold at 50pt]\setstrut
+ \setups[text:commands]
+ \vfill
+ \definedfont[RegularBold at 150pt]\setstrut
+ \setups[text:uppercase]
\stopcolor
\stopmakeup
@@ -160,20 +206,10 @@
\setupalign[\v!left]
\strut Con\TeX t \par
\definedfont[RegularBold at 50pt]\setstrut
- \startinterface dutch \strut commando's \par \stopinterface
- \startinterface english \strut commands \par \stopinterface
- \startinterface german \strut befehle \par \stopinterface
- \startinterface czech \strut prikaz\'y \par \stopinterface
- \startinterface italian \strut comandi \par \stopinterface
- \startinterface romanian \strut comenzile \par \stopinterface
+ \setups[text:commands]
\vfill
\definedfont[RegularBold at 24pt]\setupinterlinespace
- \startinterface dutch \strut nl / nederlands \par \stopinterface
- \startinterface english \strut en / english \par \stopinterface
- \startinterface german \strut de / deutsch \par \stopinterface
- \startinterface czech \strut cz / \^cesk\'y \par \stopinterface
- \startinterface italian \strut it / italiano \par \stopinterface
- \startinterface romanian \strut ro / rom\^{a}n\u{a} \par \stopinterface
+ \setups[text:lowercase]
\par \strut \currentdate \par
\stopcolor
\stopmakeup
diff --git a/Master/texmf-dist/tex/context/base/x-sm2om.xsl b/Master/texmf-dist/tex/context/base/x-sm2om.xsl
new file mode 100644
index 00000000000..241452dbf52
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/x-sm2om.xsl
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+ This style sheet is used in the Math4All project. This project
+ will provide an on-line math method for secondary and tertiary
+ education. In addition to the web-bases content the project
+ provides high quality typeset output as well.
+
+ This style converts some elements to open math alternatives and
+ its sole purpose is to easy the input of inline math.
+
+ <i>x</i> identifier (use <v>x</v> when possible)
+ <n>5</n> number
+ <v>5</v> variable
+ <r>1:2</r> interval (range)
+ <r>x:y</r> interval (range) using variables
+
+ This style is dedicated to Frits Spijkers, an open minded math
+ author who patiently tested all the related TeX things.
+
+ Hans Hagen, PRAGMA ADE, Hasselt NL / 2006-04-27
+
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:output method="xml"/>
+
+ <xsl:template match="processing-instruction()"><xsl:copy/><xsl:text>
+ </xsl:text></xsl:template>
+
+ <xsl:template match="node()|@*" >
+ <xsl:copy>
+ <xsl:apply-templates select = "node()|@*" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="comment"></xsl:template>
+
+ <xsl:variable name='openmath-to-content-mathml'><value-of select='$stylesheet-path'/>/x-openmath.xsl</xsl:variable>
+
+ <xsl:template name='om-minus'>
+ <OMS cd="arith1" name="unary_minus"/>
+ </xsl:template>
+ <xsl:template name='om-infinity'>
+ <OMS cd="nums1" name="infinity"/>
+ </xsl:template>
+ <xsl:template name='om-interval-oo'>
+ <OMS cd="interval1" name="interval_oo"/>
+ </xsl:template>
+ <xsl:template name='om-interval-oc'>
+ <OMS cd="interval1" name="interval_oc"/>
+ </xsl:template>
+ <xsl:template name='om-interval-co'>
+ <OMS cd="interval1" name="interval_co"/>
+ </xsl:template>
+ <xsl:template name='om-interval-cc'>
+ <OMS cd="interval1" name="interval_cc"/>
+ </xsl:template>
+
+ <xsl:template name='om-kind-of-data'>
+ <xsl:param name='arg'/>
+ <xsl:choose>
+ <xsl:when test="contains($arg,'/')">
+ <xsl:element name="OMA">
+ <xsl:element name="OMS">
+ <xsl:attribute name="cd">nums1</xsl:attribute>
+ <xsl:attribute name="name">rational</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="om-kind-of-data">
+ <xsl:with-param name='arg' select="substring-before($arg,'/')"/>
+ </xsl:call-template>
+ <xsl:call-template name="om-kind-of-data">
+ <xsl:with-param name='arg' select="substring-after($arg,'/')"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="contains($arg,'.') or contains($arg,',')">
+ <xsl:element name="OMF">
+ <xsl:attribute name="dec"><xsl:value-of select="$arg"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="number($arg)">
+ <xsl:choose>
+ <xsl:when test="contains($arg,'-')">
+ <xsl:element name="OMA">
+ <xsl:call-template name='om-minus'/>
+ <xsl:element name="OMI">
+ <xsl:value-of select="substring-after($arg,'-')"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="contains($arg,'+')">
+ <xsl:element name="OMI">
+ <xsl:value-of select="substring-after($arg,'+')"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="OMI">
+ <xsl:value-of select="$arg"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="OMV">
+ <xsl:attribute name="name"><xsl:value-of select="$arg"/></xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match='i|n'>
+ <xsl:element name="OMOBJ">
+ <xsl:attribute name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
+ <xsl:attribute name="version">2.0</xsl:attribute>
+ <xsl:call-template name="om-kind-of-data">
+ <xsl:with-param name='arg' select="text()"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match='v'>
+ <xsl:element name="OMOBJ">
+ <xsl:attribute name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
+ <xsl:attribute name="version">2.0</xsl:attribute>
+ <xsl:element name="OMV">
+ <xsl:attribute name="name"><xsl:apply-templates/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- r a/b split in two parts -->
+
+ <xsl:template match='r'>
+ <xsl:element name="OMOBJ">
+ <xsl:attribute name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
+ <xsl:attribute name="version">2.0</xsl:attribute>
+ <xsl:element name="OMA">
+ <xsl:variable name='type'>
+ <xsl:choose>
+ <xsl:when test="@type=''">
+ cc
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@type"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="@type='io'">
+ <xsl:call-template name='om-interval-oo'/>
+ <xsl:element name="OMA">
+ <xsl:call-template name='om-minus'/>
+ <xsl:call-template name='om-infinity'/>
+ </xsl:element>
+ <xsl:element name="OMI">
+ <xsl:call-template name='om-kind-of-data'>
+ <xsl:with-param name='arg' select='text()'/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@type='oi'">
+ <xsl:call-template name='om-interval-oo'/>
+ <xsl:element name="OMI">
+ <xsl:call-template name='om-kind-of-data'>
+ <xsl:with-param name='arg' select='text()'/>
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:call-template name='om-infinity'/>
+ </xsl:when>
+ <xsl:when test="@type='ic'">
+ <xsl:call-template name='om-interval-oc'/>
+ <xsl:element name="OMA">
+ <xsl:call-template name='om-minus'/>
+ <xsl:call-template name='om-infinity'/>
+ </xsl:element>
+ <xsl:element name="OMI">
+ <xsl:call-template name='om-kind-of-data'>
+ <xsl:with-param name='arg' select='text()'/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@type='ci'">
+ <xsl:call-template name='om-interval-co'/>
+ <xsl:element name="OMI">
+ <xsl:call-template name='om-kind-of-data'>
+ <xsl:with-param name='arg' select='text()'/>
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:call-template name='om-infinity'/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="OMS">
+ <xsl:attribute name="cd">interval1</xsl:attribute>
+ <xsl:attribute name="name">interval_<xsl:value-of select="$type"/></xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="om-kind-of-data">
+ <xsl:with-param name='arg' select="substring-before(text(),':')"/>
+ </xsl:call-template>
+ <xsl:call-template name="om-kind-of-data">
+ <xsl:with-param name='arg' select="substring-after(text(),':')"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match='c'>
+ <xsl:element name="OMOBJ">
+ <xsl:attribute name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
+ <xsl:attribute name="version">2.0</xsl:attribute>
+ <xsl:element name="OMA">
+ <xsl:element name="OMS">
+ <xsl:attribute name="cd">linalg3</xsl:attribute>
+ <xsl:attribute name="name">vector</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="om-kind-of-data">
+ <xsl:with-param name='arg' select="substring-before(text(),':')"/>
+ </xsl:call-template>
+ <xsl:call-template name="om-kind-of-data">
+ <xsl:with-param name='arg' select="substring-after(text(),':')"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/Master/texmf-dist/tex/context/base/x-xml-11.tex b/Master/texmf-dist/tex/context/base/x-xml-11.tex
index bdacd97c232..81fbac5b4c5 100644
--- a/Master/texmf-dist/tex/context/base/x-xml-11.tex
+++ b/Master/texmf-dist/tex/context/base/x-xml-11.tex
@@ -14,8 +14,11 @@
% xmltools --analyze yourfile.xml
% texexec --use=xml-analyze yourfile.*
-\doifnothing {\inputfilename} {\end}
-\doiffileelse {\inputfilename} {} {\end}
+% \doifnothing {\inputfilename} {\end}
+% \doiffileelse {\inputfilename} {} {\end}
+
+\doifnothing {\jobfullname} {\end}
+\doiffileelse {\jobfullname} {} {\end}
\useXMLfilter[ent]
\useXMLfilter[utf]
@@ -30,6 +33,7 @@
[SomeElement]
[ownnumber=yes,
style=\tfb,
+ numberstyle=\tfxx,
alternative=margin]
\setuplayout
@@ -41,7 +45,7 @@
header=0pt]
\setupfootertexts
- [\inputfilename]
+ [\jobfullname] % [\inputfilename]
\usetypescript[modern][texnansi] \setupbodyfont[modern,tt,10pt]
@@ -51,8 +55,8 @@
{}
\defineXMLpickup
- [entities]
- {\page
+ [entities][n=0]
+ {\expanded{\SomeElement{\XMLop{n}}{Entities}}
\starttabulate[|l|p|]}
{\stoptabulate}
@@ -65,9 +69,34 @@
\noexpand \NR
\stopexpanded}
+\defineXMLpickup
+ [characters][n=0]
+ {\expanded{\SomeElement{\XMLop{n}}{Characters}}
+ \bgroup
+ \let\nonbreakablespace\empty % messes up the table
+ \starttabulate[|l|r|r|l|l|l|l|]}
+ {\stoptabulate
+ \egroup}
+
+% todo: narrowtt
+
+\defineXMLcommand
+ [character][number=,utf=,n=0,uname=,pname=,cname=]
+ {\startexpanded
+ \noexpand \NC \noexpand \unicodehexnumber{\XMLop{number}}
+ \noexpand \NC \XMLop{number}
+ \noexpand \NC \XMLop{n}
+ \noexpand \NC \noexpand \unicodechar {\XMLop{number}}
+ \noexpand \NC \tx \lowercase\expandafter{\XMLop{uname}}
+ \noexpand \NC \tx \noexpand \unicodepair {\XMLop{number}}
+ \noexpand \NC \tx \XMLop{cname}
+ \noexpand \NC
+ \noexpand \NR
+ \stopexpanded}
+
\defineXMLenvironment
[elements]
- {\page}
+ {}
{}
\newtoks \TabulateToks
@@ -98,6 +127,7 @@
\starttext
-\processXMLfilegrouped{\inputfilename}
+% \processXMLfilegrouped{\inputfilename}
+\processXMLfilegrouped{\jobfullname}
\stoptext
diff --git a/Master/texmf-dist/tex/context/base/xtag-cml.tex b/Master/texmf-dist/tex/context/base/xtag-cml.tex
index 1c80ac1a7b6..493d9eff340 100644
--- a/Master/texmf-dist/tex/context/base/xtag-cml.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-cml.tex
@@ -1,6 +1,6 @@
% see mathml, == \defineXMLdirective [mathml] \setupMMLappearance
-\unprotect
+\unprotect
\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]}
@@ -20,12 +20,12 @@
\remapXMLsequence [ion] [CPA] \doCMLion
\remapXMLsequence [atom] [CPA] \doCMLatom
-\setupCMLappearance [ion] [\c!variant=\v!a]
+\setupCMLappearance [ion] [\c!alternative=\v!a]
\let\CMLtopcaption\empty
\let\CMLbotcaption\empty
-\def\someCMLtext#1%
+\def\someCMLtext#1%
{\ifx\CMLtopcaption\empty
\setbox0\null
\else
@@ -37,14 +37,14 @@
\else
\setbox4\hbox{\txx\setstrut\strut\ignorespaces\CMLbotcaption\unskip}%
\fi
- \scratchdimen=\wd2\advance\scratchdimen-.5em
+ \scratchdimen=\wd2\advance\scratchdimen-.5em
\ifdim\wd0>\scratchdimen
\setbox0\hbox spread .5em{\hss\box0\hss}%
\fi
\ifdim\wd4>\scratchdimen
\setbox4\hbox spread .5em{\hss\box4\hss}%
\fi
- \setbox6=\vbox
+ \setbox6=\vbox
{\offinterlineskip\halign{\hss##\hss\cr\copy0\cr\copy2\cr\copy4\cr}}%
\hbox{\lower\ht4\hbox{\lower\dp2\box6}}}
@@ -80,12 +80,12 @@
\newcounter\nofCMLatoms
\getXMLarguments{cml-i}{n="0" charge="0" #1}%
\doifnotXMLzero{cml-i}{n}\firstofoneargument
- \doifelse\@@CMLionvariant\v!b
+ \doifelse\@@CMLionalternative\v!b
{[\ignorespaces\processXMLRchild{atom,bond/,%
singlebond/,doublebond/,triplebond/}{#2}\unskip]%
\high{\doifnotXMLzero{cml-i}{charge}\CMLscript}}
{\countXMLRchild{atom}{\ignorespaces#2\unskip}%
- \let\nofCMLatoms\nofXMLRchildren
+ \let\nofCMLatoms\nofXMLRchildren
\ignorespaces\processXMLRchild{atom,bond/,%
singlebond/,doublebond/,triplebond/}{#2}\unskip}%
\egroup}%
@@ -95,7 +95,6 @@
{\getXMLarguments{cml-a}{n="0" weight="0" protons="0" charge="0" #1}%
\increment\currentCMLatom
\resetCMLcaption
- %\processXMLRchild{caption}{#2}% not here
\someCMLtext
{\bgroup
\lohi
@@ -149,19 +148,19 @@
\def\doCMLequilibrium#1#2{\resetCMLcaption#2\someCMLequilibrium}
\def\doCMLmesomeric #1#2{\resetCMLcaption#2\someCMLmesomeric }
-\def\dosomeCMLarrow#1%
+\def\dosomeCMLarrow#1%
{\quad
\someCMLtext
{$\vcenter{\offinterlineskip\halign{##\cr\hskip3em\cr#1\cr}}$}%
\quad}
-\def\someCMLgives
+\def\someCMLgives
{\someCMLarrow{\rightarrowfill}}
\def\someCMLequilibrium
{\someCMLarrow{\rightarrowfill\cr\noalign{\nointerlineskip}\leftarrowfill}}
-\def\someCMLmesomeric
+\def\someCMLmesomeric
{\someCMLarrow{$\leftarrow\hskip-1em$\rightarrowfill}}
\remapXMLsequence [cml] [caption] [CPA] \doCMLcaption
@@ -182,7 +181,7 @@
\resetCMLcaption
-\remapXMLsingular [bond] [CPA] \doCMLbond
+\remapXMLsingular [bond] [CPA] \doCMLbond
\remapXMLsingular [singlebond] [CPA] \doCMLsinglebond
\remapXMLsingular [doublebond] [CPA] \doCMLdoublebond
\remapXMLsingular [triplebond] [CPA] \doCMLtriplebond
@@ -197,8 +196,8 @@
\doCMLtriplebond
\fi}
-\def\someCMLbond%
- {\hrule \!!width \hsize \!!height .1ex} % .4pt
+\def\someCMLbond
+ {\hrule \!!width \hsize \!!height .1ex} % .4pt
\def\dosomeCMLbond#1#2#3%
{{\setbox\scratchbox=\hbox{$M$}%
@@ -208,15 +207,15 @@
#1\vfill#2\vfill#3%
\vskip.1\wd\scratchbox}}}
-\def\doCMLsinglebond%
+\def\doCMLsinglebond
{\dosomeCMLbond\relax\someCMLbond\relax}
-\def\doCMLdoublebond%
+\def\doCMLdoublebond
{\dosomeCMLbond\someCMLbond\relax\someCMLbond}
-\def\doCMLtriplebond%
+\def\doCMLtriplebond
{\dosomeCMLbond\someCMLbond\someCMLbond\someCMLbond}
-\stopXMLmapping
+\stopXMLmapping
-\protect \endinput
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/xtag-ent.tex b/Master/texmf-dist/tex/context/base/xtag-ent.tex
index edb437ea5b6..83f1b11395a 100644
--- a/Master/texmf-dist/tex/context/base/xtag-ent.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-ent.tex
@@ -123,3 +123,4 @@
\defineXMLentity [dots] {\unknown}
\defineXMLentity [amp] {\&}
+\defineXMLentity [nbsp] {\nonbreakablespace}
diff --git a/Master/texmf-dist/tex/context/base/xtag-ext.tex b/Master/texmf-dist/tex/context/base/xtag-ext.tex
index aa522cc8c9b..f20cc05a0e4 100644
--- a/Master/texmf-dist/tex/context/base/xtag-ext.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-ext.tex
@@ -163,13 +163,25 @@
\gdef\saveXMLdata#1#2% name data-name ; definitely no \edef
{\dodoglobal\copycsname\@@XMLsave:#1\endcsname\csname\@@XMLdata:#2\endcsname}
+% \gdef\saveXMLdatainelement#1#2#3% name element data
+% {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion
+% {<#2 \currentXMLarguments>\XMLflush{#3}</#2>}}
+%
+% \gdef\saveXMLdatastructure#1#2#3#4#5#6% name element args before data after
+% {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion
+% {<#2 #3 \currentXMLarguments>#4\XMLflush{#5}#6</#2>}}
+%
+% better (no expansion):
+
+\newtoks\XMLdatatoks
+
\gdef\saveXMLdatainelement#1#2#3% name element data
- {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion
- {<#2 \currentXMLarguments>\XMLflush{#3}</#2>}}
+ {\XMLdatatoks\@EAEAEA{\csname\@@XMLdata:#3\endcsname}% no check
+ \dodoglobal\setevalue{\@@XMLsave:#1}{<#2 \currentXMLarguments>\the\XMLdatatoks</#2>}}
\gdef\saveXMLdatastructure#1#2#3#4#5#6% name element args before data after
- {\dodoglobal\setevalue{\@@XMLsave:#1}% todo: one level expansion
- {<#2 #3 \currentXMLarguments>#4\XMLflush{#5}#6</#2>}}
+ {\XMLdatatoks\@EAEAEA{\csname\@@XMLdata:#5\endcsname}% no check
+ \dodoglobal\setevalue{\@@XMLsave:#1}{<#2 #3 \currentXMLarguments>#4\the\XMLdatatoks#6</#2>}}
\gdef\gsaveXMLasdata {\doglobal\saveXMLasdata}
\gdef\gsaveXMLdata {\doglobal\saveXMLdata}
@@ -225,6 +237,11 @@
\@@XMLsave:\ifcsname\@@XMLsave:#1\endcsname#1\else\@@XMLsave\fi
\endcsname}
+\gdef\defXMLelement#1#2%
+ {\@EA\let\@EA#1\csname
+ \@@XMLsave:\ifcsname\@@XMLsave:#2\endcsname#2\else\@@XMLsave\fi
+ \endcsname}
+
\letgvalueempty{\@@XMLsave:\@@XMLsave}
\gdef\showXMLelement#1%
@@ -268,6 +285,33 @@
\egroup
+% \defineXMLcommand
+% [whatever]
+% [test=unknown]
+% {\XMLop{test}}
+%
+% \startXMLdata
+% <whatever test="{\bf test}"/>
+% \stopXMLdata
+%
+% \defineXMLcommand
+% [whatever]
+% [test=unknown]
+% {\defXMLtex\SomethingTex{\XMLop{test}}%
+% \SomethingTex}
+%
+% \startXMLdata
+% <whatever test="{\bf test}"/>
+% \stopXMLdata
+
+\def\defXMLtex#1#2% the appended space will go away when
+ {\begingroup % \scantokens is fixed
+ \disableXML
+ \everyeof{\noexpand}% br's hack
+ \edef\ascii{#2}%
+ \edef\ascii{\scantokens\expandafter{\ascii}}% space appended
+ \expandafter\endgroup\expandafter\def\expandafter#1\expandafter{\ascii}}
+
\def\potentialXMLentity#1%
{\doifXMLentityelse{#1}{\getXMLentity{#1}}{#1}}
@@ -305,7 +349,7 @@
{\csname\??xp#1\endcsname}
\appendtoks
- \defineXMLargument[\XMLprocessingparameter\c!escape]\getXMlentity
+ \defineXMLargument[\XMLprocessingparameter\c!escape]\getXMLentity
\to \aftersetupXMLprocessing
\setupXMLprocessing
@@ -320,12 +364,35 @@
\def\getXMLdeccharacter##1{\numbertoutf{##1}}%
\def\getXMLentity##1{<e>##1</e>}%
\def<{\noexpand<}%
+ \ifcase\xmlexpandmode
+ \or
+ % 1 = default
+ \or
+ % 2 = keep utf
+ \keeputfcharacters % new, needed for chinese and such
+ \fi
+ \let\uchar\relax
+ \let\unicodechar\relax
\xdef\@@globalexpanded{#1}%
\endgroup
\convertcommand\@@globalexpanded\to}
\egroup
-\installexpander \v!xml {\expandxmlargument}
+\chardef\xmlexpandmode\plusone
+
+\installexpander {xml} {\chardef\xmlexpandmode\plusone\expandxmlargument}
+\installexpander {xml:cmd} {\chardef\xmlexpandmode\plusone\expandxmlargument}
+\installexpander {xml:utf} {\chardef\xmlexpandmode\plustwo\expandxmlargument}
+
+\def\XMLtexmath#1{\begingroup\setnormalcatcodes\scantokens{\mathematics{#1}\ignorespaces}\endgroup}
+
+% \defineXMLargument[tm]{\XMLtexmath}
+%
+% \startbuffer[test]
+% Sometimes it makes sense to use simple math, as in: <tm>e=mc^2</tm>.
+% \stopbuffer
+%
+% \processXMLbuffer[test]
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/xtag-ini.tex b/Master/texmf-dist/tex/context/base/xtag-ini.tex
index 67a73bb3b8d..7579898faa1 100644
--- a/Master/texmf-dist/tex/context/base/xtag-ini.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-ini.tex
@@ -1857,7 +1857,8 @@
\@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
\long\gdef\dododefineXMLnestedenvironment#1#2#3%
- {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedenvironment{#1}{#2}{#3}}}
+ {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedenvironment{#1}{#2}{#3}}%
+ \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}}
\long\gdef\dododefineXMLnestedargument#1#2%
{\long\@EA\def\csname\@@XMLelement:#1\endcsname{\getXMLgroupedargument{#1}{#2}}%
@@ -2254,6 +2255,12 @@
\egroup
\convertcommand\@@XML@@string\to#1}
+\def\defXMLpar#1#2#3% to be documented
+ {\@EA\def\@EA#1\csname\ifcsname\@@XMLvariable:#2:#3\endcsname\@@XMLvariable:#2:#3\else\s!empty\fi\endcsname}
+
+\def\setvalueXMLpar#1#2#3% to be documented
+ {\@EA\let\csname#1\@EA\endcsname\csname\ifcsname\@@XMLvariable:#2:#3\endcsname\@@XMLvariable:#2:#3\else\s!empty\fi\endcsname}
+
\def\XMLshow#1%
{\showvalue{\@@XMLdata:#1}}
@@ -2766,10 +2773,10 @@
\def\douseXMLfilter#1%
{\doifundefined{\c!file\f!xtagprefix#1}
{\letvalue{\c!file\f!xtagprefix#1}\empty
- \makeshortfilename[\f!xtagprefix#1]%
- \writestatus{xml}{loading module #1}% will be \showmessage
+ \makeshortfilename[\truefilename{\f!xtagprefix#1}]%
\startreadingfile
- \readsysfile\shortfilename\donothing\donothing
+ % will be \showmessage
+ \readsysfile\shortfilename{\writestatus{xml}{loading module #1}}\donothing
\stopreadingfile}}
%D Temporarily here.
@@ -2798,23 +2805,14 @@
\let\dodogetgrouped\relax
\getXMLgrouped{#1}}
-%\long\gdef\docountXMLgrouped#1\end#2\end % @@ => \relax\relax
-% {\long\def\dosplitstring##1#1##2@@##3\end%
-% {\def\ascii{##2}%
-% \ifx\ascii\empty \else
-% \advance\scratchcounter 1
-% \dosplitstring##2@@#1@@\end
-% \fi}%
-% \dosplitstring#2@@#1@@\end}
-
\long\gdef\docountXMLgrouped#1\end#2\end % 1 relax is enough since it's
- {\long\def\dosplitstring##1#1##2\relax\relax##3\end % another regime
+ {\long\def\dosplitXMLstring##1#1##2\relax\relax##3\end % another regime
{\def\ascii{##2}%
\ifx\ascii\empty \else
\advance\scratchcounter \plusone
- \dosplitstring##2\relax\relax#1\relax\relax\end
+ \dosplitXMLstring##2\relax\relax#1\relax\relax\end
\fi}%
- \dosplitstring#2\relax\relax#1\relax\relax\end}
+ \dosplitXMLstring#2\relax\relax#1\relax\relax\end}
\long\unexpanded\gdef\getXMLgrouped#1% #1 kan weg % klopt dit nu?
{\groupedtoks\emptytoks
@@ -2872,4 +2870,24 @@
\def\XMLyes#1{\XMLownifequalelse{#1}{yes}{#1}{}}
+%D The next macro will set the variable \type {\flattenedXMLcontent}
+%D to the content with elements removed and entity names.
+
+\bgroup
+
+\catcode`\<\active
+\catcode`\&\active
+
+\gdef\flattenXMLcontent#1% we need taco's 'over one group'
+ {\begingroup
+ \keeputfcharacters
+ \def<##1>{}%
+ \def&##1;{##1}%
+ \edef\flattenedXMLcontent{#1}%
+ \edef\flattenedXMLcontent{\expandafter\dounspaced\flattenedXMLcontent\end}%
+ \@EA\endgroup
+ \@EA\def\@EA\flattenedXMLcontent\@EA{\flattenedXMLcontent}}
+
+\egroup
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/xtag-map.tex b/Master/texmf-dist/tex/context/base/xtag-map.tex
index 4ee23e750cb..6cd73442f57 100644
--- a/Master/texmf-dist/tex/context/base/xtag-map.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-map.tex
@@ -401,7 +401,7 @@
\appendtoks
\defineXMLentity[tex-hash]{\letterhash}%
- \defineXMLentity[tex-bar]{\myspecialvert}%
+ \defineXMLentity[tex-bar]{\myspecialnormalvert}%
\to \everyXMLremapping
\def\setnormalXMLentities% will change ! ! ! ! !
diff --git a/Master/texmf-dist/tex/context/base/xtag-mmc.tex b/Master/texmf-dist/tex/context/base/xtag-mmc.tex
index a6f7578c214..d4ee14c5994 100644
--- a/Master/texmf-dist/tex/context/base/xtag-mmc.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-mmc.tex
@@ -132,6 +132,10 @@ complex-cartesian=>\let\next\MMLccartesian,
{\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}}
{}}
+% \def\MMLcFNdefault#1#2% neg space needed because of \left
+% {#2\!% \getXMLentity{NegThinSpace}%
+% \MMLcreset\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}}
+
\def\MMLcCN#1% #2% can be sped up with \doifundefined ...
{\getXMLarguments{cn}{type="" #1}%
\doifXMLparelse{cn}{type}
@@ -533,8 +537,8 @@ complex-cartesian=>\let\next\MMLccartesian,
\doifelse\@@MMLtimesauto\v!no
{\let\@@MMLtimes@@symbol\@@MMLtimessymbol}
{\doifelseXMLRneighbors{cn}{#3}
- {\let\@@MMLtimes@@symbol\@@MMLtimesauto}
- {\let\@@MMLtimes@@symbol\v!no}}%
+ {\let\@@MMLtimes@@symbol\v!yes}
+ {\let\@@MMLtimes@@symbol\@@MMLtimessymbol}}%
\doifelse\@@MMLtimes@@symbol\v!yes
{\encapsulateXMLR{}{\times}{}{#3\empty}}
{\doifelse\@@MMLtimes@@symbol{dot}
diff --git a/Master/texmf-dist/tex/context/base/xtag-mml.tex b/Master/texmf-dist/tex/context/base/xtag-mml.tex
index b77063986dc..f2279c4f57f 100644
--- a/Master/texmf-dist/tex/context/base/xtag-mml.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-mml.tex
@@ -464,7 +464,7 @@
\defineXMLentity [nabla] {\nabla}
-\def\myspecialvert{\mathematics{\vert}} % temp hack, should stretch
+\def\myspecialnormalvert{\mathematics{\vert}} % temp hack, should stretch
\defineXMLentity [,] {{,}}
\defineXMLentity [.] {{.}}
@@ -474,7 +474,7 @@
\defineXMLentity [)] {)}
\defineXMLentity [<] {\mathematics{<}}
\defineXMLentity [>] {\mathematics{>}}
-\defineXMLentity [|] {\myspecialvert}
+\defineXMLentity [|] {\myspecialnormalvert}
\defineXMLentity [/] {/}
\defineXMLentity [*] {\times}
\defineXMLentity [=] {=}
diff --git a/Master/texmf-dist/tex/context/base/xtag-mmp.tex b/Master/texmf-dist/tex/context/base/xtag-mmp.tex
index 7cc6e5b2692..b733644e5fe 100644
--- a/Master/texmf-dist/tex/context/base/xtag-mmp.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-mmp.tex
@@ -57,18 +57,16 @@
\unprotect
-\startXMLmapping [mml]
-
\def\convertasciiafter#1#2%
{\convertargument#2\to\asciiafter
\@EA#1\@EA{\asciiafter}}
-%
-
\def\checkMMLoperator#1#2% temp hack
{\unspaceargument#1\to\ascii
\doifXMLentityelse\ascii{\getXMLentity\ascii}{#2}}
+\startXMLmapping [mml]
+
\remapXMLsequence [mi] [CPA] \MMLpMI
\remapXMLsequence [mn] [CPA] \MMLpMN
\remapXMLsequence [mo] [CPA] \MMLpMO
@@ -112,10 +110,10 @@
{\resetMMLseparator
\encapsulateXMLR
{}%
- {\pushmacro\myspecialvert % hack
- \def\myspecialvert{\;\vrule\;}%
+ {\pushmacro\myspecialnormalvert % hack
+ \def\myspecialnormalvert{\;\vrule\;}%
\grabMMLseparator{\XMLpar{mfenced}{separators}{}}%
- \popmacro\myspecialvert}
+ \popmacro\myspecialnormalvert}
{}%
{#2\empty}}
{#2}%
@@ -494,27 +492,16 @@
\def\pMULTISCRIPTmmlPRE#1#2#3#4%
{\ifdone
\ifodd\scratchcounter
- ^{\naturalxmlr{#1}{#2}{#3}{#4}}{}%
- \else
_{\naturalxmlr{#1}{#2}{#3}{#4}}%
+ \else
+ ^{\naturalxmlr{#1}{#2}{#3}{#4}}{}%
\fi
\else
\doif{mprescripts/}{#1}{\donetrue{}}% weak, the / here
\fi
- \ifdone \advance\scratchcounter 1 \fi}
+ \ifdone \advance\scratchcounter \plusone \fi}
-\def\pMULTISCRIPTmmlPOST#1#2#3#4%
- {\ifdone
- \ifnum\scratchcounter=0
- \naturalxmlr{#1}{#2}{#3}{#4}%
- \else\ifodd\scratchcounter
- _{\naturalxmlr{#1}{#2}{#3}{#4}}%
- \else
- ^{\naturalxmlr{#1}{#2}{#3}{#4}}{}%
- \fi\fi
- \fi
- \doif{mprescripts/}{#1}{\donefalse}% weak, the / here
- \ifdone \advance\scratchcounter 1 \fi}
+\let\pMULTISCRIPTmmlPOST\pMULTISCRIPTmmlPRE
\stopXMLmapping
diff --git a/Master/texmf-dist/tex/context/base/xtag-pml.tex b/Master/texmf-dist/tex/context/base/xtag-pml.tex
index 7371ec16507..b11d3d68dc7 100644
--- a/Master/texmf-dist/tex/context/base/xtag-pml.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-pml.tex
@@ -13,70 +13,71 @@
\writestatus{loading}{Context XML Macros (phys ml)}
-%D This filter runs on top of the mathml and units modules.
+%D This is a reimplmentation of the old filter. This module
+%D runs on top of the mathml and units modules.
-\useXMLfilter[mml,mmp,mmc,unt]
+\useXMLfilter[mml,mmp,mmc]
\defineXMLargument [phys] \doXMLphys
\defineXMLargument [iphys] \doXMLiphys
\defineXMLargument [dphys] \doXMLdphys
-\unprotect
+\unprotect
\unexpanded\def\doXMLphys {\ifhmode\@EA\doXMLiphys\else\@EA\doXMLdphys\fi}
\unexpanded\def\doXMLiphys{\XMLremapdata[mml]{$\ignorespaces}{\unskip$}}
\unexpanded\def\doXMLdphys{\XMLremapdata[mml]{\dostartformula{}}{\dostopformula}}
-\protect
+\protect
\doifnotmode{demo}{\endinput}
\usemodule[units]
-\starttext
+\starttext
\startXMLdata
-<phys>
- <apply> <times/>
+<phys>
+ <apply> <times/>
<cn> 10 </cn>
<ci><unit><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
- </apply>
+ </apply>
</phys>
\stopXMLdata
\startXMLdata
-<phys>
- <apply> <divide/>
+<phys>
+ <apply> <divide/>
<cn> 10 </cn>
<ci> <unit><Unit/><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
- </apply>
+ </apply>
</phys>
\stopXMLdata
\startXMLdata
-<phys>
- <apply> <times/>
+<phys>
+ <apply> <times/>
<cn> 10 </cn>
<ci> <unit> <Milli/> <Sec/> <Per/> <Square/> <Kilo/> <Meter/> </unit> </ci>
- </apply>
+ </apply>
</phys>
\stopXMLdata
\startXMLdata
-<phys>
- <apply> <times/>
+<phys>
+ <apply> <times/>
<cn> 10 </cn>
<ci> <unit><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
- </apply>
+ </apply>
</phys>
\stopXMLdata
\startXMLdata
-<phys>
- <apply> <times/>
+<phys>
+ <apply> <times/>
<cn> 10 </cn>
<ci> <unit> <Milli/> <Sec/> <Per/> <Square/> <Kilo/> <Meter/> </unit> </ci>
- </apply>
+ </apply>
</phys>
\stopXMLdata
diff --git a/Master/texmf-dist/tex/context/base/xtag-pmu.tex b/Master/texmf-dist/tex/context/base/xtag-pmu.tex
index 425257b498a..0b9509f13d9 100644
--- a/Master/texmf-dist/tex/context/base/xtag-pmu.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-pmu.tex
@@ -13,7 +13,7 @@
\writestatus{loading}{Context XML Macros (units)}
-%D Quick and dirty in||line units:
+%D Quick and dirty in||line units:
%D
%D \startbuffer
%D <phys>
@@ -21,72 +21,72 @@
%D <cu> <Newton/> <Square/> <Meter/> <Per/> <Sec/> </cu>
%D </phys>
%D \stopbuffer
-%D
+%D
%D \typebuffer \processXMLbuffer
-%D
-%D A more \MATHML||like unit application:
+%D
+%D A more \MATHML||like unit application:
%D
%D \startbuffer
-%D <phys> <apply> <unit/>
-%D <cn> 10 </cn>
+%D <phys> <apply> <unit/>
+%D <cn> 10 </cn>
%D <csymbol> <Square/> <Meter/> <Per/> <Sec/> </csymbol>
-%D </apply> </phys>
+%D </apply> </phys>
%D \stopbuffer
-%D
+%D
%D \typebuffer \processXMLbuffer
-%D
-%D A bit more compact:
+%D
+%D A bit more compact:
%D
%D \startbuffer
-%D <phys> <apply> <unit/>
-%D <cn> 10 </cn>
+%D <phys> <apply> <unit/>
+%D <cn> 10 </cn>
%D <cu> <Square/> <Meter/> <Per/> <Sec/> </cu>
-%D </apply> </phys>
+%D </apply> </phys>
%D \stopbuffer
-%D
+%D
%D \typebuffer \processXMLbuffer
%D
-%D A bit more complicated:
-%D
+%D A bit more complicated:
+%D
%D \startbuffer
-%D <phys> <apply> <unit/>
-%D <apply> <divide/> <ci> a </ci> <cn> 10 </cn> </apply>
+%D <phys> <apply> <unit/>
+%D <apply> <divide/> <ci> a </ci> <cn> 10 </cn> </apply>
%D <cu> <Square/> <Meter/> <Per/> <Sec/> </cu>
-%D </apply> </phys>
+%D </apply> </phys>
%D \stopbuffer
-%D
+%D
%D \typebuffer \processXMLbuffer
-%D
-%D An alternative (equivalent) for \type {</cu>}:
+%D
+%D An alternative (equivalent) for \type {</cu>}:
%D
%D \startbuffer
-%D <phys> <apply> <unit/>
+%D <phys> <apply> <unit/>
%D <cn> 10 </cn> <cunseq> <Square/> <Meter/> <Per/> <Sec/> </cunseq>
-%D </apply> </phys>
+%D </apply> </phys>
%D \stopbuffer
-%D
+%D
%D \typebuffer \processXMLbuffer
\defineXMLsingular [unitmeaning] [label=] \doPMLunitmeaning
-\def\doPMLunitmeaning%
+\def\doPMLunitmeaning
{\expanded{\unitmeaning{\XMLop{label}}}}
-
+
\startXMLmapping [mml]
-\remapXMLsequence [unit] [CPA] \doPMLuseq
-\remapXMLsingular [unit] [CPA] \doPMLunit % #2\empty
+\remapXMLsequence [unit] [CPA] \doPMLuseq
+\remapXMLsingular [unit] [CPA] \doPMLunit % #2\empty
\remapXMLsequence [cunseq] [CPA] \doPMLuseq % #2
-\remapXMLsequence [cu] [CPA] \doPMLuseq % #2
+\remapXMLsequence [cu] [CPA] \doPMLuseq % #2
\newif\ifPMLunit \PMLunittrue
\def\doPMLuseq#1#2{\PMLunittrue\ignorespaces#2\unskip\PMLunitfalse}
-\def\doPMLunit#1#2\empty{\ignorespaces#2\unskip}
+\def\doPMLunit#1#2\empty{\ignorespaces#2\unskip}
\def\handlePMLunit#1{\ifPMLunit\ignorespaces#1\fi\ignorespaces}
-%D All unit commands are remapped in a similar way.
+%D All unit commands are remapped in a similar way.
\remapXMLsingular [Atto] [C] {\handlePMLunit\Atto}
\remapXMLsingular [Femto] [C] {\handlePMLunit\Femto}
@@ -180,9 +180,9 @@
\remapXMLsingular [Promille] [C] {\handlePMLunit\Promille}
\remapXMLsingular [Permille] [C] {\handlePMLunit\Permille}
-\remapXMLsingular [Unit] [C] {\handlePMLunit\Unit}
+\remapXMLsingular [Unit] [C] {\handlePMLunit\Unit}
\remapXMLsingular [NoUnit] [C] {\handlePMLunit\NoUnit}
\stopXMLmapping
-\endinput
+\endinput
diff --git a/Master/texmf-dist/tex/context/base/xtag-pre.tex b/Master/texmf-dist/tex/context/base/xtag-pre.tex
index e589e39bed8..da720bbc77c 100644
--- a/Master/texmf-dist/tex/context/base/xtag-pre.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-pre.tex
@@ -411,4 +411,24 @@
%
% \defineXMLsingular [gobblespacetokens] {\gobblespacetokens}
+%D We automatically switch regimes (beware of nested files!):
+%D
+%D \starttyping
+%D \startXMLdata
+%D <?xml version='1.0' encoding='utf-8'?>
+%D ÀÁÂÃÄÅàáâãäåÆÇæç
+%D ÈÉÊËèéêëÌÍÎÏÞìíîïþ
+%D ÐðÑñÒÓÔÕÖòóôõöØø
+%D ÙÚÛÜùúûÝýÿß
+%D \stopXMLdata
+%D \stoptyping
+
+\defineXMLprocessor [xml] {\handleXMLbanner}
+
+\def\handleXMLbanner#1%
+ {\getXMLarguments{xml}{\s!encoding='' #1}%
+ \doifsomething{\XMLpar{xml}\s!encoding\empty}
+ {\doif\currentregime\s!default % style regimes will take precedence
+ {\enableregime[\XMLpar{xml}\s!encoding\empty]}\donothing}}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/xtag-run.tex b/Master/texmf-dist/tex/context/base/xtag-run.tex
index 6d1d3078d17..face9f0b0b3 100644
--- a/Master/texmf-dist/tex/context/base/xtag-run.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-run.tex
@@ -172,7 +172,7 @@
{\def\docommando##1{#1[##1]#2#3\letvalue{\@@XMLshow:##1}\empty}%
\processcommalist[#4]\docommando}
-\gdef\showXMLinh[#1]%
+\gdef\showXMLign[#1]%
{\setXMLshow\defineXMLignore \relax\relax[#1]%
\setXMLshow\defineXMLsingular \relax\relax[#1]}
@@ -305,7 +305,7 @@
\fi}%
\egroup}
-\gdef\showXMLinh#1%
+\gdef\showXMLinh[#1]%
{\doifsomething{#1}
{\bgroup\infofont[%
\dorecurse\XMLdepth
diff --git a/Master/texmf-dist/tex/context/base/xtag-stk.tex b/Master/texmf-dist/tex/context/base/xtag-stk.tex
new file mode 100644
index 00000000000..32b2b87dfad
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/xtag-stk.tex
@@ -0,0 +1,235 @@
+%D \module
+%D [ file=xtag-exp,
+%D version=2006.01.19,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=Stacking Data,
+%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.
+
+\beginTEX
+ \writestatus{XML}{sorry, XML is only supported in (pdf)etex}
+ \endinput
+\endTEX
+
+\writestatus{loading}{Context XML Macros (stacks)}
+
+%D This module is experimental. Don't use it (yet). It needs a
+%D clean-up. The stack handler is used in the third MathML renderer.
+
+\unprotect
+
+\ifx\XMLRtoks \undefined \newtoks \XMLRtoks \fi
+\ifx\XMLstacklevel\undefined \newcount\XMLstacklevel \fi
+
+\def\@@xmlstack{xmlstack}
+
+\let\XMLstackid\empty
+
+\def\resetXMLelements
+ {\XMLstacklevel\zerocount}
+
+\def\startsavingXMLelements % maybe something with \ignorespaces \\removeunwantedspaces
+ {\XMLstacklevel\zerocount
+ \let\normalexecuteXMLelement\executeXMLelement
+ \def\executeXMLelement{\csname\@@XMLelement:\@@xmlstack\ifcase\kindofXMLelement\or\or\or/\fi\endcsname}}
+
+\def\stopsavingXMLelements
+ {\let\executeXMLelement\normalexecuteXMLelement}
+
+\defineXMLnestedenvironmentsave
+ [\@@xmlstack]
+ {}
+ {\pushXMLdataonstack}
+
+\startXMLmapping[xmlstack:test]
+
+ \defineXMLnestedenvironmentsave
+ [\@@xmlstack]
+ {}
+ {\pushXMLnameonstack}
+
+ % in mathml handler:
+ %
+ % \defineXMLnested
+ % [apply]
+ % {\startsavingXMLelements}
+ % {\stopsavingXMLelements}
+
+\stopXMLmapping
+
+\def\pushXMLdataonstack
+ {\advance\XMLstacklevel\plusone
+ \letvalue {\@@xmlstack:n:\XMLstackid:\number\XMLstacklevel}\currentXMLelement
+ \saveXMLdata {\@@xmlstack:t:\XMLstackid:\number\XMLstacklevel} \@@xmlstack
+ \saveXMLdatainelement{\@@xmlstack:d:\XMLstackid:\number\XMLstacklevel}\currentXMLelement\@@xmlstack}
+
+\def\pushXMLnameonstack
+ {\advance\XMLstacklevel\plusone
+ \letvalue {\@@xmlstack:n:\XMLstackid:\number\XMLstacklevel}\currentXMLelement}
+
+\def\eraseXMLdataonstack#1%
+ {\letvalue{\@@xmlstack:n:\XMLstackid:\number#1}\empty
+ \XMLerase{\@@xmlstack:t:\XMLstackid:\number#1}%
+ \XMLerase{\@@xmlstack:d:\XMLstackid:\number#1}}
+
+\def\getXMLstackdata{\getXMLstackiddata\XMLstackid}
+\def\getXMLstackname{\getXMLstackidname\XMLstackid}
+\def\getXMLstacktext{\getXMLstackidtext\XMLstackid}
+
+\def\getXMLstackiddata#1#2{\flushXMLelement{\@@xmlstack:d:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}}
+\def\getXMLstackidname#1#2{\getvalue {\@@xmlstack:n:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}}
+\def\getXMLstackidtext#1#2{\flushXMLelement{\@@xmlstack:t:#1:\ifnum#2>\XMLstacklevel\else\number#2\fi}}
+
+\def\rawXMLstackdata{\rawXMLstackiddata\XMLstackid}
+\def\rawXMLstackname{\rawXMLstackidname\XMLstackid}
+\def\rawXMLstacktext{\rawXMLstackidtext\XMLstackid}
+
+\def\rawXMLstackiddata#1#2{\flushXMLelement{\@@xmlstack:d:#1:\number#2}}
+\def\rawXMLstackidname#1#2{\getvalue {\@@xmlstack:n:#1:\number#2}}
+\def\rawXMLstackidtext#1#2{\flushXMLelement{\@@xmlstack:t:#1:\number#2}}
+
+\def\defXMLstackiddata#1#2#3%
+ {\defXMLelement#1{\@@xmlstack:d:#2:\ifnum#3>\XMLstacklevel\else\number#3\fi}}
+
+\def\defXMLstackdata#1% #2
+ {\defXMLstackiddata#1\XMLstackid}
+
+\def\showXMLstacknames
+ {\hbox{[\space\dorecurse\XMLstacklevel{\getXMLstackname\recurselevel\space}]}}
+
+\def\flushXMLstackfrom#1%
+ {\dostepwiserecurse{#1}\XMLstacklevel\plusone
+ {\getXMLstackdata\recurselevel}}
+
+\def\flushXMLstackwith#1#2%
+ {\dostepwiserecurse{#1}\XMLstacklevel\plusone
+ {\relax\ifnum\recurselevel>#1\relax#2\fi
+ \getXMLstackdata\recurselevel}}
+
+\def\flushXMLnamedstackwith#1#2#3%
+ {\dostepwiserecurse{#1}\XMLstacklevel\plusone
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}}
+ {\ifnum\recurselevel>#1\relax#3\fi
+ \getXMLstackdata\recurselevel}}}
+
+\def\countXMLnamedstack#1% todo: \nofXMLchildren ! ! ! ! !
+ {\scratchcounter\zerocount
+ \dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}}
+ {\advance\scratchcounter\plusone}}}
+
+\def\collectXMLstack#1%
+ {\XMLRtoks\emptytoks
+ \dorecurse\XMLstacklevel
+ {\ifnum\recurselevel>\plusone\appendtoks#1\to\XMLRtoks\fi
+ \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}}
+
+\def\collectXMLstackrows#1#2%
+ {\XMLRtoks\emptytoks
+ \dostepwiserecurse{#1}\XMLstacklevel\plusone
+ {\ifnum\recurselevel>#1\appendtoks#2\to\XMLRtoks\fi
+ \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}}
+
+\def\collectXMLnamedstack#1#2%
+ {\XMLRtoks\emptytoks
+ \dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}}
+ {\ifnum\recurselevel>\plusone\appendtoks#2\to\XMLRtoks\fi
+ \expandafter\appendtoks\expandafter\getXMLstackdata\expandafter{\recurselevel}\to\XMLRtoks}}}
+
+\def\collectXMLnamedstacknamed#1#2#3% names, inbetween, nestednames (maddness, this macro)
+ {\XMLRtoks\emptytoks
+ \!!doneafalse
+ \let\globalascii\empty
+ \dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}}
+ {\begingroup
+ \startsavingXMLelements
+ \rawXMLstacktext\recurselevel % still on stack, raw does not test
+ \stopsavingXMLelements
+ \let\globalascii\empty
+ \dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}}
+ {\xdef\globalascii{\getXMLstackdata\recurselevel}}}%
+ \endgroup
+ \ifx\globalascii\empty\else
+ \if!!donea\appendtoks#3\to\XMLRtoks\fi
+ \expandafter\appendtoks\globalascii\to\XMLRtoks
+ \!!doneatrue
+ \fi}}}
+
+\def\XMLcopydata#1#2% to from
+ {\@EA\let\csname\@@XMLdata:#1\@EA\endcsname\csname\@@XMLdata:#2\endcsname}
+\def\XMLcopysave#1#2% to from
+ {\@EA\let\csname\@@XMLsave:#1\@EA\endcsname\csname\@@XMLsave:#2\endcsname}
+
+\def\removeXMLdatafromstack#1%
+ {\dorecurse\XMLstacklevel
+ {\doif{\getXMLstackname\recurselevel}{#1}
+ {\dostepwiserecurse\recurselevel{\numexpr\XMLstacklevel+\minusone}\plusone
+ {\scratchcounter\numexpr\recurselevel+\plusone\relax
+ \@EA\let\csname\@@xmlstack:n:\XMLstackid:\recurselevel\@EA\endcsname\csname\@@xmlstack:n:\XMLstackid:\number\scratchcounter\endcsname
+ \XMLcopysave{\@@xmlstack:t:\XMLstackid:\recurselevel}{\@@xmlstack:t:\XMLstackid:\number\scratchcounter}%
+ \XMLcopysave{\@@xmlstack:d:\XMLstackid:\recurselevel}{\@@xmlstack:d:\XMLstackid:\number\scratchcounter}}%
+ \advance\XMLstacklevel\minusone
+ \exitloop}}}
+
+%D BEWARE: these names may change (get stack in the name)
+
+\def\XMLallnamed#1%
+ {\dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}}
+ {\getXMLstackdata\recurselevel}}}
+
+\def\defXMLfirstnamed#1#2% \cs list
+ {\dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}}
+ {\defXMLstackdata#1\recurselevel\exitloop}}}
+
+\def\defXMLfirstnamedtext#1#2% \cs list
+ {\dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}}
+ {\edef#1{\getXMLstacktext\recurselevel}\exitloop}}}
+
+\def\XMLfirstnamed#1%
+ {\dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}}
+ {\getXMLstackdata\recurselevel\exitloop}}}
+
+\def\XMLnotnamed#1%
+ {\dorecurse\XMLstacklevel
+ {\expanded{\doifnotinset{\getXMLstackname\recurselevel}{#1}}
+ {\getXMLstackdata\recurselevel\exitloop}}}
+
+\let\XMLstackposition\!!zerocount
+
+\def\XMLdoifonstackelse#1% was \XMLdoifelsefound
+ {\!!doneafalse
+ \let\XMLstackposition\!!zerocount
+ \dorecurse\XMLstacklevel
+ {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}}
+ {\let\XMLstackposition\recurselevel\!!doneatrue\exitloop}}%
+ \if!!donea
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+
+%D Handy:
+
+\def\pushXMLmeaning#1% or [#1]
+ {\@EA\pushmacro\csname\@@XMLelement:#1/\endcsname
+ \@EA\pushmacro\csname\@@XMLelement:#1\endcsname
+ \@EA\pushmacro\csname\@@XMLelement:/#1\endcsname}
+
+\def\popXMLmeaning#1% or [#1]
+ {\@EA\popmacro\csname\@@XMLelement:#1/\endcsname
+ \@EA\popmacro\csname\@@XMLelement:#1\endcsname
+ \@EA\popmacro\csname\@@XMLelement:/#1\endcsname}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/xtag-xsl.tex b/Master/texmf-dist/tex/context/base/xtag-xsl.tex
index 4d844c8e151..7981524d15d 100644
--- a/Master/texmf-dist/tex/context/base/xtag-xsl.tex
+++ b/Master/texmf-dist/tex/context/base/xtag-xsl.tex
@@ -106,7 +106,7 @@
\doifundefined{\??xl#1}%
{\writestatus{XSLT}{unknown script #1}}
{\writestatus{XSLT}{convert #2 into #3 using #1}%
- \edef\par{\rawcharacter{13}}%
+ \edef\par{\rawcharacter{10}}%
\edef\!!stringc{\getvalue{\??xl#1}}%
\immediate\openout\scratchwrite=\XSLTscriptfile.xsl
\immediate\write\scratchwrite{\!!stringc}%